Skip to content

Comments

fix(ci): correct ZAP baseline report filename to avoid upload failure#3246

Merged
arkid15r merged 9 commits intoOWASP:mainfrom
nios-x:zap
Jan 9, 2026
Merged

fix(ci): correct ZAP baseline report filename to avoid upload failure#3246
arkid15r merged 9 commits intoOWASP:mainfrom
nios-x:zap

Conversation

@nios-x
Copy link
Contributor

@nios-x nios-x commented Jan 8, 2026

Proposed change

Resolves #3239

This PR fixes the ZAP baseline GitHub Actions workflow by ensuring the generated HTML report filename matches the filename expected during artifact upload.

Previously, the workflow overrode the default report filename via cmd_options, which caused a mismatch and resulted in a file-not-found error during the upload step. This change aligns the ZAP scan output and artifact upload path so the report is generated and uploaded correctly for both staging and production scans.

Checklist

  • Required: I read and followed the contributing guidelines
  • Required: I ran make check-test locally and all tests passed
  • I used AI for code, documentation, or tests in this PR

@nios-x nios-x requested review from arkid15r and kasya as code owners January 8, 2026 09:05
@github-actions github-actions bot added the ci label Jan 8, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 8, 2026

Summary by CodeRabbit

  • Chores
    • Updated CI/CD workflow configuration for security scanning processes.

✏️ Tip: You can customize this high-level summary in your review settings.

Walkthrough

Change ZAP baseline scan report filename references in CI workflow: update cmd_options to use report_html.html and adjust artifact upload paths in .github/workflows/run-ci-cd.yaml.

Changes

Cohort / File(s) Summary
CI/CD workflow
​.github/workflows/run-ci-cd.yaml
Updated two occurrences of ZAP baseline cmd_options from -r report.html to -r report_html.html and changed the artifact upload path from report.html to report_html.html. No structural or control-flow edits.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested reviewers

  • kasya
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: correcting a ZAP baseline report filename to fix CI upload failures.
Description check ✅ Passed The description is clearly related to the changeset, explaining the filename mismatch issue and how the PR addresses it.
Linked Issues check ✅ Passed The PR correctly addresses issue #3239 by changing report.html to report_html.html in both cmd_options and artifact upload paths, resolving the filename mismatch.
Out of Scope Changes check ✅ Passed All changes are limited to correcting the ZAP report filename references in the CI/CD workflow, directly addressing the linked issue with no extraneous modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8b5d675 and 56c9819.

📒 Files selected for processing (1)
  • .github/workflows/run-ci-cd.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/run-ci-cd.yaml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Run frontend unit tests
  • GitHub Check: Run backend tests
  • GitHub Check: Run frontend e2e 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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @.github/workflows/run-ci-cd.yaml:
- Line 616: Two occurrences of the checkout step were changed to
actions/checkout@v4 breaking consistency with the rest of the workflow; revert
those uses back to the pinned SHA
actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 so all checkout steps
match the pinned version, and add a brief PR note clarifying whether the switch
to @v4 was intentional or accidental since this change is unrelated to the ZAP
report upload fix.
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5b7217a and 795f055.

📒 Files selected for processing (1)
  • .github/workflows/run-ci-cd.yaml
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-12-21T19:03:59.068Z
Learnt from: ahmedxgouda
Repo: OWASP/Nest PR: 1139
File: .github/workflows/setup-backend-environment/action.yaml:16-27
Timestamp: 2025-12-21T19:03:59.068Z
Learning: Composite actions (runs: using: composite) execute as steps within the calling job's context and can access the job context, including job.services.* properties (e.g., job.services.<service_id>.id, job.services.<service_id>.ports). Service containers must be defined at the job level, but a composite action's steps can reference them via the job context.

Applied to files:

  • .github/workflows/run-ci-cd.yaml
🔇 Additional comments (2)
.github/workflows/run-ci-cd.yaml (2)

625-625: LGTM! Correctly removes the custom report filename override.

The removal of -r report.html from cmd_options allows the ZAP baseline scan to use its default report naming convention, which should resolve the filename mismatch issue described in #3239. The change is consistently applied to both staging and production ZAP scan jobs.

Also applies to: 963-963


606-626: The concern raised in this review comment is not supported by how the zaproxy/action-baseline action actually works.

The zaproxy/action-baseline action automatically uploads ZAP scan reports as workflow artifacts by default (with artifact_name = "zap_scan"). There is no need for a separate explicit "Upload report" step in the workflow. The action itself handles artifact upload via the GitHub Artifacts API internally.

The current workflow configuration at lines 606-626 (staging) and 944-963 (production) is correct: it relies on the action's built-in upload capability rather than requiring a separate upload step. The absence of an explicit upload step does not mean reports aren't being uploaded—they are, via the action's default behavior.

