-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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: update_versions: continue on other repos if one repo attempt fails #130063
release: update_versions: continue on other repos if one repo attempt fails #130063
Conversation
It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR? 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
b8c183b
to
5769187
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this change is LGTM, but I've a few questions:
- If this fails for one repo, will the job still show as failed? If not, then it's going to hide the fact that this failed for some of the repos.
- If this needs to be rerun, will it be safe for all the repos what had previously run successfully for the given version?
5769187
to
2c8cd59
Compare
@@ -330,6 +326,9 @@ func updateVersions(_ *cobra.Command, _ []string) error { | |||
if err := sendPrReport(releasedVersion, prs, smtpPassword); err != nil { | |||
return fmt.Errorf("cannot send email: %w", err) | |||
} | |||
if len(workOnRepoErrors) > 0 { | |||
return errors.Join(workOnRepoErrors...) | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this fails for one repo, will the job still show as failed? If not, then it's going to hide the fact that this failed for some of the repos.
Ah, good callout: I'd updated updateVersions()
to return the workOnRepoErrors
if any errors occurred during the workOnRepo
for loop.
} | ||
} | ||
|
||
// Now that our local changes are staged, we can try and publish them. | ||
for _, repo := range reposToWorkOn { | ||
if repo.workOnRepoError != nil { | ||
continue | ||
} | ||
dest := path.Join(globalWorkDir, repo.checkoutDir()) | ||
// We avoid creating duplicated PRs to allow this command to be | ||
// run multiple times. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this needs to be rerun, will it be safe for all the repos what had previously run successfully for the given version?
I believe so, based on the comment on line 307 (was 303):
// We avoid creating duplicated PRs to allow this command to be
// run multiple times.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
pkg/cmd/release/update_versions.go
Outdated
if repo.workOnRepoError != nil { | ||
continue | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One other thought. What about noting in the email that the PR for this repo wasn't created?
In "Create version update PRs" for v24.1.4", the whole TC job fails if "work on repo X" fails for any repo. This PR continues to work on the other repos, should any one repo fail. Release note: None Epic: None Release justification: release-infra only change.
2c8cd59
to
ba971a7
Compare
} | ||
} | ||
|
||
// Now that our local changes are staged, we can try and publish them. | ||
for _, repo := range reposToWorkOn { | ||
if repo.workOnRepoError != nil { | ||
log.Printf("PR creation skipped due to previous errors while working on %s: %s", repo.name(), repo.workOnRepoError) | ||
continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One other thought. What about noting in the email that the PR for this repo wasn't created?
Good idea - done! (logging that PR creation was skipped due to previous errors)
TFTR! bors r=jlinder |
Follow-up to cockroachdb#130063: after merging 130063, update_versions failed to complete[1], due to encountering another / different error. This commit adjusts update_versions so that it continues & attempts to create PRs for all the remaining repos, despite encountering errors along the way. [1] Latest "Create version update PRs" job: https://teamcity.cockroachdb.com/buildConfiguration/Internal_Cockroach_Release_Publish_CreateVersionUpdatePRs/16752534?buildTab=log&focusLine=3552&logView=flowAware&expandAll=true Release note: None Epic: None Release justification: release-infra only change.
129758: parser,mt: remove CREATE TENANT ... LIKE r=dt a=dt The problem -- needing to apply a large number of configuration knobs -- solved by the 'template tenant' functionality has since been solved instead by having named service modes for each distinct common set of configurations, for example 'shared' which implies all capabilities in addition to in-process service. The template functionality was never pushed on PCR UA users, and is not used in cloud, and thus has no users and is accordingly removed here. Release note: none. Epic: none. 130054: rac2: add AdmittedTracker interface for use by RangeController r=pav-kv,kvoli a=sumeerbhola The AdmittedTracker provides the latest AdmittedVector, and will be implemented by processorImpl. Informs #129508 Epic: CRDB-37515 Release note: None 130096: release: update_versions: continue, even if one repo attempt fails r=celiala a=celiala Follow-up to #130063: after merging 130063, update_versions failed to complete[1], due to encountering another / different error. This commit adjusts update_versions so that it continues & attempts to create PRs for all the remaining repos, despite encountering errors along the way. [1] Latest "Create version update PRs" job: https://teamcity.cockroachdb.com/buildConfiguration/Internal_Cockroach_Release_Publish_CreateVersionUpdatePRs/16752534?buildTab=log&focusLine=3552&logView=flowAware&expandAll=true Release note: None Epic: None Release justification: release-infra only change. 130111: execinfrapb: move MockDistSQLServer to flowinfra r=dt a=dt pb packages are intended to be leaf packages with few or no dependencies. The mock server in the test utils was pulling in dependencies on packages that encode business logic, including logic that wants to depend on pb packages such as pkg/rpc's auth logic that depends on request types. Release note: none. Epic: none. Co-authored-by: David Taylor <[email protected]> Co-authored-by: sumeerbhola <[email protected]> Co-authored-by: Celia La <[email protected]>
In "Create version update PRs" for v24.1.4", the whole TC job fails if "work on repo X" fails for any repo.
This PR continues to work on the other repos, should any one repo fail.
Release note: None
Epic: None
Release justification: release-infra only change.