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

refactor: clean up deployer db resources, delete after sync to r-r, delete secrets command #1376

Merged
merged 6 commits into from
Nov 16, 2023

Conversation

jonaro00
Copy link
Member

@jonaro00 jonaro00 commented Nov 9, 2023

Description of change

  • Resources are deleted from deployer after they have been successfully synced to r-r.
  • Deleted the secrets CLI command since it only targeted the deployer cache. The new way is to use resource list
  • Drop secrets table. Is possible due to the above.

How has this been tested? (if applicable)

Tested with inserting a resource in deployer, and the resource list operation correctly synced them up to r-r. The project could then be deleted without hassle.

@jonaro00 jonaro00 force-pushed the clean-up-deployer-db branch from f32fe97 to c1abbe3 Compare November 14, 2023 13:51
@jonaro00 jonaro00 changed the title refactor: clean up deployer db refactor: clean up deployer db resources, delete after sync to r-r, delete secrets command Nov 14, 2023
@jonaro00 jonaro00 marked this pull request as ready for review November 14, 2023 14:59
Copy link
Contributor

@Kazy Kazy left a comment

Choose a reason for hiding this comment

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

Have you tested it through an update of Shuttle ? Deploy on the current stable version, have some secrets, then upgrade (while keeping the deployer on the previous version, which is a common case), and checked what happens ?

cargo-shuttle/src/args.rs Show resolved Hide resolved
@@ -119,12 +119,6 @@ pub enum Command {
/// Manage resources of a Shuttle project
#[command(subcommand)]
Resource(ResourceCommand),
/// Manage secrets for this Shuttle service
Secrets {
Copy link
Contributor

@Kazy Kazy Nov 14, 2023

Choose a reason for hiding this comment

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

suggestion(non-blocking): And actually, are we sure we want to remove this command ? I know we're treating secrets as a resources now, but isn't that an implementation detail ? We could instead ask the r-r for just the secrets.

Copy link
Member Author

Choose a reason for hiding this comment

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

Could do that, yeah. I think it's more clear if they are only in one place where they currently logically belong. This command has been broken for quite some time.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it is worth simplifying this and removing the cmd, given the costs coming from maintaining, bugs fixing, and the support specifically for this cmd (and maybe feature requests?).

However, it is worth saying we remove it without a deprecation notice, and backward compat support e.g. previous versions of cargo-shuttle can call secrets cmd on a recent deployer, and I think it will fail, right? We would need to instruct users to use resource list instead, which shouldn't be that bad.

Also, it is worth saying secret retrieval is not extremely useful, given we're not displaying the actual values, so having a dedicated command just for them doesn't make sense to me. Down the line, secrets displaying (along other resources displaying) should be further refined to maybe display hints and data about when it was last modified (and possibly accessed?), but still, not sure if it is worth a dedicated cmd.

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems to me like the command is currently broken, like Johan mentioned, so I think we can safely remove it. 😄

Copy link
Contributor

Choose a reason for hiding this comment

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

My idea was more to keep the secrets part but in a workable state :p But fine if you think resources make more sense :)

@jonaro00
Copy link
Member Author

Have you tested it through an update of Shuttle ?

My test with inserting an old record mimics the upgrade from an old version (based on what I observed during support week). I would have to go back several months to do it "naturally". To me, this is sufficient.

Copy link
Contributor

@iulianbarbu iulianbarbu left a comment

Choose a reason for hiding this comment

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

LGTM 🥳 ! Super happy about the simplifications, good job

@oddgrd oddgrd merged commit 03e7017 into shuttle-hq:main Nov 16, 2023
@jonaro00 jonaro00 deleted the clean-up-deployer-db branch November 16, 2023 11:19
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