-
Notifications
You must be signed in to change notification settings - Fork 2.8k
chore: add verification workflow for AI policy enforcement #7976
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
base: main
Are you sure you want to change the base?
Changes from 9 commits
80a0779
fb7dec9
f057251
77e5b37
a34738c
f7a823e
9d2ca8a
91caeb9
6b9356a
1cb1469
851a1eb
8dab0c6
79a53cd
0afae3b
850c065
53de728
c446afa
233ee84
2da63c8
2d55221
a928cb1
cdeb3d1
9eaece3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,204 @@ | ||||||||||||||||||||||||||||||||||||||||||||
| # Copyright (c) 2026 The Jaeger Authors. | ||||||||||||||||||||||||||||||||||||||||||||
| # SPDX-License-Identifier: Apache-2.0 | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| # This workflow verifies that contributors have run tests locally. | ||||||||||||||||||||||||||||||||||||||||||||
| # It uses pull_request_target to run for PRs from forks. | ||||||||||||||||||||||||||||||||||||||||||||
| # New contributors must provide a Test-Gist proving tests were run. | ||||||||||||||||||||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||||||||||||||||||||
| # Note: Only the HEAD commit is checked. If a PR has multiple commits, | ||||||||||||||||||||||||||||||||||||||||||||
| # only the latest commit needs the trailers. | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| name: Verify PR | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||||||||||||||
| pull_request_target: | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
| types: [opened, synchronize, reopened] | ||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+3
to
+5
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Critical workflow event mismatch: The workflow uses on:
pull_request_target:
types: [opened, synchronize, reopened]Security note: When changing to
Suggested change
Spotted by Graphite Agent |
||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
3
to
6
|
||||||||||||||||||||||||||||||||||||||||||||
| # Explicit permissions for security with pull_request_target | ||||||||||||||||||||||||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||||||||||||||||||||||||
| contents: read | ||||||||||||||||||||||||||||||||||||||||||||
| pull-requests: read | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||||||||||||
| verify: | ||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
| steps: | |
| steps: | |
| - name: Harden GitHub Runner | |
| uses: step-security/harden-runner@v2 | |
| with: | |
| egress-policy: audit |
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other workflows pin step-security/harden-runner to an immutable commit SHA (e.g., .github/workflows/ci-unit-tests.yml:25), but this workflow uses the floating @v2 tag. For supply-chain safety and consistency, pin step-security/harden-runner to a commit SHA here as well.
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The checkout action version is inconsistent with the rest of the codebase. Most workflows use actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0, but this uses actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2. For consistency and to use the latest stable version, consider updating to v6.0.0 like other workflows.
Copilot
AI
Feb 4, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The checkout uses fetch-depth: 1 which creates a shallow clone with only the most recent commit. While this is good for performance, it means that if a PR contains multiple commits, only the HEAD commit's message will be checked.
If a contributor made multiple commits and only the last one has the Tested-By trailer, the workflow will pass even though earlier commits don't have it. This might be intentional (only checking the latest state), but it's worth considering if you want to check all commits in the PR. If the intent is to only check the HEAD commit, this is fine, but it should perhaps be documented.
Copilot
AI
Feb 4, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using pull_request_target with actions/checkout@v4 to check out the PR head (line 21) creates a potential security risk. The workflow runs with write permissions to the repository (by default with pull_request_target), but checks out and executes code from an untrusted fork.
While this workflow only runs shell commands to check commit messages and doesn't execute code from the PR, it's still a security concern because:
- The checkout itself could be exploited if there are malicious git hooks or submodules
- This sets a precedent that could be copied incorrectly in other workflows
Since this workflow only needs to read the commit message, consider using the GitHub API via actions/github-script or gh api to fetch commit information instead of checking out the code. Alternatively, if checkout is necessary, ensure the permissions block explicitly restricts write access (as mentioned in a separate comment).
Copilot
AI
Feb 8, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This repo appears to pin GitHub Actions to full commit SHAs (e.g., actions/checkout@... # v6.0.0) in other workflows. Here actions/checkout@v4 is unpinned, which weakens supply-chain security and is inconsistent with the established pattern. Pin actions/checkout to a specific commit SHA (with an inline version comment) like the other workflows.
Outdated
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailer detection/parsing is currently done via substring grep on the whole commit message. This can be fooled by mentioning Tested-By: / Test-Gist: in the body and may mis-parse values. Consider parsing trailers via git interpret-trailers --parse (or at least matching ^Tested-By: / ^Test-Gist: and extracting the value from the parsed trailer block) to align with the documented requirement of commit trailers.
| if echo "$COMMIT_MSG" | grep -q "Tested-By:"; then | |
| TRAILERS=$(printf '%s\n' "$COMMIT_MSG" | git interpret-trailers --parse) | |
| echo "Parsed trailers:" | |
| echo "$TRAILERS" | |
| echo "---" | |
| if echo "$TRAILERS" | grep -qE '^Tested-By:[[:space:]]*'; then |
Outdated
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workflow checks for "Tested-By:" using a simple grep (line 62), but doesn't validate the format of the trailer. If a user has empty Git config values or malformed data, the trailer could be invalid but still pass this check (e.g., "Tested-By: <>" would match). Consider adding validation to ensure the trailer follows the expected format "Tested-By: Name " to catch configuration issues early.
| if echo "$COMMIT_MSG" | grep -q "Tested-By:"; then | |
| echo "✅ Found Tested-By trailer" | |
| echo "found=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "❌ Missing Tested-By trailer" | |
| # Require a properly formatted Tested-By trailer: Tested-By: Name <email> | |
| if echo "$COMMIT_MSG" | grep -Eq '^Tested-By: .+ <.+@.+>$'; then | |
| echo "✅ Found Tested-By trailer with valid format" | |
| echo "found=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "❌ Missing or malformed Tested-By trailer (expected: Tested-By: Name <email>)" |
Outdated
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
grep -q "Tested-By:" will pass even if the string appears in the middle of the commit message or without any identity details. Since the policy requires a commit trailer, consider matching a trailer-form line (e.g., anchored ^Tested-By: .+ <.+>$) and ideally only within the trailer block at the end of the message.
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move all this logic to a script where it can be easily tested. You can even write unit tests for the script (see scripts/utils/compute-tags.test.sh).
Outdated
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The script uses 'jq' to parse JSON from the GitHub API response, but doesn't verify that jq is installed before using it. While jq is typically pre-installed on ubuntu-latest runners, it's better to be explicit about dependencies. Consider either adding a check for jq availability at the start of the step, or documenting that the runner requires jq.
| # Ensure jq is available before attempting to parse the GitHub API response | |
| if ! command -v jq >/dev/null 2>&1; then | |
| echo "❌ 'jq' is required but not installed on this runner." | |
| echo " Please ensure the runner environment includes 'jq' (e.g., install it before running this workflow)." | |
| echo "valid=false" >> $GITHUB_OUTPUT | |
| exit 1 | |
| fi | |
Outdated
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The curl command on line 101 fetches Gist content from the GitHub API without authentication. While this may work for public Gists, it could hit rate limits or fail for private Gists. Consider using authenticated requests via curl -H "Authorization: Bearer ${{ github.token }}" ... to avoid rate limiting issues, especially if multiple PRs are being verified simultaneously.
Outdated
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This workflow calls the GitHub API without authentication. That is susceptible to low unauthenticated rate limits and can cause flaky verification failures. Please pass Authorization: Bearer ${{ github.token }} (or set GITHUB_TOKEN and use it) when calling the API.
Outdated
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The curl command doesn't check for HTTP errors. If the GitHub API returns an error (404, 403, 500, etc.), the command will succeed but GIST_CONTENT will be empty or contain error JSON. Consider adding -f flag to curl (fail on HTTP errors) or check the HTTP response code to provide more specific error messages like "Gist not found" vs "API error".
| GIST_CONTENT=$(curl -s "https://api.github.com/gists/$GIST_ID" | jq -r '.files | to_entries[0].value.content // empty') | |
| GIST_API_URL="https://api.github.com/gists/$GIST_ID" | |
| GIST_RESPONSE_FILE="$(mktemp)" | |
| HTTP_STATUS=$(curl -sS -w "%{http_code}" -o "$GIST_RESPONSE_FILE" "$GIST_API_URL") | |
| if [ "$HTTP_STATUS" -eq 404 ]; then | |
| echo "❌ Gist not found for ID: $GIST_ID (HTTP 404)" | |
| echo "valid=false" >> $GITHUB_OUTPUT | |
| rm -f "$GIST_RESPONSE_FILE" | |
| exit 1 | |
| elif [ "$HTTP_STATUS" -ge 400 ]; then | |
| echo "❌ GitHub API error while fetching Gist ID: $GIST_ID (HTTP $HTTP_STATUS)" | |
| echo "valid=false" >> $GITHUB_OUTPUT | |
| rm -f "$GIST_RESPONSE_FILE" | |
| exit 1 | |
| fi | |
| GIST_CONTENT=$(jq -r '.files | to_entries[0].value.content // empty' "$GIST_RESPONSE_FILE") | |
| rm -f "$GIST_RESPONSE_FILE" | |
Outdated
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Gist fetch uses an unauthenticated curl and does not fail on non-2xx responses. This is prone to GitHub API rate limiting and can silently return an error JSON that then looks like “missing content”. Pass Authorization: Bearer ${{ github.token }} (export via env:) and use curl --fail-with-body (or similar) so HTTP errors are handled explicitly.
Outdated
Copilot
AI
Feb 11, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jq -r '.files | to_entries[0].value.content' is brittle: object entry order isn’t guaranteed and a multi-file Gist could make this read the wrong file. It can also hard-fail with a jq error (before your [ -z "$GIST_CONTENT" ] check) if .files is missing (e.g., 404/abuse-limit responses). Prefer selecting the expected filename (e.g., test.log) and handling non-200 responses explicitly (e.g., curl -f + status check, or jq with ?/// empty).
Outdated
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The regex pattern for extracting the tree SHA uses grep -oE "Tree SHA: [0-9a-f]{40}" which only matches lowercase hex digits. Git SHAs are typically displayed in lowercase, but to be more robust, consider using [0-9a-f]{40} with case-insensitive matching or [0-9a-fA-F]{40} to handle both cases.
Outdated
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fallback check for "Commit SHA:" format (lines 116-121) provides a helpful message about old format Gists but then immediately rejects them. This is good for security, but since this is a new feature, there shouldn't be any "old format" Gists yet. This code appears to be defensive programming for a scenario that shouldn't exist. Consider removing this fallback code to simplify the logic, or add a comment explaining why it's needed (e.g., for testing purposes or migration from a previous implementation).
Sapthagiri777 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Outdated
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "Check for Test-Gist trailer" step (lines 70-143) will be skipped for trusted contributors, which means steps.test-gist.outputs.valid will be undefined/empty. In the "Verify results" step, line 156 assigns this empty value to TEST_GIST, which is then replaced with TEST_GIST_DEFAULT on line 161. However, if step test-gist-default also fails to run for some reason, both could be empty. While unlikely, consider adding a defensive check or initializing TEST_GIST to a default value to prevent edge cases.
| # Use default value for trusted contributors | |
| if [ "$TRUSTED" == "true" ]; then | |
| TEST_GIST="$TEST_GIST_DEFAULT" | |
| # Use default value for trusted contributors, with a defensive fallback | |
| if [ "$TRUSTED" == "true" ]; then | |
| if [ -z "$TEST_GIST_DEFAULT" ]; then | |
| # In case the default step did not run or did not set an output | |
| TEST_GIST="not-required" | |
| else | |
| TEST_GIST="$TEST_GIST_DEFAULT" | |
| fi |
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -127,6 +127,44 @@ This policy exists to: | |||||||
| - PRs that look like low-effort AI slop will be closed. | ||||||||
| - Repeated violators may be banned from the project. | ||||||||
|
|
||||||||
|
|
||||||||
|
|
||||||||
| ### Verification Workflow | ||||||||
|
|
||||||||
| To ensure contributors have actually run tests locally, we use a verification system. | ||||||||
|
|
||||||||
| **Prerequisites:** | ||||||||
| - [GitHub CLI (`gh`)](https://cli.github.com/) installed and authenticated | ||||||||
| - At least one commit on your branch | ||||||||
|
||||||||
| - At least one commit on your branch | |
| - At least one commit on your branch | |
| - A clean working tree (all changes you want verified are staged and committed) |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we do not have to spell out how the validation is done (it just makes it easier for LLM to cheat)
Outdated
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section says the Gist contains the commit SHA, but both make verify-with-proof and the CI verifier use the tree SHA (HEAD^{tree}) for validation. Please update the wording (and the step list) to consistently refer to tree SHA, otherwise contributors will produce the wrong proof format.
Copilot
AI
Feb 4, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a contributor runs make verify-with-proof to get the trailers, then makes additional commits, the Test-Gist will reference an old commit hash that doesn't match the PR head. The workflow checks for a Gist and validates it's accessible, but as noted in another comment, it doesn't verify the commit hash in the Gist description matches the PR's current commit.
This creates a loophole where contributors could:
- Run verify-with-proof on a simple/empty change
- Get the Tested-By and Test-Gist trailers
- Amend or add commits with actual changes
- Push, and the workflow would pass
The documentation (line 156) instructs users to push with --force-with-lease after running the command, but doesn't warn against making additional commits afterward. Consider adding a warning in the documentation about this limitation.
Copilot
AI
Feb 11, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new "Verification Workflow" section doesn't document the actual enforcement requirements described in the PR (required Tested-By: trailer, and Test-Gist: + what it contains for new contributors/trust rules). As written, contributors won't know what trailers are required or when the Gist is necessary.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -253,3 +253,61 @@ repro-check: | |||||||||||||||||||||||||||||||||||||||||||||||||||
| $(MAKE) clean | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| $(MAKE) build-all-platforms | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| shasum -b -a 256 --strict --check ./sha256sum.combined.txt | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+260
to
+261
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
Outdated
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test-with-log only checks PIPESTATUS[0] (exit of $(MAKE) test) and will still report success even if tee fails (e.g., disk full / permission issues), which means you may upload an incomplete/missing log. Consider using set -o pipefail for the pipeline and/or explicitly checking tee’s exit status so log capture failures fail the target.
| @$(MAKE) test 2>&1 | tee test.log; \ | |
| EXIT_CODE=$${PIPESTATUS[0]}; \ | |
| if [ $$EXIT_CODE -ne 0 ]; then \ | |
| echo "❌ Tests failed. See test.log for details."; \ | |
| exit $$EXIT_CODE; \ | |
| fi; \ | |
| @set -o pipefail; \ | |
| $(MAKE) test 2>&1 | tee test.log; \ | |
| TEST_EXIT_CODE=$${PIPESTATUS[0]}; \ | |
| TEE_EXIT_CODE=$${PIPESTATUS[1]}; \ | |
| if [ $$TEST_EXIT_CODE -ne 0 ]; then \ | |
| echo "❌ Tests failed. See test.log for details."; \ | |
| exit $$TEST_EXIT_CODE; \ | |
| fi; \ | |
| if [ $$TEE_EXIT_CODE -ne 0 ]; then \ | |
| echo "❌ Log capture failed (tee exited with $$TEE_EXIT_CODE). Test results may not be fully recorded."; \ | |
| exit $$TEE_EXIT_CODE; \ | |
| fi; \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please move to a script instead of doing in Makefile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make sure to run linter for scripts
Outdated
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The check for GitHub CLI uses command -v which is good, but the error message could be more helpful by suggesting how to authenticate after installation. Consider adding: "After installing, run 'gh auth login' to authenticate."
| echo "❌ GitHub CLI (gh) not found. Install from: https://cli.github.com/"; \ | |
| echo "❌ GitHub CLI (gh) not found. Install from: https://cli.github.com/"; \ | |
| echo " After installing, run 'gh auth login' to authenticate."; \ |
Outdated
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Makefile creates a temporary file test.log.tmp, writes content to it, and then moves it to test.log. However, if the script fails between lines 300-303 (e.g., disk full, permissions issue), test.log.tmp will be left behind. Consider adding cleanup with a trap or checking if test.log.tmp exists before creating it.
Outdated
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gh gist create ... --public will publish test logs in a publicly listed gist, which may unintentionally expose local paths/usernames or other sensitive output. Consider using a secret gist by default (and/or making visibility configurable) while keeping the URL in the trailer for CI verification.
| GIST_URL=$$(gh gist create test.log -d "Test logs for Jaeger tree $$TREE_SHA" --public); \ | |
| GIST_URL=$$(gh gist create test.log -d "Test logs for Jaeger tree $$TREE_SHA"); \ |
Outdated
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested-By is populated from git config user.name / user.email without validation. If either value is unset/empty, this will amend the commit with an invalid trailer (e.g., Tested-By: <>). Please add checks that both are non-empty (and ideally that the email looks like an email) before amending.
| EMAIL=$$(git config user.email); \ | |
| EMAIL=$$(git config user.email); \ | |
| if [ -z "$$NAME" ]; then \ | |
| echo "❌ git config user.name is not set or empty. Please configure it before running 'make verify-with-proof'."; \ | |
| exit 1; \ | |
| fi; \ | |
| if [ -z "$$EMAIL" ]; then \ | |
| echo "❌ git config user.email is not set or empty. Please configure it before running 'make verify-with-proof'."; \ | |
| exit 1; \ | |
| fi; \ | |
| if ! echo "$$EMAIL" | grep -Eq '^[^@[:space:]]+@[^@[:space:]]+\.[^@[:space:]]+'; then \ | |
| echo "❌ git config user.email ('$$EMAIL') does not look like a valid email address."; \ | |
| echo " Please set a valid email before running 'make verify-with-proof'."; \ | |
| exit 1; \ | |
| fi; \ |
Outdated
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested-By trailer is constructed from git config user.name / user.email, but these can be empty (common in fresh environments), producing an invalid trailer like Tested-By: <>. Add a check that both values are non-empty (and fail with an actionable message) before amending the commit.
| EMAIL=$$(git config user.email); \ | |
| EMAIL=$$(git config user.email); \ | |
| if [ -z "$$NAME" ] || [ -z "$$EMAIL" ]; then \ | |
| echo "❌ Git user.name and/or user.email are not set."; \ | |
| echo " Please configure your git identity, for example:"; \ | |
| echo " git config --global user.name \"Your Name\""; \ | |
| echo " git config --global user.email \"you@example.com\""; \ | |
| echo " Then re-run: make verify-with-proof"; \ | |
| exit 1; \ | |
| fi; \ |
Outdated
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The long shell block in verify-with-proof doesn’t enable set -e (and uses ; separators), so a failure in gh gist create (after the explicit check), git commit --amend, or rm can be masked by subsequent echo commands, potentially making the target succeed even though the commit wasn’t amended. Please add set -e (and ideally set -o pipefail) at the start of the block or use && chaining/check exit codes so failures propagate correctly.
Outdated
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
verify-with-proof runs a long \-continued shell script without set -e / error checks. If gh gist create or git commit --amend fails (e.g., auth/signing hooks), the recipe can continue, delete test.log, and print the success message anyway. Consider enabling set -euo pipefail for this block (or checking exit codes) and only removing test.log / printing success after the amend succeeds.
Uh oh!
There was an error while loading. Please reload this page.