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

Issue/927 add env settings #4603

Closed
wants to merge 29 commits into from
Closed

Issue/927 add env settings #4603

wants to merge 29 commits into from

Conversation

FloLey
Copy link
Contributor

@FloLey FloLey commented Jul 28, 2022

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

  • Attached issue to pull request
  • Changelog entry
  • Type annotations are present
  • Code is clear and sufficiently documented
  • No (preventable) type errors (check using make mypy or make mypy-diff)
  • Sufficient test cases (reproduces the bug/tests the requested feature)
  • 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


:param setting: the setting that should be added to the existing settings
"""
assert isinstance(setting, Setting)
Copy link
Contributor Author

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

Copy link
Contributor

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.

@FloLey FloLey requested a review from arnaudsjs July 28, 2022 12:12
tests/test_data.py Outdated Show resolved Hide resolved

:param setting: the setting that should be added to the existing settings
"""
assert isinstance(setting, Setting)
Copy link
Contributor

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.

@FloLey FloLey requested a review from arnaudsjs July 29, 2022 08:07
Copy link
Contributor

@arnaudsjs arnaudsjs left a 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?

src/inmanta/data/__init__.py Outdated Show resolved Hide resolved
@FloLey FloLey requested a review from arnaudsjs July 29, 2022 13:18
src/inmanta/data/__init__.py Outdated Show resolved Hide resolved
src/inmanta/server/services/environmentservice.py Outdated Show resolved Hide resolved
src/inmanta/server/services/environmentservice.py Outdated Show resolved Hide resolved
tests/agent_server/test_server_agent.py Outdated Show resolved Hide resolved
@arnaudsjs arnaudsjs requested a review from wouterdb July 29, 2022 13:34
FloLey and others added 8 commits July 29, 2022 15:34
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>
@FloLey FloLey requested a review from arnaudsjs July 29, 2022 14:29
Copy link
Contributor

@wouterdb wouterdb left a 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.

@FloLey FloLey requested a review from wouterdb August 4, 2022 08:13

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"
Copy link
Contributor

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?

@FloLey FloLey requested a review from wouterdb August 4, 2022 09:17
@FloLey FloLey added the merge-tool-ready This ticket is ready to be merged in label Aug 4, 2022
@inmantaci
Copy link
Contributor

Processing this pull request

@inmantaci inmantaci removed the merge-tool-ready This ticket is ready to be merged in label Aug 4, 2022
@inmantaci
Copy link
Contributor

Pull request rejected by merge tool. The tests for this branch did not succeed.

@FloLey FloLey added the merge-tool-ready This ticket is ready to be merged in label Aug 4, 2022
@inmantaci
Copy link
Contributor

Processing this pull request

inmantaci pushed a commit that referenced this pull request Aug 4, 2022
…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
@inmantaci
Copy link
Contributor

Merged into branches master in 4e9aba8

inmantaci pushed a commit that referenced this pull request Aug 4, 2022
…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
@inmantaci inmantaci closed this Aug 4, 2022
@inmantaci inmantaci deleted the issue/927-add-env-settings branch August 4, 2022 11:07
@inmantaci
Copy link
Contributor

Processing #4627.

inmantaci pushed a commit that referenced this pull request Aug 4, 2022
…inmanta-core (Issue inmanta/inmanta-lsm#927, PR #4603)

Pull request opened by the merge tool on behalf of #4603
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge-tool-ready This ticket is ready to be merged in
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants