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

Merge releases/v2 into releases/v1 #10

Open
wants to merge 36 commits into
base: releases/v1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
9885f86
Re-enable waiting for processing by default, using the new API semant…
chrisgavin Mar 30, 2022
792bbfe
Update changelog and version after v2.1.8
invalid-email-address Apr 8, 2022
0c80741
Update checked-in dependencies
invalid-email-address Apr 8, 2022
2d80fe8
Merge pull request #1029 from github/mergeback/v2.1.8-to-main-1ed14374
edoardopirovano Apr 8, 2022
b0c570e
autobuild: add working-directory input
cklin Apr 8, 2022
6f17408
Add autobuild workind-directory test
cklin Apr 8, 2022
baf90d1
Merge pull request #1024 from cklin/autobuild-working-dir
cklin Apr 8, 2022
780f4ee
Add codeql-python as CODEOWNERS
RasmusWL Apr 12, 2022
9f20add
Update CODEOWNERS
RasmusWL Apr 12, 2022
7a12645
Merge pull request #1030 from github/RasmusWL/pyton-setup-codeowners
henrymercer Apr 12, 2022
e7869d5
Merge main into wait-for-processing-2.
chrisgavin Apr 14, 2022
c5c5bda
Merge pull request #1007 from github/wait-for-processing-2
chrisgavin Apr 14, 2022
bac9320
Update description of "Tag release and merge back" workflow
henrymercer Apr 12, 2022
fce4a01
Update the major version tag within the release process
henrymercer Apr 12, 2022
bce749b
Improve consistency of variable references in Bash
henrymercer Apr 12, 2022
9daf1de
Update references to release branches
henrymercer Apr 12, 2022
3962f1b
Bump glob from 7.1.7 to 8.0.1
dependabot[bot] Apr 14, 2022
0ba58d8
Update checked-in dependencies
invalid-email-address Apr 14, 2022
8b2f5d7
Merge pull request #1034 from github/dependabot/npm_and_yarn/glob-8.0.1
henrymercer Apr 14, 2022
faf9d4b
Merge branch 'main' into henrymercer/use-tags-for-releases
henrymercer Apr 14, 2022
808c292
Support Pipfile without Pipfile.lock
kojiromike Apr 8, 2022
b9577df
python-setup: refactor Pipenv without lockfile
RasmusWL Apr 12, 2022
e6e3277
Merge pull request #1026 from kojiromike/patch-1
aeisenberg Apr 18, 2022
e87e2d8
Merge branch 'main' into henrymercer/use-tags-for-releases
henrymercer Apr 25, 2022
ce63ab5
Merge pull request #1033 from github/henrymercer/use-tags-for-releases
henrymercer Apr 25, 2022
33c0108
Commit any conflicts during v1 backport to simplify release process
henrymercer Apr 13, 2022
677790f
Add a PR check to check for conflict markers
henrymercer Apr 14, 2022
00a4030
Suggest resolving conflicts by adding new commits vs amending the mer…
henrymercer Apr 25, 2022
f43e085
Remove commit guard
henrymercer Apr 25, 2022
352844f
Delete CI checks
henrymercer Apr 25, 2022
fbf7c76
Update changelog for v2.1.9
invalid-email-address Apr 25, 2022
f20d5a7
Merge pull request #9 from dsp-testing/update-v2.1.9-352844ff
henrymercer Apr 25, 2022
13befce
Revert "Update version and changelog for v1.1.8"
invalid-email-address Apr 25, 2022
9b8670b
Revert "Update checked-in dependencies"
invalid-email-address Apr 25, 2022
37fab6b
Merge remote-tracking branch 'origin/releases/v2' into update-v1.1.9-…
invalid-email-address Apr 25, 2022
02ada6d
Update version and changelog for v1.1.9
invalid-email-address Apr 25, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 37 additions & 18 deletions .github/update-release-branch.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,19 @@
# Value of the mode flag for a v2 release
V2_MODE = 'v2-release'

SOURCE_BRANCH_FOR_MODE = { V1_MODE: 'releases/v2', V2_MODE: 'main' }
TARGET_BRANCH_FOR_MODE = { V1_MODE: 'releases/v1', V2_MODE: 'releases/v2' }

# Name of the remote
ORIGIN = 'origin'

# Runs git with the given args and returns the stdout.
# Raises an error if git does not exit successfully.
def run_git(*args):
# Raises an error if git does not exit successfully (unless passed
# allow_non_zero_exit_code=True).
def run_git(*args, allow_non_zero_exit_code=False):
cmd = ['git', *args]
p = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
if (p.returncode != 0):
if not allow_non_zero_exit_code and p.returncode != 0:
raise Exception('Call to ' + ' '.join(cmd) + ' exited with code ' + str(p.returncode) + ' stderr:' + p.stderr.decode('ascii'))
return p.stdout.decode('ascii')

