Closed manoelhc closed 1 month ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 97.81%. Comparing base (
cb8fa08
) to head (cfa2159
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
This 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.
Files | Changes |
---|---|
.github/workflows/zap-scanner.yaml justfile |
Updated the ZAP scan workflow and justfile to ensure the web application starts correctly before running the ZAP scan. |
Here's the code health analysis summary for commits cb8fa08..cfa2159
. View details on DeepSource β.
Analyzer | Status | Summary | Link |
---|---|---|---|
β Success | View Check β | ||
β Success | View Check β |
Metric | Aggregate | Python |
---|---|---|
Branch Coverage | 87.9% | 87.9% |
Condition Coverage | 87.9% | 87.9% |
Composite Coverage | 96.2% | 96.2% |
Line Coverage | 97.5% | 97.5% |
π‘ If youβre a repository administrator, you can configure the quality gates from the settings.
β±οΈ Estimated effort to review [1-5] | 2, because the changes are straightforward and well-documented in the description. |
π§ͺ Relevant tests | No |
β‘ Possible issues | None |
π Security concerns | No |
The recent updates focus on enhancing the .github/workflows/zap-scanner.yaml
file to improve the ZAP scanning process. Key changes include altering the branch trigger, updating the operating system to ubuntu-22.04
, and adding a script to ensure the web application starts before running the ZAP scan. Additionally, the justfile
has been modified to streamline the run-ci
command by removing the --wait
option from docker-compose up
.
File | Change Summary |
---|---|
.github/workflows/zap-scanner.yaml |
Changed branch trigger from main to feat/fix-zap-tests , updated OS to ubuntu-22.04 , added script to wait for web app |
.github/workflows/zap-scanner.yaml |
Changed OS to ubuntu-22.04 , added script to wait for web app using curl --retry |
justfile |
Removed --wait option from docker-compose up in run-ci command |
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
Category | Suggestion | Score |
Best practice |
Improve the run-ci command by adding a timeout and a more descriptive failure message___ **Consider improving the retry mechanism by adding a timeout and a more informative messagein the run-ci command.** [.github/workflows/zap-scanner.yaml [17-24]](https://github.com/manoelhc/test-actions/pull/88/files#diff-19112397a9c861b0f3d264cfbc9d122ada19a58c894eb11ae0c4a1c770ab9cc7R17-R24) ```diff + for i in {1..5}; do + sleep 5 -+ curl -s -o /dev/null -w "%{http_code}" http://localhost:8443/ && exit 0 ++ response_code=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:8443) ++ if [ $response_code -eq 200 ]; then ++ exit 0 ++ fi + done -+ exit 1 ++ echo "Web application did not start successfully after multiple retries." && exit 1 ``` Suggestion importance[1-10]: 8Why: The suggestion enhances the reliability of the retry mechanism in the run-ci command by introducing a timeout and a more informative failure message. | 8 |
Maintainability |
Remove the --wait flag from the run-ci command to align with the workflow changes___ **Update the run-ci command to remove the --wait flag and align it with the changes made inthe workflow file.** [justfile [54-55]](https://github.com/manoelhc/test-actions/pull/88/files#diff-deb9bb56fb122db0b605aa5b63f95a4665c905b18dd670e1fa6c877576a94ff1R54-R55) ```diff ++run-ci: ++ docker-compose up -d - ``` Suggestion importance[1-10]: 5Why: The suggestion aims to maintain consistency between the workflow file and the run-ci command by removing the --wait flag. | 5 |
Tag v0.13.1
(branch: main
, SHA: a06b5fa
) Added.
Coverage variation | Diff coverage |
---|---|
:white_check_mark: +0.00% (target: -1.00%) | :white_check_mark: β |
Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
No data about Coverage
No data about Duplication
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 to `ubuntu-22.04`', 'Added a retry mechanism to wait for the web application to start before running ZAP scan', 'Modified the `run-ci` command in the `ZAP Scan` job to remove the `--wait` flag']
justfile
Removed --wait flag from run-ci command
justfile ['Removed the `--wait` flag from the `run-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.