From bfa9dfe827c85a0651cfc714eb5d803dfed5e273 Mon Sep 17 00:00:00 2001 From: Aditya Sharad <6874315+adityasharad@users.noreply.github.com> Date: Thu, 28 Jan 2021 16:52:16 -0800 Subject: [PATCH 1/2] Python setup: Fix URL for Python 2.7 pip install This URL changed upstream. Fix it by using the same upstream URL as the LGTM Python image. We can revisit separately whether to drop the Python 2 pip installation entirely. --- python-setup/install_tools.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-setup/install_tools.sh b/python-setup/install_tools.sh index 905ab1ad0..3c1301ca2 100755 --- a/python-setup/install_tools.sh +++ b/python-setup/install_tools.sh @@ -31,7 +31,7 @@ python3 -m pip install --user pipenv if command -v python2 &> /dev/null; then # Setup Python 2 dependency installation tools. # The Ubuntu 20.04 GHA environment does not come with a Python 2 pip - curl --location --fail https://bootstrap.pypa.io/get-pip.py | python2 + curl --location --fail https://bootstrap.pypa.io/2.7/get-pip.py | python2 python2 -m pip install --user --upgrade pip setuptools wheel From 8fef3928bace6dda75de62f948e85ed83a28eb32 Mon Sep 17 00:00:00 2001 From: Chris Gavin Date: Mon, 1 Feb 2021 18:03:17 +0000 Subject: [PATCH 2/2] Use an asymmetric Git log when updating the release branch. --- .github/update-release-branch.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/update-release-branch.py b/.github/update-release-branch.py index a8ddaae48..119bd984a 100644 --- a/.github/update-release-branch.py +++ b/.github/update-release-branch.py @@ -35,7 +35,7 @@ def open_pr(repo, all_commits, short_main_sha, branch_name): commits_without_pull_requests = [] for commit in all_commits: pr = get_pr_for_commit(repo, commit) - + if pr is None: commits_without_pull_requests.append(commit) elif not any(p for p in pull_requests if p.number == pr.number): @@ -47,7 +47,7 @@ def open_pr(repo, all_commits, short_main_sha, branch_name): # Sort PRs and commits by age pull_requests = sorted(pull_requests, key=lambda pr: pr.number) commits_without_pull_requests = sorted(commits_without_pull_requests, key=lambda c: c.commit.author.date) - + # Start constructing the body text body = 'Merging ' + short_main_sha + ' into ' + LATEST_RELEASE_BRANCH @@ -62,7 +62,7 @@ def open_pr(repo, all_commits, short_main_sha, branch_name): body += '\n- #' + str(pr.number) body += ' - ' + pr.title body += ' (@' + merger + ')' - + # List all commits not part of a PR if len(commits_without_pull_requests) > 0: body += '\n\nContains the following commits not from a pull request:' @@ -86,7 +86,7 @@ def get_conductor(repo, pull_requests, other_commits): # If there are any PRs then use whoever merged the last one if len(pull_requests) > 0: return get_merger_of_pr(repo, pull_requests[-1]) - + # Otherwise take the author of the latest commit return other_commits[-1].author.login @@ -95,7 +95,7 @@ def get_conductor(repo, pull_requests, other_commits): # This will not include any commits that exist on the release branch # that aren't on main. def get_commit_difference(repo): - commits = run_git('log', '--pretty=format:%H', ORIGIN + '/' + LATEST_RELEASE_BRANCH + '...' + MAIN_BRANCH).strip().split('\n') + commits = run_git('log', '--pretty=format:%H', ORIGIN + '/' + LATEST_RELEASE_BRANCH + '..' + MAIN_BRANCH).strip().split('\n') # Convert to full-fledged commit objects commits = [repo.get_commit(c) for c in commits] @@ -119,7 +119,7 @@ def get_truncated_commit_message(commit): # Returns the PR object, or None if no PR could be found. def get_pr_for_commit(repo, commit): prs = commit.get_pulls() - + if prs.totalCount > 0: # In the case that there are multiple PRs, return the earliest one prs = list(prs) @@ -165,7 +165,7 @@ def main(): if branch_exists_on_remote(new_branch_name): print('Branch ' + new_branch_name + ' already exists. Nothing to do.') return - + # Create the new branch and push it to the remote print('Creating branch ' + new_branch_name) run_git('checkout', '-b', new_branch_name, MAIN_BRANCH)