Skip to content

Commit

Permalink
Changes from review
Browse files Browse the repository at this point in the history
  • Loading branch information
iarspider committed Feb 20, 2025
1 parent 9b63a3a commit 2c3d508
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion kill-stuck-pr-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ PR_ID=$(echo ${PULL_REQUEST} | cut -d '#' -f 2)
COMMIT_ID=$(curl -L http://localhost/SDT/jenkins-artifacts/pull-request-integration/${UPLOAD_UNIQUE_ID}/prs_commits.txt | grep "^${PULL_REQUEST}=")
if [ "X${COMMIT_ID}" = "X" ] ; then exit 0 ; fi

./cms-bot/update-commit-statuses-matching.py -r ${REPOSITORY} -c ${COMMIT_ID} -p ${CONTEXT}
./cms-bot/update-commit-statuses-matching.py -r ${REPOSITORY} -c ${COMMIT_ID} -p ${CONTEXT} rocm

touch abort-jenkins-job.prop
echo "JENKINS_PROJECT_TO_KILL=${JENKINS_PROJECT_TO_KILL}" >> abort-jenkins-job.prop
Expand Down
20 changes: 10 additions & 10 deletions update-commit-statues-matching.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,29 @@ def main():
parser.add_argument("--repository", "-r")
parser.add_argument("--commit", "-c")
parser.add_argument("--prefix", "-p")
parser.add_argument("suffix")
args = parser.parse_args()

status_prefix = f"{args.prefix}/"

all_statuses = github_utils.get_combined_statuses(args.commit, args.repository).get(
"statuses", []
)
index = 0

for status in all_statuses:
if (
status["context"].startswith(status_prefix)
and status["context"].endswith("/rocm")
and status["context"].endswith(f"/{args.suffix}")
and status["state"] == "pending"
):
with open("update-pr-status-{0}.prop".format(index), "w") as f:
f.write("REPOSITORY={0}\n".format(args.repository))
f.write("PULL_REQUEST={0}\n".format(args.commit))
f.write("CONTEXT={0}\n".format(status["context"]))
f.write("STATUS=success\n")
f.write("STATUS_MESSAGE=Timed out waiting for node\n")

index = index + 1
github_utils.mark_commit_status(
args.commit,
args.repository,
status["context"],
"success",
"",
"Timed out waiting for node",
)


if __name__ == "__main__":
Expand Down

0 comments on commit 2c3d508

Please sign in to comment.