Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
f96a66c
Cleanup sync object handling in ompi_request_complete
devreal Jul 12, 2022
ba50056
MPI4: deprecate MPI_Info_get
hppritcha Oct 21, 2021
5328700
Add conditional preprocessor check for MPI V4.0 around deprecated MPI…
Jul 12, 2022
5e58160
Remove stale ompi_info.1in man page
jsquyres Jul 23, 2022
41a2d61
.gitignore: remove stale kruft
jsquyres Jul 23, 2022
56afecd
OSC/UCX: Adding locks to win attach/deattach and fixing build warnings
Jul 20, 2022
d5a8c20
Merge pull request #10561 from devreal/request-complete-atomics
devreal Jul 26, 2022
80966a2
docs/news: Add 4.1.4 NEWS items
jsquyres Jul 27, 2022
ac3446b
Merge pull request #10616 from jsquyres/pr/docs/news-4.1.4-update
jsquyres Jul 28, 2022
c950764
Merge pull request #9583 from hppritcha/topic/deprecate_mpi_info_get
hppritcha Jul 29, 2022
29c09e2
Cleanup deprecation warning defines for MPI 4.0
jjhursey Jul 25, 2022
5debb1a
Merge pull request #10619 from jjhursey/mpi-4-dep-plus
jjhursey Jul 29, 2022
1683a46
Merge pull request #10600 from jsquyres/pr/remove-stale-kruft
jsquyres Aug 1, 2022
c3bb38e
Populate some additional MPI_INFO_ENV keys with singleton launch.
awlauria Apr 8, 2022
12d0e01
Merge pull request #10268 from awlauria/info_keys_singleton_launch
awlauria Aug 2, 2022
5c302ac
Merge pull request #10593 from MamziB/mamzi/dynamic-win-fixes-2
awlauria Aug 2, 2022
4896db1
Update PRRTe and PMIx submodule pointers.
awlauria Jul 26, 2022
7b15c3d
Merge pull request #10611 from awlauria/main_update_subs
awlauria Aug 2, 2022
515e9aa
git-commit-checks: comment on PR with error(s)
Joe-Downs Aug 1, 2022
76c13b0
Merge pull request #6 from Joe-Downs/pr/commit-checker-messages
Joe-Downs Aug 9, 2022
9d244c4
testing
Joe-Downs Aug 9, 2022
723c43a
wip
Joe-Downs Aug 9, 2022
e6f6a0d
wip
Joe-Downs Aug 9, 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
68 changes: 63 additions & 5 deletions .github/workflows/git-commit-checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* GITHUB_TOKEN: token authorizing Github API usage
* GITHUB_REPOSITORY: "org/repo" name of the Github repository of this PR
* GITHUB_REF: string that includes this Github PR number
* GITHUB_RUN_ID: unique ID for each workflow run
* GITHUB_SERVER_URL: the URL of the GitHub server

This script tests each git commit between (and not including) GITHUB_SHA and
GITHUB_BASE_REF multiple ways:
Expand Down Expand Up @@ -58,17 +60,22 @@
GITHUB_TOKEN = os.environ.get('GITHUB_TOKEN')
GITHUB_REPOSITORY = os.environ.get('GITHUB_REPOSITORY')
GITHUB_REF = os.environ.get('GITHUB_REF')
GITHUB_RUN_ID = os.environ.get('GITHUB_RUN_ID')
GITHUB_SERVER_URL = os.environ.get('GITHUB_SERVER_URL')

# Sanity check
if (GITHUB_WORKSPACE is None or
GITHUB_SHA is None or
GITHUB_BASE_REF is None or
GITHUB_TOKEN is None or
GITHUB_REPOSITORY is None or
GITHUB_REF is None):
GITHUB_REF is None or
GITHUB_RUN_ID is None or
GITHUB_SERVER_URL is None):
print("Error: this script is designed to run as a Github Action")
exit(1)

print(f"GH_REF: {GITHUB_REF}")
#----------------------------------------------------------------------------

"""
Expand All @@ -85,6 +92,50 @@ def make_commit_message(repo, hash):

#----------------------------------------------------------------------------

"""
Iterate through the BAD results, collect the error messages, and send a nicely
formatted comment to the PR.

For the structure of the results dictionary, see comment for print_results()
below.

"""
def comment_on_pr(pr, results, repo):
# If there are no BAD results, just return without posting a comment to the
# GitHub PR.
if len(results[BAD]) == 0:
return

comment = "Hello! The Git Commit Checker CI bot found a few problems with this PR:"
for hash, entry in results[BAD].items():
comment += f"\n\n**{hash[:8]}: {make_commit_message(repo, hash)}**"
for check_name, message in entry.items():
if message is not None:
comment += f"\n * *{check_name}: {message}*"
comment_footer = "\n\nPlease fix these problems and, if necessary, force-push new commits back up to the PR branch. Thanks!"

# GitHub says that 65536 characters is the limit of comment messages, so
# check if our comment is over that limit. If it is, truncate it to fit, and
# add a message explaining with a link to the full error list.
comment_char_limit = 65536
if len(comment + comment_footer) >= comment_char_limit:
run_url = f"{GITHUB_SERVER_URL}/{GITHUB_REPOSITORY}/actions/runs/{GITHUB_RUN_ID}?check_suite_focus=true"
truncation_message = f"\n\n**Additional errors could not be shown...\n[Please click here for a full list of errors.]({run_url})**"
# Cut the comment down so we can get the comment itself, and the new
# message in.
comment = comment[:(comment_char_limit - len(comment_footer + truncation_message))]
# In case a newline gets split in half, remove the leftover '\' (if
# there is one). (This is purely an aesthetics choice).
comment = comment.rstrip("\\")
comment += truncation_message

comment += comment_footer
pr.create_issue_comment(comment)

return

#----------------------------------------------------------------------------

"""
The results dictionary is in the following format:

Expand Down Expand Up @@ -292,7 +343,13 @@ def check_all_commits(config, repo):
If "bot:notacherrypick" is in the PR description, then disable the
cherry-pick message requirement.
"""
def check_github_pr_description(config):
def check_github_pr_description(config, pr):
if pr.body and NACP in pr.body:
config['cherry pick required'] = False

#----------------------------------------------------------------------------

def get_github_pr():
g = Github(GITHUB_TOKEN)
repo = g.get_repo(GITHUB_REPOSITORY)

Expand All @@ -301,8 +358,7 @@ def check_github_pr_description(config):
pr_num = int(match.group(1))
pr = repo.get_pull(pr_num)

if pr.body and NACP in pr.body:
config['cherry pick required'] = False
return pr

#----------------------------------------------------------------------------

Expand Down Expand Up @@ -334,11 +390,13 @@ def load_config():

def main():
config = load_config()
check_github_pr_description(config)
pr = get_github_pr()
check_github_pr_description(config, pr)

repo = git.Repo(GITHUB_WORKSPACE)
results, hashes = check_all_commits(config, repo)
print_results(results, repo, hashes)
comment_on_pr(pr, results, repo)

if len(results[BAD]) == 0:
print("\nTest passed: everything was good!")
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/git-commit-checks.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
name: GitHub Action CI

# We're using pull_request_target here instead of just pull_request so that the
# action runs in the context of the base of the pull request, rather than in the
# context of the merge commit. For more detail about the differences, see:
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target
on:
pull_request:
pull_request_target:
# We don't need this to be run on all types of PR behavior
# See https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request
types:
Expand Down
Loading