-
Notifications
You must be signed in to change notification settings - Fork 7
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
Issue/927 add env settings #4603
Conversation
src/inmanta/data/__init__.py
Outdated
|
||
:param setting: the setting that should be added to the existing settings | ||
""" | ||
assert isinstance(setting, Setting) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if those checks are really needed or if something else should be checker
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed. This is not really needed. If we violate this constraint, the type checker should warn us.
src/inmanta/data/__init__.py
Outdated
|
||
:param setting: the setting that should be added to the existing settings | ||
""" | ||
assert isinstance(setting, Setting) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed. This is not really needed. If we violate this constraint, the type checker should warn us.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we also need a register_setting()
method in the SLICE_ENVIRONMENT
, that can be used by the lsm extension to register the setting?
Co-authored-by: arnaudsjs <2684622+arnaudsjs@users.noreply.github.com>
Co-authored-by: arnaudsjs <2684622+arnaudsjs@users.noreply.github.com>
Co-authored-by: arnaudsjs <2684622+arnaudsjs@users.noreply.github.com>
Co-authored-by: arnaudsjs <2684622+arnaudsjs@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be good to test what happens when a setting exists in the database for which the definition no longer exists.
(e.g we start the server with all extensions disabled).
I would expect the api to not return any unknown settings, but just keep them in the database.
|
||
result = await client.get_setting(tid=environment, id="a new setting") | ||
assert result.code == 404 | ||
assert result.result["message"] == "Request or referenced resource does not exist" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also verify it is not returned by a listing either and that if you register the option, it is returned by both?
Processing this pull request |
Pull request rejected by merge tool. The tests for this branch did not succeed. |
Processing this pull request |
…inmanta-core (Issue inmanta/inmanta-lsm#927, PR #4603) # Description add the possibility to add extra settings to the env from outside of inmanta-core. # Self Check: Strike through any lines that are not applicable (`~~line~~`) then check the box - [x] Attached issue to pull request - [x] Changelog entry - [x] Type annotations are present - [x] Code is clear and sufficiently documented - [x] No (preventable) type errors (check using make mypy or make mypy-diff) - [x] Sufficient test cases (reproduces the bug/tests the requested feature) - [x] Correct, in line with design - [ ] End user documentation is included or an issue is created for end-user documentation (add ref to issue here: ) # Reviewer Checklist: - [ ] Sufficient test cases (reproduces the bug/tests the requested feature) - [ ] Code is clear and sufficiently documented - [ ] Correct, in line with design
Merged into branches master in 4e9aba8 |
…inmanta-core (Issue inmanta/inmanta-lsm#927, PR #4603) # Description add the possibility to add extra settings to the env from outside of inmanta-core. # Self Check: Strike through any lines that are not applicable (`~~line~~`) then check the box - [x] Attached issue to pull request - [x] Changelog entry - [x] Type annotations are present - [x] Code is clear and sufficiently documented - [x] No (preventable) type errors (check using make mypy or make mypy-diff) - [x] Sufficient test cases (reproduces the bug/tests the requested feature) - [x] Correct, in line with design - [ ] End user documentation is included or an issue is created for end-user documentation (add ref to issue here: ) # Reviewer Checklist: - [ ] Sufficient test cases (reproduces the bug/tests the requested feature) - [ ] Code is clear and sufficiently documented - [ ] Correct, in line with design
Processing #4627. |
…inmanta-core (Issue inmanta/inmanta-lsm#927, PR #4603) Pull request opened by the merge tool on behalf of #4603
Description
add the possibility to add extra settings to the env from outside of inmanta-core.
Self Check:
Strike through any lines that are not applicable (
~~line~~
) then check the boxReviewer Checklist: