Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bonny Events throw without :operator_name in prod #199

Closed
kennethito opened this issue Mar 7, 2023 · 2 comments
Closed

Bonny Events throw without :operator_name in prod #199

kennethito opened this issue Mar 7, 2023 · 2 comments

Comments

@kennethito
Copy link

Environment

  • Bonny 1.1.1
  • elixir 1.14.3-otp-25
  • erlang 25.2.3
  • ubuntu 20

Current behavior

Events created with https://github.com/coryodaniel/bonny/blob/master/lib/bonny/event.ex#L63 eventually call down to https://github.com/coryodaniel/bonny/blob/master/lib/bonny/config.ex#L69 which throws an exception in MIX_ENV=prod. This is easily worked around by setting :operator_name here, https://github.com/coryodaniel/bonny/blob/master/lib/bonny/config.ex#L33

2023-03-07 01:25:04.253 [error]  Task #PID<0.2383.0> started from #PID<0.2378.0> terminating
** (UndefinedFunctionError) function Mix.Project.config/0 is undefined (module Mix.Project is not available)
    Mix.Project.config()
    (bonny 1.1.1) lib/bonny/config.ex:65: Bonny.Config.project_name/0
    (bonny 1.1.1) lib/bonny/config.ex:34: Bonny.Config.name/0
    (bonny 1.1.1) lib/bonny/event.ex:63: Bonny.Event.new!/1
    (bonny 1.1.1) lib/bonny/axn.ex:168: Bonny.Axn.success_event/2
    (game_scaler 0.1.0) lib/game_scaler/controllers/deployment_controller.ex:1: GameScaler.Controller.DeploymentController.pluggable_builder_call/2
    (game_scaler 0.1.0) lib/game_scaler/operator.ex:1: GameScaler.Operator.pluggable_builder_call/2
    (bonny 1.1.1) lib/bonny/operator.ex:148: Bonny.Operator.run/4

Expected behavior

The default for Bonny.Config.name/1 defaults should work in MIX_ENV=prod

@mruoss
Copy link
Collaborator

mruoss commented Mar 7, 2023

Duplicate of #180. Can you try if it's fixed in 1.1.2? You're gonna have to regenerate the manifest first, though.

@mruoss
Copy link
Collaborator

mruoss commented Mar 9, 2023

I'm gonna close this. Let me know if it's still a problem.

@mruoss mruoss closed this as not planned Won't fix, can't repro, duplicate, stale Mar 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants