Skip to content

Extract scan-images into a separate workflow#4710

Open
ahmedxgouda wants to merge 5 commits into
OWASP:feature/ci-cd-optimizationfrom
ahmedxgouda:ci/scan-images
Open

Extract scan-images into a separate workflow#4710
ahmedxgouda wants to merge 5 commits into
OWASP:feature/ci-cd-optimizationfrom
ahmedxgouda:ci/scan-images

Conversation

@ahmedxgouda
Copy link
Copy Markdown
Collaborator

@ahmedxgouda ahmedxgouda commented May 19, 2026

Proposed change

Resolves #4704

Extracted scan-images into a separate reusable workflow for production and staging
Updated Trivy caching

Checklist

  • Required: I followed the contributing workflow
  • Required: I verified that my code works as intended and resolves the issue as described
  • Required: I ran make check-test locally: all warnings addressed, tests passed
  • I used AI for code, documentation, tests, or communication related to this PR

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 19, 2026

Warning

Rate limit exceeded

@ahmedxgouda has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 16 minutes and 57 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: da091978-cc7c-4738-b9a3-a9caa0012fcb

📥 Commits

Reviewing files that changed from the base of the PR and between 7260ec3 and 5572823.

📒 Files selected for processing (3)
  • .github/workflows/run-ci-cd.yaml
  • .github/workflows/run-code-quality-checks.yaml
  • .github/workflows/scan-images.yaml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added the ci label May 19, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.80%. Comparing base (7260ec3) to head (5572823).

Additional details and impacted files

Impacted file tree graph

@@                     Coverage Diff                     @@
##           feature/ci-cd-optimization    #4710   +/-   ##
===========================================================
  Coverage                       98.80%   98.80%           
===========================================================
  Files                             528      528           
  Lines                           16805    16805           
  Branches                         2364     2364           
===========================================================
  Hits                            16605    16605           
  Misses                            115      115           
  Partials                           85       85           
Flag Coverage Δ
backend 99.50% <ø> (ø)
frontend 96.79% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7260ec3...5572823. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 2 files

Confidence score: 3/5

  • There is a concrete security/process risk in .github/workflows/run-ci-cd.yaml: binding the reusable scan job to a deployment environment can expose unnecessary environment secrets and trigger protection gates for a non-deployment step.
  • In .github/workflows/scan-images.yaml, release upload is not idempotent, so rerunning production scans for an existing tag can fail when SBOM assets already exist; this creates a practical CI/CD regression risk.
  • The Trivy cache key behavior in .github/workflows/scan-images.yaml is lower severity but can cause repeated DB downloads and reduce pipeline reliability/efficiency over time.
  • Pay close attention to .github/workflows/run-ci-cd.yaml and .github/workflows/scan-images.yaml - secret scope and rerun behavior should be tightened before relying on this pipeline flow.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name=".github/workflows/scan-images.yaml">

<violation number="1" location=".github/workflows/scan-images.yaml:88">
P2: Make the release upload idempotent. As written, rerunning the production scan for the same tag will fail once these SBOM assets already exist.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread .github/workflows/run-ci-cd.yaml
Comment thread .github/workflows/scan-images.yaml Outdated
Comment thread .github/workflows/scan-images.yaml Outdated
RELEASE_VERSION: ${{ inputs.release_version }}
RELEASE_TAG: ${{ inputs.release_tag }}
run: |
gh release upload ${{ env.RELEASE_TAG }} \
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Make the release upload idempotent. As written, rerunning the production scan for the same tag will fail once these SBOM assets already exist.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/scan-images.yaml, line 88:

<comment>Make the release upload idempotent. As written, rerunning the production scan for the same tag will fail once these SBOM assets already exist.</comment>

<file context>
@@ -0,0 +1,100 @@
+          RELEASE_VERSION: ${{ inputs.release_version }}
+          RELEASE_TAG: ${{ inputs.release_tag }}
+        run: |
+          gh release upload ${{ env.RELEASE_TAG }} \
+            backend-sbom-${{ env.RELEASE_VERSION }}.cdx.json \
+            frontend-sbom-${{ env.RELEASE_VERSION }}.cdx.json
</file context>
Suggested change
gh release upload ${{ env.RELEASE_TAG }} \
gh release upload ${{ env.RELEASE_TAG }} --clobber \

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arkid15r wdyt?

coderabbitai[bot]
coderabbitai Bot previously approved these changes May 19, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 2 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name=".github/workflows/scan-images.yaml">

<violation number="1" location=".github/workflows/scan-images.yaml:88">
P2: Make the release upload idempotent. As written, rerunning the production scan for the same tag will fail once these SBOM assets already exist.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread .github/workflows/scan-images.yaml Outdated
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 1 file (changes from recent commits).

Requires human review: Auto-approval blocked by 1 unresolved issue from previous reviews.

Re-trigger cubic

@ahmedxgouda ahmedxgouda marked this pull request as ready for review May 19, 2026 12:11
@ahmedxgouda ahmedxgouda added the gsoc2026:ahmedxgouda ahmedxgouda's GSoC 2026 related work label May 19, 2026
Copy link
Copy Markdown
Contributor

@Wandji69 Wandji69 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci gsoc2026:ahmedxgouda ahmedxgouda's GSoC 2026 related work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants