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

How do I stop the ForestAdmin Background Process #608

Open
klondikemarlen opened this issue Mar 13, 2023 · 4 comments
Open

How do I stop the ForestAdmin Background Process #608

klondikemarlen opened this issue Mar 13, 2023 · 4 comments

Comments

@klondikemarlen
Copy link

klondikemarlen commented Mar 13, 2023

Expected behavior

Once I boot the app, I can set an environment variable that prevents ForestAdmin from generating schema changes.
I'm currently using

export FOREST_DISABLE_AUTO_SCHEMA_APPLY=true

but this does not prevent ForestAdmin schema from generating.

Actual behavior

Once I boot the app, the ForestAdmin schema generator starts running, and if my schema is out of date it creates some unstaged changes in git. I can't figure out how to get it to stop generating changes, even when I close my app.

This is particularly annoying because it generates changes every time I switch branches, and then blocks me from switching again until I clear the changes that are generated.

e.g.

  1. git checkout main
  2. git checkout some-other-branch
  3. Oh no! I ForestAdmin just generated some changes and I can't switch branches!
  4. git reset --hard origin/main
  5. git checkout some-other-branch (again)
  6. git checkout some-other-other-branch
  7. Oh no! I ForestAdmin just generated some changes and I can't switch branches!
  8. git reset --hard origin/some-other-other-branch
  9. git checkout some-other-other-branch (again)

Context

  • Package Version: gem 'forest_liana', '~> 7.8.0'
  • Rails Version: gem 'rails', '~> 7.0.4.1'
  • Database Dialect: gem 'pg', '~> 1.3.3'
  • Database Version: PostgreSQL 14.7
@matthv
Copy link
Member

matthv commented Mar 21, 2023

Hello @klondikemarlen,

Sorry for my late reply.
The environment variable FOREST_DISABLE_AUTO_SCHEMA_APPLY is dedicated to disable the sending of the schema to our api.

The only way to disable the generation of the .forestadmin-schema.json file is to switch to production mode.

https://github.com/ForestAdmin/forest-rails/blob/main/lib/forest_liana/bootstrapper.rb#L83-L87

@klondikemarlen
Copy link
Author

@matthv Thanks for the explanation.

Since I'm developing, setting my entire Rails environment to production, isn't feasible.

Would it be possible to add a feature so that I could do

export FOREST_DISABLE_AUTO_SCHEMA=true

and it would turn off ForestAdmin schema generation?

@matthv
Copy link
Member

matthv commented Mar 22, 2023

I have just added your request to our ProductBoard.

@jjf21
Copy link

jjf21 commented Jan 16, 2024

Any news on this topic ?

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

3 participants