Skip to content

Conversation

@timler
Copy link
Collaborator

@timler timler commented Dec 3, 2024

Description

Test a Github Actions CI workflow to build the code and run the automated tests and checks (from Code Climate and SYNK).

Type of change

  • New Feature
  • Bug Fix
  • Refactor
  • Documentation Update
  • Style
  • Performance Improvements
  • Test Update
  • Build/CI Update

Testing

  • Unit Tests Added/Updated
  • Integration Tests Added/Updated
  • Manual Testing Completed

Test Cases

  1. Run mvn clean install and viewed jacoco test coverage
  2. Test CI pipeline with this PR

Deployment Instructions (optional)

Configure the necessary secrets in your GitHub repository:

QA Instructions (optional)

Breaking Changes

  • This PR introduces breaking changes

Dependencies

Related Tickets & Documents

Part of deliverable 1.4.1

Screenshots/Recordings

TODO

Checklist

  • Code follows style guidelines
  • Self-review completed
  • Tests pass locally
  • Documentation updated
  • No new warnings generated

Additional Notes

timler and others added 21 commits December 3, 2024 13:19
Added a Github workflow to build the code and run the automated tests
and checks, including Code Climate and SYNK
Created a PR template to enforce best practises when developers and
implementers open PRs in the code. They will be prompted to fill in
details about their work and provide clear descriptions and details.

This forms part of the SDLC.
Moved the PR template into a subdirectory which allows for multiple PR
templates to be defined
This reverts commit a362861.
Moved the PR template into a subdirectory which allows for multiple PR
templates to be defined. This commit fixes the previous commit which
had to be reverted
Update the Java version used by the Github Actions from 11 to 17
Updated JaCoCo Maven plugin configuration to specify report output
directory and adjusted the Code Climate reporter command to use the
correct report path so it can upload the reports in the CI pipeline.
Define the JAVA_HOME in the Github Actions. This should resolve the
issue with the JAVA_HOME variable not being set correctly.
Export JAVA_HOME into a variable that can be used by Synk
Updated the artifacts action to use v4 instead of v3 which was
deprecated
Added debug information to help diagnose the issue with the Snyk action
which is currently failing to execute.
Using a specific environment for Snyk that matches the Maven and Java
version of the project. This should hopefully fix the issue with
JAVA_HOME that is being thrown when we try to execute Snyk checks
Attempting to use Snyk CLI instead of the predefined Github actions as
the JAVA_HOME issue with the Snyk Maven 3 JDK 17 docker container seems
to be difficult to solve.
Ensure that the build does not get aborted after the Snyk check fails
and also publish the results on the build page
Fix the warnings in Github Actions and upgrade dependencies
Added a separate pipeline for Snyk Security scanning, as set up using the Github user interface to implement code scanning under Security.
Removed Snyk from the Github Actions build as it has been added
separately into another workflow so the code can be scanned independently
of the build process.
Upload artifacts for the build output, jacoco and surefire test reports
Created separate jobs for the different parts of the CI pipeline to make
it easier to view in Github
Used ubuntu-latest and fixed bug that tried to use env variables for
runs-on which doesn't work
Decoupled the dependency of code-scan and security-scan jobs from the
build job because both use the code checkout and don't need the
compiled code. This means the jobs can run in parallal and the process
will be faster.
Fixed the issue with the code-scan job in the Github actions pipeline
which was causing it to fail.
Small changes to the Code Climate task and setup for the repo
Removed separate Snyk workflow because it makes sense to do it in one
workflow
This change will show the Snyk failure in the Github Actions workflow
otherwise it is obscured and shows that everything passed (which is
incorrect)
Added Snyk static code analysis for security vulnerabilities
This reverts commit 77e1787.
@timler
Copy link
Collaborator Author

timler commented Dec 9, 2024

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

Separated out Snyk commands so 'code test' and 'test' (which do different)
things are managed separately and two sarif reports are generated.
Change the order that the sarif file is uploaded - it should probably
be uploaded immediately after when the command is executed.
Removed the Snyk failure task because it seems non-standard also
it is currently broken
@bausmeier bausmeier added invalid This doesn't seem right and removed invalid This doesn't seem right labels Dec 10, 2024
Refactor the CI pipeline so it runs on any push to the repo and only
runs a compile and test. This will means the build runs quicker and
it saves us time on Github. A separate workflow will be defined to
do the security scanning (if it is necessary)
@bausmeier
Copy link
Member

bausmeier commented Dec 12, 2024

@timler I see that Code Climate is still not reporting a status even after I enabled the web hook. The only other thing I can think of is to close this PR and create a new one from the same branch. Maybe Code Climate needs to be triggered at the creation of the PR.

@timler timler closed this Dec 12, 2024
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.

2 participants