-
Notifications
You must be signed in to change notification settings - Fork 0
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
Allow migrating of whitelisted config.json fields #72
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cywang117
force-pushed
the
cywang117/os-config-v2
branch
from
August 24, 2023 02:43
fdfbf94
to
2402ba5
Compare
cywang117
changed the title
WIP: Update os-config to allow migrating of whitelisted config.json fields
Update os-config to allow migrating of whitelisted config.json fields
Aug 24, 2023
cywang117
changed the title
Update os-config to allow migrating of whitelisted config.json fields
Allow migrating of whitelisted config.json fields
Aug 24, 2023
cywang117
force-pushed
the
cywang117/os-config-v2
branch
4 times, most recently
from
August 24, 2023 18:51
4258fa4
to
964c1c2
Compare
majorz
reviewed
Aug 24, 2023
majorz
reviewed
Aug 24, 2023
majorz
reviewed
Aug 24, 2023
majorz
reviewed
Aug 24, 2023
cywang117
force-pushed
the
cywang117/os-config-v2
branch
2 times, most recently
from
August 28, 2023 21:17
321bd25
to
861cd08
Compare
cywang117
force-pushed
the
cywang117/os-config-v2
branch
from
September 4, 2023 23:19
206117c
to
c2f39af
Compare
cywang117
force-pushed
the
cywang117/os-config-v2
branch
from
September 13, 2023 21:41
446cb1c
to
7124ebe
Compare
Signed-off-by: Christina Ying Wang <[email protected]>
The response from querying /os/v1/config has changed slightly, the changes to the response are reflected in the updated tests in this commit. See: https://balena.fibery.io/Work/Improvement/os-config-improving-the-interface-for-config.json-modification-901 See: balena-os/meta-balena#3227 See: balena-io/open-balena-api#1394 Signed-off-by: Christina Ying Wang <[email protected]> Change-type: minor
Signed-off-by: Christina Ying Wang <[email protected]>
cywang117
force-pushed
the
cywang117/os-config-v2
branch
from
September 13, 2023 23:05
7124ebe
to
bb29ca0
Compare
* Renamed `generate_config_json_migration` to `migrate_config_json` * Introduced a `OverridesMap` type alias for `HashMap<String, serde_json::Value>` * Renamed a `to_update` function argument to `overrides` to match the remote config instructions name. * Renamed `handle_update_directives` to `handle_override_directives` in a similar fashion. * `handle_override_directives` modifies `config_json` in-place instead of operating on top of a clone. It returns a `bool` now to indicate whether modifications were made. All this simplifies a bit the external logic as well. * Processing of `overrides` keys is now done in sorted order, so that logging always produces the same output when the arguments of `handle_override_directives` are the same. This helps with test code as some of it operates on top of logging output. * Inside the `migrate_config_json` integration tests I switched the output checks to use the `.stdout(output)` pattern used in other tests as it provides a diff output when something fails and is easier to navigate when error occurs. Signed-off-by: Zahari Petkov <[email protected]>
Signed-off-by: Zahari Petkov <[email protected]>
lgtm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This also includes os-config querying /os/v2/config instead, which has a different response format. The changes to the response format are reflected in the updated tests, and the API PR for the change in the backend is linked (and should be merged and tested first). The linked meta-balena PR should be merged with both the schema and os-config binary change.
See: https://balena.fibery.io/Work/Improvement/os-config-improving-the-interface-for-config.json-modification-901
See: balena-os/meta-balena#3227
See: balena-io/open-balena-api#1394
Signed-off-by: Christina Ying Wang [email protected]
Change-type: minor