Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/images.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
images:
- path: ./images/gh-gl-sync
image: ghcr.io/spack/ci-bridge:0.0.46
image: ghcr.io/spack/ci-bridge:0.0.47

- path: ./images/ci-key-clear
image: ghcr.io/spack/ci-key-clear:0.0.3
Expand Down
10 changes: 9 additions & 1 deletion images/gh-gl-sync/SpackCIBridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from datetime import datetime, timedelta, timezone
import dateutil.parser
from github import Github
from github.GithubException import GithubException
import json
import os
import re
Expand Down Expand Up @@ -138,7 +139,11 @@ def get_commit(self, commit):
""" Check our cache for a commit on GitHub.
If we don't have it yet, use the GitHub API to retrieve it."""
if commit not in self.cached_commits:
self.cached_commits[commit] = self.py_gh_repo.get_commit(sha=commit)
try:
self.cached_commits[commit] = self.py_gh_repo.get_commit(sha=commit)
except GithubException as ghe:
print(ghe)
return None
return self.cached_commits[commit]

def list_github_prs(self):
Expand Down Expand Up @@ -605,6 +610,9 @@ def post_pipeline_status(self, open_prs, protected_branches):
def create_status_for_commit(self, sha, branch, state, target_url, description):
context = os.environ.get("GITHUB_STATUS_CONTEXT", "ci/gitlab-ci")
commit = self.get_commit(sha)
if commit is None:
print(f"Unable to find GitHub commit for sha {sha} on branch {branch}")
return
existing_statuses = commit.get_combined_status()
for status in existing_statuses.statuses:
if (status.context == context and
Expand Down
4 changes: 2 additions & 2 deletions k8s/production/custom/gh-gl-sync/cron-jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spec:
restartPolicy: Never
containers:
- name: sync
image: ghcr.io/spack/ci-bridge:0.0.46
image: ghcr.io/spack/ci-bridge:0.0.47
imagePullPolicy: IfNotPresent
resources:
requests:
Expand Down Expand Up @@ -69,7 +69,7 @@ spec:
restartPolicy: Never
containers:
- name: sync
image: ghcr.io/spack/ci-bridge:0.0.46
image: ghcr.io/spack/ci-bridge:0.0.47
imagePullPolicy: IfNotPresent
resources:
requests:
Expand Down
2 changes: 1 addition & 1 deletion k8s/production/custom/kokkos-sync/cron-jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spec:
restartPolicy: Never
containers:
- name: sync
image: ghcr.io/spack/ci-bridge:0.0.46
image: ghcr.io/spack/ci-bridge:0.0.47
imagePullPolicy: IfNotPresent
resources:
requests:
Expand Down
Loading