Skip to content

Harden beats-cve-report against ECR scan/finding consistency lag - #29

Draft
keithboone with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-beats-cve-report-job
Draft

Harden beats-cve-report against ECR scan/finding consistency lag#29
keithboone with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-beats-cve-report-job

Conversation

Copilot AI commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

beats-cve-report can observe imageScanStatus=COMPLETE and still fail immediately afterward with ScanNotFoundException when fetching findings for :latest. This PR removes that race by making findings retrieval retry-aware for transient ECR readiness lag.

  • Root cause

    • ECR scan status readiness and findings availability are not strictly synchronous.
    • Workflow treated ScanNotFoundException as terminal in the findings fetch step.
  • Workflow change (.github/workflows/build.yml)

    • Updated Retrieve ECR enhanced findings step to use a bounded retry loop:
      • timeout: 300s
      • interval: 15s
    • Retries only on ScanNotFoundException.
    • Preserves fail-fast behavior for non-transient AWS errors.
  • Behavioral impact

    • No change to report generation logic.
    • Reduces false-negative job failures caused by short ECR propagation delays.
while true; do
  if aws ecr describe-image-scan-findings ... > beats-cve-raw.json 2>scan.err; then
    break
  fi
  grep -q "ScanNotFoundException" scan.err || exit 1
  # retry until timeout
done

Copilot AI changed the title [WIP] Fix failing GitHub Actions job beats-cve-report Harden beats-cve-report against ECR scan/finding consistency lag Jun 29, 2026
Copilot AI requested a review from keithboone June 29, 2026 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants