-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(zap): Update runs-on to ubuntu-22.04, Add retry mechanism, Modify run-ci command, Remove --wait flag #88
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #88 +/- ##
=======================================
Coverage 97.81% 97.81%
=======================================
Files 10 10
Lines 411 411
Branches 76 76
=======================================
Hits 402 402
Misses 9 9 ☔ View full report in Codecov by Sentry. |
Reviewer's Guide by SourceryThis pull request updates the ZAP scan workflow and the justfile to ensure the web application starts correctly before running the ZAP scan. The changes include modifying the GitHub Actions workflow to wait for the web application to be ready and updating the justfile to remove the --wait flag from the docker-compose command. File-Level Changes
Tips
|
Here's the code health analysis summary for commits Analysis Summary
Code Coverage Report
|
PR Review 🔍
|
WalkthroughThe recent updates focus on enhancing the Changes
Sequence Diagram(s) (Beta)sequenceDiagram
participant Developer
participant GitHub Actions
participant Web Application
participant ZAP Scanner
Developer->>+GitHub Actions: Push to `feat/fix-zap-tests`
GitHub Actions->>+Web Application: Start application
loop Retry 5 times
GitHub Actions->>Web Application: Check if started
Web Application-->>GitHub Actions: Response
end
GitHub Actions->>+ZAP Scanner: Run ZAP scan
ZAP Scanner-->>GitHub Actions: Scan results
GitHub Actions-->>Developer: CI/CD pipeline results
TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
PR Code Suggestions ✨
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @manoelhc - I've reviewed your changes and found some issues that need to be addressed.
Blocking issues:
- Removal of '--wait' flag might cause race conditions (link)
Here's what I looked at during the review
- 🔴 General issues: 1 blocking issue, 1 other issue
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.
run-ci: build | ||
docker-compose up -d --wait | ||
run-ci: | ||
docker-compose up -d |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (bug_risk): Removal of '--wait' flag might cause race conditions
The '--wait' flag ensures that the services are fully started before proceeding. Removing this flag might cause race conditions where subsequent steps run before the services are ready. Consider re-adding the '--wait' flag or implementing an alternative waiting mechanism.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Github's docker-compose doesn't support --wait
flag.
Tag |
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesCodacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more |
There was a problem hiding this 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
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (2)
- .github/workflows/zap-scanner.yaml (1 hunks)
- justfile (1 hunks)
Files skipped from review due to trivial changes (1)
- justfile
Additional comments not posted (2)
.github/workflows/zap-scanner.yaml (2)
5-5
: Branch trigger updated tofeat/fix-zap-tests
.This change ensures that the workflow only runs on the specific feature branch, which is a good practice for testing new features without affecting the main branch.
10-10
: Operating system updated toubuntu-22.04
.Specifying a fixed OS version can lead to more predictable builds. Please ensure that all dependencies and tools used in the workflow are compatible with Ubuntu 22.04.
There was a problem hiding this 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
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- .github/workflows/zap-scanner.yaml (1 hunks)
Additional comments not posted (2)
.github/workflows/zap-scanner.yaml (2)
5-5
: Branch trigger updated tofeat/fix-zap-tests
.
10-10
: Operating system updated toubuntu-22.04
.
|
There was a problem hiding this 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
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- .github/workflows/zap-scanner.yaml (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- .github/workflows/zap-scanner.yaml
Description
runs-on
value toubuntu-22.04
in the.github/workflows/zap-scanner.yaml
file.github/workflows/zap-scanner.yaml
filerun-ci
command in theZAP Scan
job to remove the--wait
flag in the.github/workflows/zap-scanner.yaml
file--wait
flag from therun-ci
command in thejustfile
Changes walkthrough 📝
zap-scanner.yaml
Updated runs-on to ubuntu-22.04, Added retry mechanism, Modified
run-ci command
.github/workflows/zap-scanner.yaml
['Updated the
runs-on
value toubuntu-22.04
', 'Added a retry mechanism to wait for the web application to start before running ZAP scan', 'Modified therun-ci
command in theZAP Scan
job to remove the--wait
flag']justfile
Removed --wait flag from run-ci command
justfile
['Removed the
--wait
flag from therun-ci
command']Summary by Sourcery
This pull request updates the ZAP Scan GitHub Action workflow to run on a specific feature branch, changes the runner to 'ubuntu-22.04', and adds a step to ensure the web application is running before starting the ZAP scan. Additionally, it modifies the 'justfile' to remove the '--wait' flag from the 'docker-compose up' command in the 'run-ci' task.
Summary by CodeRabbit
ubuntu-22.04
for better compatibility.