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

Pull the datastore module into its own crate #1249

Merged
merged 1 commit into from
Dec 17, 2020

Conversation

tjkirch
Copy link
Contributor

@tjkirch tjkirch commented Dec 17, 2020

The direct reason is to fix a (weak) circular dependency we have to introduce,
but it turns out every crate that depends on apiserver only uses the datastore
module, so it made sense to separate it in any case.

The (weak) circular dependency:
* apiserver depends on thar-be-updates, just to reflect the fact that it's used at runtime (hence weak)
* thar-be-updates depends on apiclient, so it can check available updates in the API
* apiclient needs to be able to depend on datastore, so it can validate queries

There are no functional changes here, just:
* renaming of files and then fixing the references to them
* updating docs for the rename, and improving the main docs for the datastore crate now that it's more obvious
* minor rustfmt fixes that came along for the ride, since I was updating a lot of files

Testing done:

  • Unit tests pass.
  • Made an AMI, confirmed a pod ran OK, confirmed systemctl status running. Confirmed I could make manual API requests and commit changes OK, and manually inspected data store and it looked OK.
  • Made an AMI from the v1.0.4 tag, updated to an image with this change, and confirmed the same things were still OK.

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.

The direct reason is to fix a (weak) circular dependency we have to introduce,
but it turns out every crate that depends on apiserver only uses the datastore
module, so it made sense to separate it in any case.

The (weak) circular dependency:
* apiserver depends on thar-be-updates, just to reflect the fact that it's used at runtime (hence weak)
* thar-be-updates depends on apiclient, so it can check available updates in the API
* apiclient needs to be able to depend on datastore, so it can validate queries

There are no functional changes here, just:
* renaming of files and then fixing the references to them
* updating docs for the rename, and improving the main docs for the datastore crate now that it's more obvious
* minor rustfmt fixes that came along for the ride, since I was updating a lot of files
Copy link
Contributor

@webern webern left a comment

Choose a reason for hiding this comment

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

A nice refactor, makes a lot of sense.

Copy link
Contributor

@webern webern left a comment

Choose a reason for hiding this comment

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

^ Previous comment was meant to be an approval but I had radio button usage issues.

Copy link
Contributor

@bcressey bcressey left a comment

Choose a reason for hiding this comment

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

🥇

@tjkirch tjkirch merged commit 4224266 into bottlerocket-os:develop Dec 17, 2020
@tjkirch tjkirch deleted the datastore-split branch December 17, 2020 19:13
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