profile
viewpoint
Saša Jurić sasa1977 Very Big Things Zagreb, Croatia http://theerlangelist.com

sasa1977/con_cache 812

ets based key/value cache with row level isolated writes and ttl support

sasa1977/elixir-in-action 734

Code samples for Elixir in Action book

sasa1977/exactor 663

Helpers for simpler implementation of GenServer based processes

sasa1977/boundary 558

Manage and restrain cross-module dependencies in Elixir projects

sasa1977/fsm 347

Finite State Machine data structure

sasa1977/erlangelist 245

Source code of The Erlangelist blog

sasa1977/ci 207

CI/CD toolkit as a library

J0/phoenix_gen_socket_client 196

Socket client behaviour for phoenix channels

issue commentsasa1977/boundary

Can't depend on nested boundaries

FYI I've just pushed this as a part of version 0.9.0 to hex.

sokolnickim

comment created time in 2 days

issue commentsasa1977/boundary

Phoenix.Param.Any not implicitly imported as dependency

This is now pushed to hex in version 0.9.0

pzingg

comment created time in 2 days

issue commentsasa1977/boundary

Boundary.Mix.Xref RuntimeError

Pushed 0.9.0 to hex

aptinio

comment created time in 2 days

created tagsasa1977/boundary

tag0.9.0

Manage and restrain cross-module dependencies in Elixir projects

created time in 2 days

push eventsasa1977/boundary

Saša Jurić

commit sha 2fdea46e702400c152670262d5ca1f31edbd4fa1

Bump version

view details

push time in 2 days

issue commentsasa1977/boundary

Boundary.Mix.Xref RuntimeError

Thanks! The fix is now merged to master, and I plan to prepare the hex release soon.

aptinio

comment created time in 2 days

delete branch sasa1977/boundary

delete branch : fix-lexical-tracker-issues

delete time in 2 days

push eventsasa1977/boundary

Saša Jurić

commit sha 6a7ad2bde2005c2d440b21b1958ddba0bd70d461

Stop encoding boundary def

view details

Saša Jurić

commit sha 853dad0f8b4959aed89138c4f3e436a21f47d851

Reduce the amount of persisted data Previously the entire env was stored, but now we only care about file/line.

view details

Saša Jurić

commit sha c7bf6dfa76eb414efa9e3406bdc00f24c0f96c8d

Merge pull request #42 from sasa1977/fix-lexical-tracker-issues Fix lexical tracker issues

view details

push time in 2 days

PR merged sasa1977/boundary

Fix lexical tracker issues

resolves #41

+94 -82

0 comment

4 changed files

sasa1977

pr closed time in 2 days

issue closedsasa1977/boundary

Boundary.Mix.Xref RuntimeError

Here's a minimum example to reproduce this issue: https://github.com/aptinio/boundary-mix-xref-error

Steps to reproduce:

  1. run mix clean
  2. run mix foo.ci
  3. run mix foo.ci again

Expected result

CI result is consistent between runs.

Actual result

Succeeding mix foo.ci runs fail with:

07:47:57.271 [error] GenServer Boundary.Mix.Xref terminating
** (RuntimeError) attempted to cast GenServer Boundary.Mix.Xref but no handle_cast/2 clause was provided
    (boundary 0.8.0) lib/gen_server.ex:819: Boundary.Mix.Xref.handle_cast/2
    (stdlib 3.16.1) gen_server.erl:695: :gen_server.try_dispatch/4
    (stdlib 3.16.1) gen_server.erl:771: :gen_server.handle_msg/6
    (stdlib 3.16.1) proc_lib.erl:226: :proc_lib.init_p_do_apply/3