Expand All @@ -36,7 +40,9 @@ def branch_exists_on_remote(branch_name):
return run_git('ls-remote', '--heads', ORIGIN, branch_name).strip() != ''

# Opens a PR from the given branch to the target branch
def open_pr(repo, all_commits, source_branch_short_sha, new_branch_name, source_branch, target_branch, conductor, is_v2_release, labels):
def open_pr(
repo, all_commits, source_branch_short_sha, new_branch_name, source_branch, target_branch,
conductor, is_v2_release, labels, conflicted_files):
# Sort the commits into the pull requests that introduced them,
# and any commits that don't have a pull request
pull_requests = []
Expand Down Expand Up @@ -81,6 +87,12 @@ def open_pr(repo, all_commits, source_branch_short_sha, new_branch_name, source_

body.append('')
body.append('Please review the following:')
if len(conflicted_files) > 0:
body.append(' - [ ] You have added commits to this branch that resolve the merge conflicts ' +
'in the following files:')
body.extend([f' - [ ] `{file}`' for file in conflicted_files])
body.append(' - [ ] Another maintainer has reviewed the additional commits you added to this ' +
'branch to resolve the merge conflicts.')
body.append(' - [ ] The CHANGELOG displays the correct version and date.')
body.append(' - [ ] The CHANGELOG includes all relevant, user-facing changes since the last release.')
body.append(' - [ ] There are no unexpected commits being merged into the ' + target_branch + ' branch.')
Expand Down Expand Up @@ -191,8 +203,10 @@ def main():
type=str,
required=True,
choices=[V2_MODE, V1_MODE],
help=f"Which release to perform. '{V2_MODE}' uses main as the source branch and v2 as the target branch. " +
f"'{V1_MODE}' uses v2 as the source branch and v1 as the target branch."
help=f"Which release to perform. '{V2_MODE}' uses {SOURCE_BRANCH_FOR_MODE[V2_MODE]} as the source " +
f"branch and {TARGET_BRANCH_FOR_MODE[V2_MODE]} as the target branch. " +
f"'{V1_MODE}' uses {SOURCE_BRANCH_FOR_MODE[V1_MODE]} as the source branch and " +
f"{TARGET_BRANCH_FOR_MODE[V1_MODE]} as the target branch."
)
parser.add_argument(
'--conductor',
Expand All @@ -203,14 +217,8 @@ def main():

args = parser.parse_args()

if args.mode == V2_MODE:
source_branch = 'main'
target_branch = 'v2'
elif args.mode == V1_MODE:
source_branch = 'v2'
target_branch = 'v1'
else:
raise ValueError(f"Unexpected value for release mode: '{args.mode}'")
source_branch = SOURCE_BRANCH_FOR_MODE[args.mode]
target_branch = TARGET_BRANCH_FOR_MODE[args.mode]

repo = Github(args.github_token).get_repo(args.repository_nwo)
version = get_current_version()
Expand Down Expand Up @@ -246,10 +254,15 @@ def main():
# Create the new branch and push it to the remote
print('Creating branch ' + new_branch_name)

# The process of creating the v1 release can run into merge conflicts. We commit the unresolved
# conflicts so a maintainer can easily resolve them (vs erroring and requiring maintainers to
# reconstruct the release manually)
conflicted_files = []

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

# Revert the commit that we made as part of the last release that updated the version number and
# changelog to refer to 1.x.x variants. This avoids merge conflicts in the changelog and
Expand All @@ -274,7 +287,12 @@ def main():
print(' Nothing to revert.')

print(f'Merging {ORIGIN}/{source_branch} into the release prep branch')
run_git('merge', f'{ORIGIN}/{source_branch}', '--no-edit')
# Commit any conflicts (see the comment for `conflicted_files`)
run_git('merge', f'{ORIGIN}/{source_branch}', allow_non_zero_exit_code=True)
conflicted_files = run_git('diff', '--name-only', '--diff-filter', 'U').splitlines()
if len(conflicted_files) > 0:
run_git('add', '.')
run_git('commit', '--no-edit')

# Migrate the package version number from a v2 version number to a v1 version number
print(f'Setting version number to {version}')
Expand Down Expand Up @@ -317,6 +335,7 @@ def main():
conductor=args.conductor,
is_v2_release=args.mode == V2_MODE,
labels=['Update dependencies'] if args.mode == V1_MODE else [],
conflicted_files=conflicted_files
)

if __name__ == '__main__':
Expand Down
95 changes: 0 additions & 95 deletions .github/workflows/__analyze-ref-input.yml

This file was deleted.

96 changes: 0 additions & 96 deletions .github/workflows/__debug-artifacts.yml

This file was deleted.

66 changes: 0 additions & 66 deletions .github/workflows/__extractor-ram-threads.yml

This file was deleted.

Loading