Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(ci): handle artifact download failures in weekly security audit#693

Merged
manavgup merged 1 commit into
mainfrom
fix/weekly-security-audit-artifact-download
Nov 26, 2025
Merged

fix(ci): handle artifact download failures in weekly security audit#693
manavgup merged 1 commit into
mainfrom
fix/weekly-security-audit-artifact-download

Conversation

@manavgup
Copy link
Copy Markdown
Owner

Summary

  • Add resilience to the Vulnerability Report job for transient GitHub Actions infrastructure issues with artifact downloads
  • Downgrade from actions/download-artifact@v6 to v4 for improved stability
  • Add retry logic and graceful degradation when artifacts are unavailable

Problem

The Weekly Security Audit workflow was failing at the πŸ“₯ Download Security Reports step due to Azure blob storage timeouts. The security scans themselves (Backend Security Audit, Frontend Security Audit) complete successfully, but the final Vulnerability Report job fails because actions/download-artifact@v6 cannot download artifacts from Azure blob storage after 5 retries.

Error from failed run:

Error: Unable to download artifact(s): Unable to download and extract artifact: Artifact download failed after 5 retries.

Solution

  1. Downgrade to v4: Use actions/download-artifact@v4 which has better stability
  2. Add retry step: Retry download once if initial attempt fails
  3. Add verification: Check if artifacts exist before analysis
  4. Graceful degradation: Skip analysis (instead of failing) when artifacts unavailable
  5. Warning annotation: Add GitHub warning annotation when artifacts missing
  6. Conditional success: Only show success message when analysis actually ran

Changes

  • .github/workflows/06-weekly-security-audit.yml: 53 lines added, 2 removed

Test plan

  • Verify workflow YAML is valid (pre-commit passed)
  • Manually trigger Weekly Security Audit workflow
  • Verify artifact download succeeds (when infra is healthy)
  • Verify graceful handling when artifacts unavailable

πŸ€– Generated with Claude Code

Add resilience to the Vulnerability Report job for transient GitHub
Actions infrastructure issues with artifact downloads.

Changes:
- Downgrade from actions/download-artifact@v6 to v4 for stability
- Add retry step when initial download fails
- Add verification step to check if artifacts exist
- Add graceful handling when artifacts are unavailable
- Add warning annotation for missing artifacts
- Skip analysis (instead of failing) when artifacts unavailable

Root cause: Azure blob storage timeouts cause download-artifact@v6 to
fail after 5 retries. This is a GitHub infrastructure issue, not a
problem with our security scans which complete successfully.

πŸ€– Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@github-actions
Copy link
Copy Markdown
Contributor

πŸš€ Development Environment Options

This repository supports Dev Containers for a consistent development environment.

Option 1: GitHub Codespaces (Recommended)

Create a cloud-based development environment:

  1. Click the green Code button above
  2. Select the Codespaces tab
  3. Click Create codespace on fix/weekly-security-audit-artifact-download
  4. Wait 2-3 minutes for environment setup
  5. Start coding with all tools pre-configured!

Option 2: VS Code Dev Containers (Local)

Use Dev Containers on your local machine:

  1. Install Docker Desktop
  2. Install VS Code
  3. Install the Dev Containers extension
  4. Clone this PR branch locally
  5. Open in VS Code and click "Reopen in Container" when prompted

Option 3: Traditional Local Setup

Set up the development environment manually:

# Clone the repository
git clone https://github.com/manavgup/rag_modulo.git
cd rag_modulo
git checkout fix/weekly-security-audit-artifact-download

# Initialize development environment
make dev-init
make dev-build
make dev-up
make dev-validate

Available Commands

Once in your development environment:

make help           # Show all available commands
make dev-validate   # Validate environment setup
make test-atomic    # Run atomic tests
make test-unit      # Run unit tests
make lint          # Run linting

Services Available

When running make dev-up:


This automated message helps reviewers quickly set up the development environment.

@github-actions
Copy link
Copy Markdown
Contributor

Code Review: Artifact Download Resilience

Summary

This PR addresses a critical infrastructure resilience issue in the Weekly Security Audit workflow. The changes add robust error handling for transient GitHub Actions artifact download failures while maintaining workflow reliability.

βœ… Strengths

1. Excellent Problem Analysis

  • Clear root cause identification (Azure blob storage timeouts)
  • Evidence-based approach with links to failed runs
  • Proper separation of concerns (infrastructure vs. application issues)

2. Well-Designed Resilience Strategy
The multi-layered approach is solid:

  • Downgrade to v4 (proven stability)
  • Retry mechanism (single retry to avoid excessive delays)
  • Verification step (explicit success checking)
  • Graceful degradation (skip analysis vs. fail workflow)
  • User feedback (warning annotations)

3. Good Conditional Logic
Clean state management across multiple steps with proper if conditions.

4. Appropriate Use of continue-on-error
Using continue-on-error: true on download steps allows the workflow to handle failures gracefully rather than failing immediately.


πŸ” Potential Improvements

1. Consider Exponential Backoff
Currently the retry happens immediately. Consider adding a brief delay (10 seconds) before retry to give the infrastructure time to recover.

2. Minor: Output Consistency
Line 208 adds debug logging which is good. Consider adding similar logging for the artifact upload step to help trace artifact creation issues.

3. Consider Adding Artifact Age Check
For extra robustness, verify artifacts are from the current workflow run (within 1 hour).

4. Documentation Update Needed
This is an important workflow change. Consider adding a note to docs/troubleshooting/ci-cd.md or creating docs/troubleshooting/github-actions.md. Documenting known GitHub Actions infrastructure issues helps future maintainers.


πŸ›‘οΈ Security Considerations

βœ… No security concerns identified

  • No secrets exposure
  • No privilege escalation
  • Graceful degradation does not bypass security checks
  • Warning annotations properly inform users of missing analysis

πŸ§ͺ Testing Recommendations

Current test plan is good, but consider:

  1. Simulate artifact download failure locally
  2. Test the warning annotation in GitHub UI
  3. Verify no false positives on successful runs

πŸ“Š Performance Impact

βœ… Minimal overhead

  • Single retry adds ~5-10 seconds max on failure
  • Verification step is trivial
  • No impact on successful runs

🎯 Alignment with Project Standards

Checking against CLAUDE.md guidelines:
βœ… CI/CD Best Practices: Follows IBM focused workflow pattern (Issue #349)
βœ… Error Handling: Proper error handling with graceful degradation
βœ… Concurrency Control: Workflow properly uses needs: rebuild-and-scan
βœ… Smart Path Filtering: Not applicable (scheduled workflow)
βœ… Documentation: Could be improved (see suggestion above)


🎬 Final Recommendation

APPROVE βœ… with minor suggestions

This is a high-quality fix for a real production issue. The implementation is:

  • Well-reasoned and evidence-based
  • Properly scoped (fixes artifact downloads without changing security logic)
  • Production-ready with appropriate error handling
  • Low risk (graceful degradation > workflow failure)

Optional enhancements (non-blocking):

  1. Add 10-second delay before retry
  2. Document in troubleshooting guide
  3. Consider artifact freshness check

Great work! This exemplifies thoughtful infrastructure engineering. πŸš€


References:

πŸ€– Review generated by Claude Code

@manavgup manavgup merged commit af52bf8 into main Nov 26, 2025
22 checks passed
@manavgup manavgup deleted the fix/weekly-security-audit-artifact-download branch November 26, 2025 19:54
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.

1 participant