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

release: automate orchestration version update #77018

Merged
merged 1 commit into from
Mar 3, 2022

Conversation

rail
Copy link
Member

@rail rail commented Feb 25, 2022

Previously, as a part of the release process we had to bump the
orchestration versions using sed with some error-prone regexes.

This patch adds set-orchestration-version subcommand to the release
tool. It uses templates in order to generate the orchestration files.

Release note: None

Previously, as a part of the release process we had to bump the
orchestration versions using `sed` with some error-prone regexes.

This patch adds `set-orchestration-version` subcommand to the release
tool. It uses templates in order to generate the orchestration files.

Release note: None
@rail rail added C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) A-release T-release Release Engineering & Automation Team labels Feb 25, 2022
@rail rail requested a review from celiala February 25, 2022 02:26
@rail rail self-assigned this Feb 25, 2022
@rail rail requested a review from a team as a code owner February 25, 2022 02:26
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@rail
Copy link
Member Author

rail commented Feb 25, 2022

The easiest way to review the YAML files would be using git show --find-copies.

How to test:

bazel build //pkg/cmd/release
$(bazel info bazel-bin)/pkg/cmd/release/release_/release set-orchestration-version \
  --template-dir ./cloud/kubernetes/templates --output-dir ./cloud/kubernetes/ --version v21.2.6
git diff 
# should be empty ^
$(bazel info bazel-bin)/pkg/cmd/release/release_/release set-orchestration-version \
  --template-dir ./cloud/kubernetes/templates --output-dir ./cloud/kubernetes/ --version v21.2.7
git diff
# should be expected version bump

Copy link
Collaborator

@celiala celiala left a comment

Choose a reason for hiding this comment

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

Thanks for adding the testing instructions!

:lgtm:

Had one thought/question (inline), but it's not-blocking (okay to merge as-is :shipit: !)

Reviewed 52 of 53 files at r1, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @rail)


pkg/cmd/release/orchestration.go, line 93 at r1 (raw file):

		if strings.HasSuffix(destFile, ".yaml") {
			generatedContents = fmt.Sprintf("# Generated file, DO NOT EDIT. Source: %s\n", filePath) + generatedContents
		}

Here we're only adding the "# Generated file..." line to .yaml files --- shouldn't we add the generated-file note to contents that we generate (not just yaml?).

I'm guessing the intent here is that we don't want the script to break a generated file if someone adds a non-yaml file in the future? If that's the case, should we either return an error for an unsupported generated file type? or if error-ing out is too extreme, we could output a warning or something?

@rail
Copy link
Member Author

rail commented Mar 3, 2022

bors r=celiala

@craig craig bot merged commit 960f2b4 into cockroachdb:master Mar 3, 2022
@craig
Copy link
Contributor

craig bot commented Mar 3, 2022

Build succeeded:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-release C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-release Release Engineering & Automation Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants