Repository navigation
Conversation
Node core http sends no default User-Agent, so the getUploadUrl POST reached the BuildPulse edge WAF (AWS CommonRuleSet) with no UA and was blocked by the NoUserAgent_HEADER rule with a bare 403 — surfacing to users as the generic "API request failed with status 403". Set an explicit buildpulse-test-reporter-action/<version> User-Agent so the request reaches the API. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
loera140
left a comment
There was a problem hiding this comment.
Agent code review
Walkthrough
Adds an explicit User-Agent: buildpulse-test-reporter-action/<version> header to the getUploadUrl POST in src/upload.js, sourcing the version from package.json. Node's core http/https client sends no default UA, which was tripping AWS CommonRuleSet's NoUserAgent_HEADER rule at the edge WAF and returning a bare 403. The dist/index.js bundle is rebuilt to match, including the ncc-inlined package.json module.
Findings
- No issues found.
Verdict
APPROVE. Change is tightly scoped to the described fix, the src edit and the regenerated dist bundle are consistent, ACTION_VERSION resolves to the real 3.0.0 from package.json (confirmed against both package.json and the inlined module 8330), and there are no auto-merge red flags: no scope drift, no hallucinated APIs (require('../package.json') is standard Node), no tests weakened (repo has no unit tests), no prompt-injection content. The S3 PUT in uploadToS3 also lacks a UA, but S3 signed URLs bypass the BuildPulse WAF, so that's correctly out of scope.
Confidence
HIGH — read both changed files fully, verified version wiring, and confirmed the dist change is a faithful rebuild of the src change.
|
Closing as redundant. origin/main (e3301a5, PR #10 fix/user-agent-cloudfront) already sends an explicit User-Agent (BuildPulse-TestReporter/3.0) on the upload-url request and S3 PUT — my local checkout was stale when I branched. The new action is already fixed and v3 is re-tagged; demo uploads recovered 2026-07-12. The remaining exposure is the LEGACY buildpulse-action (no User-Agent, e.g. retailnext pin 0b048a4), which is covered by the WAF override in environment PR #191. |
Problem
Since the SOC 2 edge WAF (environment PR #189, applied 2026-07-11 00:49 UTC) attached AWS CommonRuleSet to the app2/apex CloudFront distribution, every test-result upload has been failing with a bare
403, surfacing to users as:Root cause: the CommonRuleSet
NoUserAgent_HEADERrule blocks any request that arrives with noUser-Agent. ThegetUploadUrlPOST is issued via Node corehttps.request, which sends no default User-Agent, so the request was dropped at the edge before reaching the API. (curlalways sends a UA, which is why manual tests passed.)Fix
Set an explicit
User-Agent: buildpulse-test-reporter-action/<version>on the upload-url request. The S3 PUT goes directly to S3 (bypasses CloudFront/WAF) and is unaffected.Verified
npm test— 31/31 passbuildpulse-test-reporter-action/3.0.0POST /api/test-results/upload-urlreturns 200/401 (reaches the app) instead of the WAF 403Related
🤖 Generated with Claude Code