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

Fix check of app.routes in app/config.py #263

Closed
wants to merge 3 commits into from
Closed

Conversation

rknop
Copy link

@rknop rknop commented Nov 3, 2021

As is, it would object that app.routes had changed from the default config file if you added something else from app.* (e.g. app.secret_key) to the config file without also copying app.routes from the default config file to the config file. Modify ensure_yaml_routes_matches_defaults in app/config.py to just check app.routes and make sure they're either not present, or not changed from the defaulits.

@pep8speaks
Copy link

pep8speaks commented Nov 3, 2021

Hello @rknop! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 21:9: E201 whitespace after '('
Line 21:34: E202 whitespace before ')'
Line 21:42: E201 whitespace after '('
Line 21:77: E202 whitespace before ')'
Line 23:80: E501 line too long (80 > 79 characters)
Line 24:31: E201 whitespace after '('

Comment last updated at 2022-01-05 20:39:53 UTC

@stefanv
Copy link
Contributor

stefanv commented Nov 3, 2021

Thanks @rknop!

@acrellin @dmitryduev Do you know why this is necessary in baselayer? I don't see why the config.yaml.defaults and config.yaml have to match.

@acrellin
Copy link
Member

acrellin commented Nov 3, 2021

Thanks @rknop!
I'm okay with this change. @stefanv We had previously been checking to ensure that there was no difference between app.routes in config.yaml and the defaults to avoid webpack errors related to missing components. This proposed change simply skips that check if app.routes is missing entirely in config.yaml (defaulting to the values in defaults makes sense here).

@stefanv
Copy link
Contributor

stefanv commented Nov 3, 2021

I agree that the PR is correct, but as far as the motivation for the original change we may want to document it at the top of the config file so that users know they have to reproduce that section exactly.

@rknop We are using Python 3.8, so if you want to use that syntax you are welcome.

@dmitryduev
Copy link
Contributor

@stefanv the reasoning for this was to save us from silently but constantly shooting ourselves in the foot when deploying new versions of Fritz with new components - we forgot too many times to propagate the changes in the BL/SP default config into Fritz's.

@stefanv
Copy link
Contributor

stefanv commented Nov 4, 2021

@dmitryduev It looks to me as though this only compares .default.yaml and .yaml — the way I'd expect. Because otherwise you would not be able to extend the baselayer routes, which are very limited?

@dmitryduev
Copy link
Contributor

ah, I see what you mean @stefanv. Should this be moved over to SP then?

@profjsb
Copy link
Collaborator

profjsb commented Jan 10, 2022

@rknop do we still need this PR or can it be closed?

@stefanv
Copy link
Contributor

stefanv commented Jan 25, 2022

I've now removed the check in #279

If we keep running into issues with fritz, we can re-implement it there.

@stefanv stefanv closed this Jan 25, 2022
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

Successfully merging this pull request may close these issues.

None yet

6 participants