Last message: {:"$gen_cast", {:remote_dispatch, Ecto.Changeset, :runtime}}
State: %{}
** (EXIT from #PID<0.94.0>) an exception was raised:
    ** (RuntimeError) attempted to cast GenServer Boundary.Mix.Xref but no handle_cast/2 clause was provided
        (boundary 0.8.0) lib/gen_server.ex:819: Boundary.Mix.Xref.handle_cast/2
        (stdlib 3.16.1) gen_server.erl:695: :gen_server.try_dispatch/4
        (stdlib 3.16.1) gen_server.erl:771: :gen_server.handle_msg/6
        (stdlib 3.16.1) proc_lib.erl:226: :proc_lib.init_p_do_apply/3

mix ecto.rollback --all took 0.7 seconds
CI checks took 3.9 seconds
** (Mix) mix ecto.rollback --all exited with status 1

Notes

  1. removing mix("ecto.rollback --all") from lib/mix/foo/ci.ex stops the error from happening
  2. removing --force from mix("compile --force --warnings-as-errors") stops the error from happening

Workaround

Replace

[
  mix("compile --force --warnings-as-errors"),
  # ...
]

with

[
  mix("clean"),
  mix("compile --warnings-as-errors"),
  # ...
]

I only found this workaround and the things that stop the error from happening while creating the minimal repo, but went ahead with filing this issue in the hopes that it'll be somewhat helpful.

closed time in 2 days

aptinio

PR opened sasa1977/boundary

Fix lexical tracker issues

resolves #41

+94 -82

0 comment

4 changed files

pr created time in 2 days

issue commentsasa1977/boundary

Boundary.Mix.Xref RuntimeError

Thanks for the report!

With the help of @josevalim I produced the fix. It's currently in the fix-lexical-tracker-issues branch if you want to give it a try.

aptinio

comment created time in 3 days

create barnchsasa1977/boundary

branch : fix-lexical-tracker-issues

created branch time in 3 days

delete branch sasa1977/boundary

delete branch : fix-dep-to-protocol-impl

delete time in 15 days

push eventsasa1977/boundary

Saša Jurić

commit sha 6dbf8234e893c47abda20c58b147e269ca19185f

Add a failing test

view details

Saša Jurić

commit sha c95aecf70b0d68f9f884d9720ff1b2c8130f6a77

Fix deps to external protocol impls Resolves #39

view details

Saša Jurić

commit sha 4ae0f663ddcf6482ef1dafd51e812c5c12376836

Reword doc

view details

Saša Jurić

commit sha 298b505a8fc8aa6a4ad8d8915b47d968a9143cec

Merge pull request #40 from sasa1977/fix-dep-to-protocol-impl Fix dep to protocol impl

view details

push time in 15 days

issue closedsasa1977/boundary

Phoenix.Param.Any not implicitly imported as dependency

When using the @derive {Phoenix.Param, :param_key} macro to implement the Phoenix.Param protocol for an Ecto.Schema module inside a top-level MySystemSchemas boundary module, I get this boundary compile-time warning:

Error: (references from MySystemSchemas to Phoenix.Param.Any are not allowed)

Here's the boundary definition in the MySystemSchemas top-level module. I could not add Phoenix.Param.Any to the list of deps.

use Boundary, deps: [Ecto, Phoenix.Param], exports: [...]

The workaround is to actually write out the defimpl Phoenix.Param instead of using the @derive macro. But I'm hoping there's a solution that would let me use the macro.

closed time in 15 days

pzingg

PR merged sasa1977/boundary

Fix dep to protocol impl
+31 -10

0 comment

4 changed files

sasa1977

pr closed time in 15 days

delete branch sasa1977/boundary

delete branch : fix-recompile-behaviour

delete time in 15 days

PR opened sasa1977/boundary

Fix dep to protocol impl
+31 -10

0 comment

4 changed files

pr created time in 15 days

issue commentsasa1977/boundary

Phoenix.Param.Any not implicitly imported as dependency

Thanks! This was a bug in boundary. I've pushed a fix to the branch fix-dep-to-protocol-impl. Could you please give it a try?

pzingg

comment created time in 15 days

create barnchsasa1977/boundary

branch : fix-dep-to-protocol-impl

created branch time in 15 days

issue commentsasa1977/boundary

Phoenix.Param.Any not implicitly imported as dependency

Could you please provide a minimal working example? I just tried the following locally:

defmodule MySystem do
  use Boundary,
    deps: [Phoenix.Param],
    type: :strict
end

defmodule MySystem.MySchema do
  @derive {Phoenix.Param, :param_key}
end

And this works as expected: the code above emits no warnings (unless the dep to param is removed).

pzingg

comment created time in 16 days

push eventsasa1977/boundary

Aaron Tinio

commit sha 17220144a834fca310aec5347be84b0898e021e4

Fix Boundary.t().type typespec

view details

Saša Jurić

commit sha 4c1edcb3bb056cdd601bbd9b5a249ae76077f771

Merge pull request #35 from aptinio/patch-1 Fix Boundary.t().type typespec

view details

push time in 19 days

PR merged sasa1977/boundary

Fix Boundary.t().type typespec
+1 -1

0 comment

1 changed file

aptinio

pr closed time in 19 days

pull request commentsasa1977/boundary

Fix example of default checked apps

Sorry for the late review, somehow I completely missed this :( Thanks for the contribution!

aptinio

comment created time in 19 days

push eventsasa1977/boundary

Aaron Tinio

commit sha ec33562c9a512520185f23d4371058e512f5d7e6

Fix example of default checked apps

view details

Saša Jurić

commit sha 3d0c56252bd37cdb3aa1eab5acec277c133cc227

Merge pull request #36 from aptinio/patch-2 Fix example of default checked apps

view details

push time in 19 days

PR merged sasa1977/boundary

Fix example of default checked apps
+1 -1

0 comment

1 changed file

aptinio

pr closed time in 19 days

pull request commentsasa1977/boundary

Allow re-exporting from sub boundaries

Thank you!

randycoulman

comment created time in 19 days

PR merged sasa1977/boundary

Allow re-exporting from sub boundaries

Closes #34

Allow a boundary to re-export exports from its descendant boundaries.

This makes it possible to (for example) export the App.Context.User Ecto schema from App for use in AppWeb.

Also:

  • fixed a couple of minor doc typos

Current state:

  • I've implemented the test cases suggested in https://github.com/sasa1977/boundary/issues/34#issuecomment-950384115
  • I have an implementation that allows the exports to work
  • I'm still seeing forbidden reference errors when attempting to use one of these exports; I haven't had time (yet) to dig in and figure those out.

TODO:

  • [x] Fix forbidden reference issues
  • [ ] Update documentation

@sasa1977 I'd love your input on whether the tests look OK and any comments on the implementation. I'll leave a couple of line comments in specific spots where I'm especially curious.

<details><summary>Current test output</summary>

$ mix test
.....................................................

  1) test boundary can export a non-root export of a sub-boundary (Mix.Tasks.Compile.BoundaryTest)
     test/mix/tasks/compile/boundary_test.exs:738
     Assertion with == failed
     code:  assert warnings == []
     left:  [
              %{__struct__: Mix.Task.Compiler.Diagnostic, compiler_name: "boundary", details: nil, message: "forbidden reference to Module120.SubModule.Foo\n  (references from Module121 to Module120.SubModule are not allowed)", position: 13, severity: :warning}
            ]
     right: []
     stacktrace:
       test/mix/tasks/compile/boundary_test.exs:755: (test)

.........

  2) test boundary can export an export of a sub-sub-boundary (Mix.Tasks.Compile.BoundaryTest)
     test/mix/tasks/compile/boundary_test.exs:761
     Assertion with == failed
     code:  assert warnings == []
     left:  [
              %{__struct__: Mix.Task.Compiler.Diagnostic, compiler_name: "boundary", details: nil, message: "forbidden reference to Module122.SubBoundary.SubSubBoundary.Foo\n  (references from Module123 to Module122.SubBoundary.SubSubBoundary are not allowed)", position: 17, severity: :warning}
            ]
     right: []
     stacktrace:
       test/mix/tasks/compile/boundary_test.exs:782: (test)

