-
Notifications
You must be signed in to change notification settings - Fork 779
ci: Add CI guardrail for BoringSSL fork #5715
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
Merged
+70
−0
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
774f34a
Initial implementation of CI check:
kaukabrizvi 46351fe
Add new line at the end of workflow
kaukabrizvi 0a52055
Modify faliure script to update fork
kaukabrizvi e0a8c82
Spacing
kaukabrizvi 8b4ecb5
Rename bin script
kaukabrizvi 4a60415
Merge branch 'main' into ci-stale-boring
kaukabrizvi 807a1fe
Test failure case
kaukabrizvi 4f9250f
Change threshold to 60 days
kaukabrizvi aa41dfc
Merge branch 'main' into ci-stale-boring
kaukabrizvi 7a906c2
Merge branch 'main' into ci-stale-boring
kaukabrizvi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| # The script is configurable via environment variablesß | ||
| FORK_REPO="${FORK_REPO:-kaukabrizvi/boring}" # owner/repo | ||
| FORK_BRANCH="${FORK_BRANCH:-symbol-prefixing}" # branch to check | ||
| THRESHOLD_DAYS="${THRESHOLD_DAYS:-60}" # ~2 months | ||
|
|
||
| if ! command -v jq >/dev/null 2>&1; then | ||
| echo "ERROR: jq is required for the BoringSSL fork freshness check." | ||
| exit 2 | ||
| fi | ||
|
|
||
| commit_api="https://api.github.com/repos/${FORK_REPO}/commits/${FORK_BRANCH}" | ||
| json="$(curl -fsSL "${commit_api}")" | ||
|
|
||
| last_commit_date="$(echo "${json}" | jq -r '.commit.committer.date')" | ||
| last_commit_sha="$(echo "${json}" | jq -r '.sha')" | ||
|
|
||
| if [[ -z "${last_commit_date}" || "${last_commit_date}" == "null" ]]; then | ||
| echo "ERROR: Could not determine last commit date for ${FORK_REPO}@${FORK_BRANCH} from GitHub API." | ||
| exit 2 | ||
| fi | ||
|
|
||
| now_epoch="$(date -u +%s)" | ||
| commit_epoch="$(date -u -d "${last_commit_date}" +%s)" | ||
| age_days="$(( (now_epoch - commit_epoch) / 86400 ))" | ||
|
|
||
| if (( age_days > THRESHOLD_DAYS )); then | ||
| cat <<EOF | ||
| ERROR: BoringSSL fork branch appears stale. | ||
|
|
||
| Fork: ${FORK_REPO} | ||
| Branch: ${FORK_BRANCH} | ||
| Last commit: ${last_commit_sha} | ||
| Last commit date:${last_commit_date} (~${age_days} days ago) | ||
| Threshold: ${THRESHOLD_DAYS} days | ||
|
|
||
| Why this is failing: | ||
| s2n-tls currently depends on a forked BoringSSL branch (for symbol prefixing) to avoid | ||
| OpenSSL symbol collisions in integration tests. A stale fork risks outdated testing. | ||
|
|
||
| Refresh git@github.com:${FORK_REPO}/tree/${FORK_BRANCH} by syncing it with the upstream repository, | ||
| resolving merge conflicts if they appear. This should be done periodically and has not been done in | ||
| ~${age_days} days. | ||
| EOF | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "OK: ${FORK_REPO}@${FORK_BRANCH} last commit ${last_commit_sha} at ${last_commit_date} (~${age_days} days ago) within threshold ${THRESHOLD_DAYS}." | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| name: BoringSSL fork freshness | ||
|
|
||
| on: | ||
| pull_request: | ||
|
|
||
| jobs: | ||
| freshness: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Install jq | ||
| run: sudo apt-get update && sudo apt-get install -y jq | ||
|
|
||
| - name: Check BoringSSL fork freshness (time-bomb) | ||
| env: | ||
| FORK_REPO: kaukabrizvi/boring | ||
| FORK_BRANCH: symbol-prefixing | ||
| THRESHOLD_DAYS: "60" | ||
|
CarolYeh910 marked this conversation as resolved.
|
||
| run: .github/bin/check_boringssl_fork_freshness.sh | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.