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

sources: move settings-sdk to workspace dependencies #4099

Merged

Conversation

sam-berning
Copy link
Contributor

Issue number:

N/A

Description of changes:

Within the sources/ workspace, if a crate depends on one of the crates in bottlerocket-settings-sdk, we currently include a section with the full git URL, tag, and version in the crate's Cargo.toml. Because we can't have two versions of the same crate in a workspace, updating one of these Cargo.toml's (in order to test changes in a personal fork, or to bump the version, for example) requires updating all of the other crates that use that dependency.

Making the crates in bottlerocket-settings-sdk workspace dependencies allows us to update to a different version of bottlerocket-settings-sdk by only changing one file.

Testing done:

cargo build in sources/

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

@sam-berning sam-berning requested review from bcressey, jmt-lab and jpculp and removed request for bcressey July 22, 2024 23:17
Comment on lines 14 to 16
# settings plugins
bottlerocket-settings-models = { workspace = true }
bottlerocket-settings-plugin = { workspace = true }
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if this would be clearer if it remained at the bottom instead of being alphabetical.

Copy link
Contributor

@cbgbt cbgbt left a comment

Choose a reason for hiding this comment

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

I like workspace dependencies! I would love to use them for everything under /sources, but we don't have to do that all in one go.

Something I saw recently that I quite liked was that you can also just specify them as such:

bottlerocket-settings-models.workspace = true

...and you would then only need to expand the object if you wished to add other attributes.

What do you think?

@sam-berning
Copy link
Contributor Author

Yeah, I think I like that too! I'll update it.

@sam-berning
Copy link
Contributor Author

^ moved settings plugins deps back to their own section and updated formatting to dependency.workspace = true

Comment on lines 12 to 13
[build-dependencies.bottlerocket-defaults-helper]
git = "https://github.com/bottlerocket-os/bottlerocket-settings-sdk"
tag = "bottlerocket-defaults-helper-v0.1.0"
version = "0.1.0"
workspace = true
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: these don't follow the format you've changed the rest to.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

whoops, fixed

Within the sources/ workspace, if a crate depends on one of the crates
in bottlerocket-settings-sdk, we currently include a section with the
full git URL, tag, and version in the crate's Cargo.toml. Because we
can't have two versions of the same crate in a workspace, updating one
of these Cargo.toml's (in order to test changes in a personal fork, or
to bump the version, for example) requires updating all of the other
crates that use that dependency.

Making the crates in bottlerocket-settings-sdk workspace dependencies
allows us to update to a different version of bottlerocket-settings-sdk
by only changing one file.

Signed-off-by: Sam Berning <[email protected]>
Copy link
Contributor

@jmt-lab jmt-lab left a comment

Choose a reason for hiding this comment

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

LGTM

@cbgbt cbgbt merged commit 7f524fa into bottlerocket-os:develop Jul 29, 2024
29 checks passed
@vigh-m vigh-m mentioned this pull request Aug 1, 2024
16 tasks
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.

4 participants