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

Enforce backend and frontend names to be unique #376

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kuba00739
Copy link

@kuba00739 kuba00739 commented Aug 10, 2021

All Submissions:

  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Have you added an explanation of what problem you are trying to solve with this PR?
  • Have you added information on what your changes do and why you chose this as your solution?
  • Have you written new tests for your changes?
  • Does your submission pass tests?
  • This project follows PEP8 style guide. Have you run your code against the 'flake8' linter?

Sanity checks to ensure that none of the frontend and backend names are the same.
Added missing variable
@c00kiemon5ter c00kiemon5ter changed the title Patch 1 Enforce backend and frontend names to be unique Feb 22, 2022

for backend in backend_modules:
if backend.name in names:
raise SATOSAConfigurationError("The name " + backend.name + " is taken!")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
raise SATOSAConfigurationError("The name " + backend.name + " is taken!")
raise SATOSAConfigurationError("The backend name " + backend.name + " is already used.")


for frontend in frontend_modules:
if frontend.name in names:
raise SATOSAConfigurationError("The name " + frontend.name + " is taken!")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
raise SATOSAConfigurationError("The name " + frontend.name + " is taken!")
raise SATOSAConfigurationError("The frontend name " + frontend.name + " is already used.")

@c00kiemon5ter
Copy link
Member

I think it's good to have this.

However, this is doing the right thing but in the wrong way. We should introduce a configuration validation step where this kind of checks should be taking place. Ideally, we can have a configuration schema and check against that directly.

I don't mind merging this to help when these issues come up, but we should re-iterate to properly fix this and other configuration checks as a step in the loading process.

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.

2 participants