....................

Finished in 25.4 seconds (1.1s async, 24.3s sync)
84 tests, 2 failures

</details>

+148 -14

5 comments

3 changed files

randycoulman

pr closed time in 19 days

push eventsasa1977/boundary

Randy Coulman

commit sha b2bfd3bb110a0166770caaccfa6c4fcf45923b41

WIP: allow re-exporting from sub boundaries Allow a boundary to re-export exports from its descendant boundaries. This makes it possible to (for example) export the `App.Context.User` Ecto schema from `App` for use in `AppWeb`.

view details

Randy Coulman

commit sha 9b5e471389b9d4c9e45b92b9de0cb0769f21018b

Simplify validate_export Extracted an `exported_by_child_subboundary?` function to clean up `validate_export` a bit.

view details

Randy Coulman

commit sha 74c2c6fe9d589f0a052ca842cea18bc7e892ce22

Generalize to_boundaries to look for all ancestors

view details

Randy Coulman

commit sha f19b4ef0b0f67582106bdcc63c04d762795826ed

Fix failing test Omit the `from_boundary` from the list of possible `to_boundary` ancestors to avoid false positive references.

view details

Randy Coulman

commit sha 7072b41115da7dee524afeafb95a0b300e73288f

Refactor `exported_by_child_boundary?/3` It can now handle the middle two `cond` clauses of `validate_export`.

view details

Randy Coulman

commit sha 36d5a739d4e42c99a3203d790e57eec28d052ef7

Add documentation for re-exporting

view details

Saša Jurić

commit sha efe67c14dc2c80fc493d8a41ecd6d673a1bf7aa6

Merge pull request #38 from randycoulman/allow-re-exporting-from-child-boundaries Allow re-exporting from sub boundaries

view details

push time in 19 days

more