The contradiction perceived between the AI summary mentioning a "deleted Upload report step" and the PR description stating "HTML report is uploaded successfully" does not actually exist. The PR description is accurate: reports are uploaded by the action itself, not by a separate workflow step.

Likely an incorrect or invalid review comment.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
.github/workflows/run-ci-cd.yaml (2)

941-941: Remove trailing whitespace.

Line 941 has trailing whitespace that appears unrelated to the ZAP scan fix.

🧹 Proposed fix
       - name: Run proxy deploy
         working-directory: .github/ansible
         run: ansible-playbook -i inventory.yaml production/proxy.yaml -e "github_workspace=$GITHUB_WORKSPACE"
-        
+

949-949: Remove unnecessary blank line.

The blank line at line 949 appears to be an unintentional formatting change unrelated to the fix.

🧹 Proposed fix
     runs-on: ubuntu-latest
-
     steps:
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 795f055 and 68792e9.

📒 Files selected for processing (1)
  • .github/workflows/run-ci-cd.yaml
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-12-21T19:03:59.068Z
Learnt from: ahmedxgouda
Repo: OWASP/Nest PR: 1139
File: .github/workflows/setup-backend-environment/action.yaml:16-27
Timestamp: 2025-12-21T19:03:59.068Z
Learning: Composite actions (runs: using: composite) execute as steps within the calling job's context and can access the job context, including job.services.* properties (e.g., job.services.<service_id>.id, job.services.<service_id>.ports). Service containers must be defined at the job level, but a composite action's steps can reference them via the job context.

Applied to files:

  • .github/workflows/run-ci-cd.yaml
🔇 Additional comments (2)
.github/workflows/run-ci-cd.yaml (2)

954-961: Consistency with staging configuration looks good.

The production ZAP baseline scan uses the same cmd_options as the staging scan (line 624), which ensures consistent security scanning across environments. The same verification concerns apply regarding the .zapconfig file existence and the correctness of the command options.


617-624: Configuration and options are correct. The .zapconfig file exists in the repository root with properly formatted ZAP baseline scan configuration (rule ID mappings to IGNORE/FAIL actions). The command options -a (include alpha passive scan rules) and -c .zapconfig (apply custom configuration) are both documented options for zaproxy/action-baseline and are appropriately used here.

coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 8, 2026
@nios-x
Copy link
Contributor Author

nios-x commented Jan 8, 2026

Hi @arkid15r @kasya 👋
This PR fixes the ZAP baseline scan failure caused by a report filename mismatch (ref: #3239).
The change is minimal and only aligns the workflow with the actual generated report so the artifact upload succeeds.

@arkid15r
Copy link
Collaborator

arkid15r commented Jan 8, 2026

You must use the PR template we have.

@arkid15r arkid15r marked this pull request as draft January 8, 2026 18:23
@nios-x nios-x marked this pull request as ready for review January 8, 2026 18:32
@arkid15r
Copy link
Collaborator

arkid15r commented Jan 8, 2026

You didn't run the required code quality checks. Your future issue assignment requests will be de-prioritized.

coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 8, 2026
coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 9, 2026
@nios-x
Copy link
Contributor Author

nios-x commented Jan 9, 2026

Please let me know if anything else needs adjustment.

@nios-x nios-x requested a review from arkid15r January 9, 2026 08:10
name: zap-baseline-scan-report-${{ github.run_id }}
path: report.html

path: report_html.html
Copy link
Collaborator

Choose a reason for hiding this comment

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

So your code just renamed the report file. Why do you think it'll work now if it didn't work for the same approach with just a different name?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Previously, I removed the report file generation step because I initially thought that was causing the issue.
This time, I addressed the actual root cause by properly renaming and aligning the report filename, which was mismatched between the ZAP generation step and the artifact upload step and was causing the failure.

@nios-x nios-x requested a review from arkid15r January 9, 2026 17:13
@arkid15r arkid15r enabled auto-merge January 9, 2026 19:05
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 9, 2026

@arkid15r arkid15r added this pull request to the merge queue Jan 9, 2026
Merged via the queue into OWASP:main with commit e48f9cd Jan 9, 2026
27 checks passed
hussainjamal760 pushed a commit to hussainjamal760/Nest that referenced this pull request Jan 14, 2026
…OWASP#3246)

* fix(ci): correct ZAP baseline report filename to avoid upload failure

* fix(ci): correct ZAP baseline report filename to avoid upload failure

* Update code

* fix(ci): correct ZAP baseline report filename to avoid upload failure

* Update code

---------

Co-authored-by: Arkadii Yakovets <arkadii.yakovets@owasp.org>
Co-authored-by: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ZAP baseline(CI/CD) scan fails due to report filename mismatch

2 participants