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

Persist run bundle as string #2200

Merged

Conversation

carolynvs
Copy link
Member

@carolynvs carolynvs commented Jun 27, 2022

What does this change

Since bundle has dollar prefixed fields, we can't call mongo's update on it and replace the document (which is what I was trying to do during a repeated migration). I've changed how we store just bundle, so that it's a string field when stored in mongo. We don't query based on run.Bundle so I don't see this as being a large change. It does change the storage schema version for installations though.

This change required updating the schemaVersion for Installations to 1.0.2 because it changes the database schema in an incompatible way. It's annoying that we have the db schema tied to the schemaVersion on the input documents (Installation/PS/CS) but at this point I don't see the value in trying to change that before 1.0 and we can revisit for v2.

I also noticed that we were still setting tags for yaml/toml on our storage structs which isn't used now that we have display structs for everything. So when I was editing the Run.Bundle tag, I cleaned up all the storage doc tags so that it's clear what is still used.

What issue does it fix

Closes #2196

Notes for the reviewer

This is split off from #2150 so that the other PR is just migration stuff, and not the bugs found along the way.

Checklist

  • Did you write tests?
  • Did you write documentation?
  • Did you change porter.yaml or a storage document record? Update the corresponding schema file.
  • If this is your first pull request, please add your name to the bottom of our Contributors list. Thank you for making Porter better! 🙇‍♀️

Reviewer Checklist

  • Comment with /azp run test-porter-release if a magefile or build script was modified
  • Comment with /azp run porter-integration if it's a non-trivial PR

Since bundle has dollar prefixed fields, we can't call mongo's update on it
and replace the document (which is what I was trying to do during a repeated migration).
I've changed how we store just bundle, so that it's a string field when stored in mongo.
We don't query based on run.Bundle so I don't see this as being a large change. It does change the storage schema version for installations though.

Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
Now that we have display structs for all of our storage documents these
tags are misleading (they aren't used) so I'm removing them.

Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
@carolynvs carolynvs marked this pull request as ready for review June 27, 2022 22:23
@carolynvs carolynvs requested a review from VinozzZ June 27, 2022 22:23
@carolynvs carolynvs merged commit e83329d into getporter:release/v1 Jun 28, 2022
@carolynvs carolynvs deleted the persist-run-bundle-as-string branch June 28, 2022 19:52
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.

Cannot update a stored document that uses $ in the field names
2 participants