Skip to content

Commit 9daf1de

Browse files
committed
Update references to release branches
Prepare for renaming `v1` -> `releases/v1` and `v2` -> `releases/v2`.
1 parent bce749b commit 9daf1de

30 files changed

+74
-75
lines changed

.github/update-release-branch.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
# Value of the mode flag for a v2 release
2020
V2_MODE = 'v2-release'
2121

22+
SOURCE_BRANCH_FOR_MODE = { V1_MODE: 'releases/v2', V2_MODE: 'main' }
23+
TARGET_BRANCH_FOR_MODE = { V1_MODE: 'releases/v1', V2_MODE: 'releases/v2' }
24+
2225
# Name of the remote
2326
ORIGIN = 'origin'
2427

@@ -191,8 +194,10 @@ def main():
191194
type=str,
192195
required=True,
193196
choices=[V2_MODE, V1_MODE],
194-
help=f"Which release to perform. '{V2_MODE}' uses main as the source branch and v2 as the target branch. " +
195-
f"'{V1_MODE}' uses v2 as the source branch and v1 as the target branch."
197+
help=f"Which release to perform. '{V2_MODE}' uses {SOURCE_BRANCH_FOR_MODE[V2_MODE]} as the source " +
198+
f"branch and {TARGET_BRANCH_FOR_MODE[V2_MODE]} as the target branch. " +
199+
f"'{V1_MODE}' uses {SOURCE_BRANCH_FOR_MODE[V1_MODE]} as the source branch and " +
200+
f"{TARGET_BRANCH_FOR_MODE[V1_MODE]} as the target branch."
196201
)
197202
parser.add_argument(
198203
'--conductor',
@@ -203,14 +208,8 @@ def main():
203208

204209
args = parser.parse_args()
205210

206-
if args.mode == V2_MODE:
207-
source_branch = 'main'
208-
target_branch = 'v2'
209-
elif args.mode == V1_MODE:
210-
source_branch = 'v2'
211-
target_branch = 'v1'
212-
else:
213-
raise ValueError(f"Unexpected value for release mode: '{args.mode}'")
211+
source_branch = SOURCE_BRANCH_FOR_MODE[args.mode]
212+
target_branch = TARGET_BRANCH_FOR_MODE[args.mode]
214213

215214
repo = Github(args.github_token).get_repo(args.repository_nwo)
216215
version = get_current_version()
@@ -247,9 +246,9 @@ def main():
247246
print('Creating branch ' + new_branch_name)
248247

249248
if args.mode == V1_MODE:
250-
# If we're performing a backport, start from the v1 branch
251-
print(f'Creating {new_branch_name} from the {ORIGIN}/v1 branch')
252-
run_git('checkout', '-b', new_branch_name, f'{ORIGIN}/v1')
249+
# If we're performing a backport, start from the target branch
250+
print(f'Creating {new_branch_name} from the {ORIGIN}/{target_branch} branch')
251+
run_git('checkout', '-b', new_branch_name, f'{ORIGIN}/{target_branch}')
253252

254253
# Revert the commit that we made as part of the last release that updated the version number and
255254
# changelog to refer to 1.x.x variants. This avoids merge conflicts in the changelog and

.github/workflows/__analyze-ref-input.yml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__debug-artifacts.yml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__extractor-ram-threads.yml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__go-custom-queries.yml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__go-custom-tracing-autobuild.yml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__go-custom-tracing.yml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__javascript-source-root.yml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__ml-powered-queries.yml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__multi-language-autodetect.yml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)