-
Notifications
You must be signed in to change notification settings - Fork 1
Add bot auth telemetry skip contracts #1869
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
Changes from all commits
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 |
|---|---|---|
|
|
@@ -99,48 +99,6 @@ jobs: | |
| echo "workflow_app_auth_mode=${workflow_app_auth_mode}" | ||
| } >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Write wrapper App auth coverage | ||
| if: always() | ||
| env: | ||
| WORKFLOW_APP_AUTH_MODE: ${{ steps.workflow-app-creds.outputs.workflow_app_auth_mode }} | ||
| WORKFLOW_APP_CLIENT_ID_CONFIGURED: ${{ steps.workflow-app-creds.outputs.client_id_configured }} | ||
| WORKFLOW_APP_LEGACY_APP_ID_CONFIGURED: ${{ steps.workflow-app-creds.outputs.legacy_app_id_configured }} | ||
| WORKFLOW_APP_PRIVATE_KEY_CONFIGURED: ${{ steps.workflow-app-creds.outputs.private_key_configured }} | ||
| run: | | ||
| mkdir -p bot-comment-auth-coverage | ||
| node <<'NODE' | ||
| const fs = require('fs'); | ||
| const truthy = (value) => String(value || '').toLowerCase() === 'true'; | ||
| const record = { | ||
| schema: 'workflows-bot-comment-auth-coverage/v1', | ||
| component: 'agents-bot-comment-handler-wrapper', | ||
| repository: process.env.GITHUB_REPOSITORY || '', | ||
| workflow: process.env.GITHUB_WORKFLOW || '', | ||
| run_id: process.env.GITHUB_RUN_ID || '', | ||
| run_attempt: process.env.GITHUB_RUN_ATTEMPT || '', | ||
| event_name: process.env.GITHUB_EVENT_NAME || '', | ||
| auth_mode: process.env.WORKFLOW_APP_AUTH_MODE || 'none', | ||
| client_id_configured: truthy(process.env.WORKFLOW_APP_CLIENT_ID_CONFIGURED), | ||
| legacy_app_id_configured: truthy(process.env.WORKFLOW_APP_LEGACY_APP_ID_CONFIGURED), | ||
| private_key_configured: truthy(process.env.WORKFLOW_APP_PRIVATE_KEY_CONFIGURED), | ||
| fallback_warning_active: process.env.WORKFLOW_APP_AUTH_MODE === 'legacy-app-id', | ||
| direct_jobs_covered: ['resolve', 'cleanup'], | ||
| }; | ||
| fs.writeFileSync( | ||
| 'bot-comment-auth-coverage/wrapper.json', | ||
| `${JSON.stringify(record, null, 2)}\n` | ||
| ); | ||
| NODE | ||
|
|
||
| - name: Upload wrapper App auth coverage | ||
| if: always() | ||
| uses: actions/upload-artifact@v7 | ||
| with: | ||
| name: bot-comment-auth-coverage-wrapper-${{ github.run_id }} | ||
| path: bot-comment-auth-coverage/wrapper.json | ||
| if-no-files-found: error | ||
| retention-days: 14 | ||
|
|
||
| - name: Mint GitHub App Token (client ID) | ||
| id: app_token_client | ||
| uses: actions/create-github-app-token@v3 | ||
|
|
@@ -312,6 +270,56 @@ jobs: | |
| core.setOutput('pr_number', prNumber || ''); | ||
| core.setOutput('should_run', shouldRun ? 'true' : 'false'); | ||
|
|
||
| - name: Write wrapper App auth coverage | ||
| if: always() | ||
| env: | ||
| WORKFLOW_APP_AUTH_MODE: ${{ steps.workflow-app-creds.outputs.workflow_app_auth_mode }} | ||
| WORKFLOW_APP_CLIENT_ID_CONFIGURED: ${{ steps.workflow-app-creds.outputs.client_id_configured }} | ||
| WORKFLOW_APP_LEGACY_APP_ID_CONFIGURED: ${{ steps.workflow-app-creds.outputs.legacy_app_id_configured }} | ||
| WORKFLOW_APP_PRIVATE_KEY_CONFIGURED: ${{ steps.workflow-app-creds.outputs.private_key_configured }} | ||
| RESOLVED_PR_NUMBER: ${{ steps.resolve.outputs.pr_number }} | ||
| REUSABLE_INVOCATION_EXPECTED: ${{ steps.resolve.outputs.should_run }} | ||
| run: | | ||
| mkdir -p bot-comment-auth-coverage | ||
| node <<'NODE' | ||
| const fs = require('fs'); | ||
| const truthy = (value) => String(value || '').toLowerCase() === 'true'; | ||
| const reusableExpected = truthy(process.env.REUSABLE_INVOCATION_EXPECTED); | ||
| const record = { | ||
| schema: 'workflows-bot-comment-auth-coverage/v1', | ||
| component: 'agents-bot-comment-handler-wrapper', | ||
| repository: process.env.GITHUB_REPOSITORY || '', | ||
| workflow: process.env.GITHUB_WORKFLOW || '', | ||
| run_id: process.env.GITHUB_RUN_ID || '', | ||
| run_attempt: process.env.GITHUB_RUN_ATTEMPT || '', | ||
| event_name: process.env.GITHUB_EVENT_NAME || '', | ||
| auth_mode: process.env.WORKFLOW_APP_AUTH_MODE || 'none', | ||
| client_id_configured: truthy(process.env.WORKFLOW_APP_CLIENT_ID_CONFIGURED), | ||
| legacy_app_id_configured: truthy(process.env.WORKFLOW_APP_LEGACY_APP_ID_CONFIGURED), | ||
| private_key_configured: truthy(process.env.WORKFLOW_APP_PRIVATE_KEY_CONFIGURED), | ||
| fallback_warning_active: process.env.WORKFLOW_APP_AUTH_MODE === 'legacy-app-id', | ||
| resolved_pr_number: process.env.RESOLVED_PR_NUMBER || '', | ||
| reusable_invocation_expected: reusableExpected, | ||
| reusable_invocation_reason: reusableExpected | ||
| ? 'wrapper-should-run' | ||
| : 'wrapper-skipped', | ||
| direct_jobs_covered: ['resolve', 'cleanup'], | ||
|
Comment on lines
+286
to
+306
|
||
| }; | ||
| fs.writeFileSync( | ||
| 'bot-comment-auth-coverage/wrapper.json', | ||
| `${JSON.stringify(record, null, 2)}\n` | ||
| ); | ||
| NODE | ||
|
|
||
| - name: Upload wrapper App auth coverage | ||
| if: always() | ||
| uses: actions/upload-artifact@v7 | ||
| with: | ||
| name: bot-comment-auth-coverage-wrapper-${{ github.run_id }} | ||
| path: bot-comment-auth-coverage/wrapper.json | ||
| if-no-files-found: error | ||
| retention-days: 14 | ||
|
|
||
| # Call the reusable workflow | ||
| handle: | ||
| name: Handle bot comments | ||
|
|
||
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.
Treating
REUSABLE_INVOCATION_EXPECTEDas a strict boolean here turns an unset output intofalse. Ifsteps.resolveexits unexpectedly before emittingshould_run(for example, an uncaught API/script failure), this record is written asreusable_invocation_expected: false, andsummarizeOrganicEvidencewill skip missing reusable evidence as if the wrapper intentionally skipped it. That masks real failures in the reusable path and weakens the weekly auth-coverage signal.Useful? React with 👍 / 👎.