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

Reduce window for finding a good commit #630

Merged
merged 4 commits into from
Aug 7, 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/sync-on-llvm-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
checkout-path: .
github-project: llvm/llvm-project
start-ref: main
max-tries: 500
max-tries: 100

- name: "Generate snapshot version info"
shell: bash -e {0}
Expand Down
9 changes: 5 additions & 4 deletions scripts/get-good-commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,14 @@ def get_good_commit(
logging.info(f"Found good commit: {commit_url}")
return commit.sha

return ""
sha = repo.get_commit(sha=start_ref).sha
logging.info(f"No good commit found, using the initial one: {start_ref}, aka {sha}")
return sha


def main():
parser = argparse.ArgumentParser(
description="Find the latest commit that passed tests"
description="Find the latest commit that passed tests or return the start-ref commit sha"
)
parser.add_argument(
"--token",
Expand Down Expand Up @@ -115,8 +117,7 @@ def main():
required_checks=args.required_checks,
max_tries=args.max_tries,
)
if sha == "":
sys.exit(-1)

print(sha)


Expand Down
Loading