feature/release: update sg release cut to automate stitch graph gen and release branch creation#63794
Conversation
…ring update into seperate helper functions
…ub.com:sourcegraph/sourcegraph into al/rel-253/stitched-migration-graph-automation
|
I'm still not sure how to work around the branch protection on Asides from that the rest of the automation works. It creates a git archive, and correctly changes the const |
| func genStitchMigrationGraph(ctx context.Context) error { | ||
| err := run.Cmd(ctx, "sg", "bazel", "run", "//internal/database/migration/shared:write_stitched_migration_graph").Run().Wait() | ||
| if err != nil { | ||
| return errors.Wrap(err, "Could not run stitch migration generator") | ||
| } | ||
| return nil | ||
| } |
There was a problem hiding this comment.
This feels a bit silly for me to do? Maybe I should call what sg bazel run calls with this argument?
There was a problem hiding this comment.
I'd say this is fine. We do this in a number of other places as well. 👍
| func genStitchMigrationGraph(ctx context.Context) error { | ||
| err := run.Cmd(ctx, "sg", "bazel", "run", "//internal/database/migration/shared:write_stitched_migration_graph").Run().Wait() | ||
| if err != nil { | ||
| return errors.Wrap(err, "Could not run stitch migration generator") | ||
| } | ||
| return nil | ||
| } |
There was a problem hiding this comment.
I'd say this is fine. We do this in a number of other places as well. 👍
| if err != nil { | ||
| return errors.Wrap(err, "Could not create git archive") | ||
| } | ||
| err = run.Cmd(ctx, "CLOUDSDK_CORE_PROJECT=\"sourcegraph-ci\"", "gsutil", "cp", fmt.Sprintf("migrations-%s", newVersion), "gs://schemas-migrations/migrations/").Run().Wait() |
There was a problem hiding this comment.
We should verify if the user running this has access to the GCP project and bucket before starting this, if we don't already. Perhaps in --pretend like the other checks.
There was a problem hiding this comment.
Ugh, after much searching and looking around I ended up with gsutil ls gs://bucket/schemas-migrations which actually checks the wrong permission (storage.objects.list instead of storage.objects.create), which shouldn't be a problem based on my reading of Uniform bucket policy only to realize we don't have a --pretend flag for sg release cut 😮💨
sg release cut to automate stitch graph gen and release branch creationsg release cut to automate stitch graph gen and release branch creation
|
@Chickensoupwithrice @jdpleiness Sorry I lost track of this one and thought it was good to merge, we probably want to come back to this. Anything we should break out into issues?
|
|
For the |
Resolve: https://linear.app/sourcegraph/issue/REL-253/bug-automate-the-stitched-migration-graph-bazel-archive-generation
Test plan
Tested by running
go run ./dev/sg release cut --version “5.7.0"Changelog