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

gh-gl-sync: fetch at max depth rather than unshallow #974

Merged
merged 1 commit into from
Oct 15, 2024
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/workflows/custom_docker_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
matrix:
include:
- docker-image: ./images/gh-gl-sync
image-tags: ghcr.io/spack/ci-bridge:0.0.42
image-tags: ghcr.io/spack/ci-bridge:0.0.43
- docker-image: ./images/ci-key-clear
image-tags: ghcr.io/spack/ci-key-clear:0.0.2
- docker-image: ./images/gitlab-stuckpods
Expand Down
8 changes: 4 additions & 4 deletions images/gh-gl-sync/SpackCIBridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def list_github_prs(self):
# Check if we should defer pushing/testing this PR because it is based on "too new" of a commit
# of the main branch.
tmp_pr_branch = f"temporary_{pr_string}"
_durable_subprocess_run(["git", "fetch", "--unshallow", "github",
_durable_subprocess_run(["git", "fetch", "--depth=2147483647", "github",
f"refs/pull/{pull.number}/head:{tmp_pr_branch}"])
# Get the merge base between this PR and the main branch.
try:
Expand Down Expand Up @@ -263,7 +263,7 @@ def list_github_prs(self):
# then we will push the merge commit that was automatically created by GitHub to GitLab
# where it will kick off a CI pipeline.
try:
_durable_subprocess_run(["git", "fetch", "--unshallow", "github",
_durable_subprocess_run(["git", "fetch", "--depth=2147483647", "github",
f"{pull.merge_commit_sha}:{pr_string}"])
except subprocess.CalledProcessError:
print("Failed to locally checkout PR {0} ({1}). Skipping"
Expand Down Expand Up @@ -343,7 +343,7 @@ def setup_git_repo(self):
self.gitlab_shallow_fetch()

if self.main_branch:
_durable_subprocess_run(["git", "fetch", "--unshallow", "github", self.main_branch])
_durable_subprocess_run(["git", "fetch", "--depth=2147483647", "github", self.main_branch])

def get_gitlab_pr_branches(self):
"""Query GitLab for branches that have already been copied over from GitHub PRs.
Expand Down Expand Up @@ -387,7 +387,7 @@ def update_refspecs_for_tags(self, tags, open_refspecs, fetch_refspecs):
def fetch_github_branches(self, fetch_refspecs):
"""Perform `git fetch` for a given list of refspecs."""
print("Fetching GitHub refs for open PRs")
fetch_args = ["git", "fetch", "-q", "--unshallow", "github"] + fetch_refspecs
fetch_args = ["git", "fetch", "-q", "--depth=2147483647", "github"] + fetch_refspecs
_durable_subprocess_run(fetch_args)

def build_local_branches(self, protected_branches):
Expand Down
2 changes: 1 addition & 1 deletion 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.42
image: ghcr.io/spack/ci-bridge:0.0.43
imagePullPolicy: IfNotPresent
resources:
requests:
Expand Down
Loading