Skip to content
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

Add dashboard and reports #607

Open
2 of 9 tasks
binkley opened this issue Aug 8, 2024 · 2 comments
Open
2 of 9 tasks

Add dashboard and reports #607

binkley opened this issue Aug 8, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request reporting Things about badges, GH action pages, dashboards, etc

Comments

@binkley
Copy link
Owner

binkley commented Aug 8, 2024

This card broken out from #506.
Related to #457.

  • Saving reports as artifacts for each CI run
  • Add aggregate dashboard across reports

Current plugins needing configuration, and YML build needs to save more artifacts and/or reports for Action runs:

  • DependencyCheck -- available in Gradle as build/reports/dependency-check-report.html and for Maven as target/dependency-check-report.html
  • Snyk security -- external web site, not part of the build: should we fetch a Snyk report?
  • Unit test/coverage -- already on the CI build run pages for Gradle and Maven
  • Pit Test -- available in Gradle under build/reports/pitest and in Maven under target/pit-reports
  • Checkstyle -- available in Gradle under build/reports/checkstyle: Maven needs to run "reporting" to generate HTML?
  • Spotbugs -- availabe in Gradle under build/reports/spotbugs and for Maven as target/spotbugs.html
  • PMD (bugs) -- available for Gradle under build/reports/pmd and for Maven under target/site/pmd.html (production only)
  • CPD (copy/paste detector -- part of PMD) -- available for Maven under target/site/cpd.html; the Gradle plugin does not support
  • Javadocs -- already saving artifacts for CI build runs for Gradle and Maven

The general pattern for plugin reports:

  1. Are reports HTML?
    This this the key goal.
  2. Are reports available as SARIF or XML (or other formats such as JSON)?
    Add these for flexibility with integration to other tools and dashboards.
  3. Does the tool generate a directory?
    Then save the directory during CI build to create a ZIP artifact.
  4. Does the tool generate just files?
    Then save the files directly during CI builds as artifacts.

Existing reports as artifacts

We are getting a JaCoCo coverage summary for free on Action runs from the coverage badge generator:
image

We have some reports being saved already as CI build artifacts:
image

@binkley binkley added the enhancement New feature or request label Aug 8, 2024
@binkley binkley self-assigned this Aug 8, 2024
binkley added a commit that referenced this issue Aug 8, 2024
binkley added a commit that referenced this issue Aug 8, 2024
binkley added a commit that referenced this issue Aug 8, 2024
binkley added a commit that referenced this issue Aug 9, 2024
binkley added a commit that referenced this issue Aug 9, 2024
@binkley binkley added the reporting Things about badges, GH action pages, dashboards, etc label Aug 9, 2024
binkley added a commit that referenced this issue Aug 10, 2024
binkley added a commit that referenced this issue Aug 10, 2024
@binkley
Copy link
Owner Author

binkley commented Aug 10, 2024

As part of this card, I updated Earthfile to save all "locally" build output for Gradle and Maven (build/ and target/ directories, respectively). This avoids needing to edit multiple files for a simple change. An example is adding more reporting artifacts to GitHub actions (such as Javadocs).
Without this change, you need to whitelist what files are copied from inside the Earthly build container, and also update GitHub actions to save these artifacts:

  1. Just edit the GitHub action to save a particular artifact for the run to show in the GitHub page of a particular build.
  2. Locally, a containerized build updates your local build/ and target/ directories just as would a local direct build with ./gradlew or ./mvnw.

Internally, GitHub actions calling Earthly are a "container within a container". So you should trust GitHub actions that you selected, and avoid adding a 2nd layer of configuration between the two containers.
We do this by having Earthfile call SAVE ARTIFACT for the complete build/ and target/ directories, and only the CI Yaml files need to pick/choose what to save as artifacts, or to reuse in actions.
Previously, you'd have to configure each saved file twice: once in Earthfile and a 2nd time in the GitHub action.

@binkley
Copy link
Owner Author

binkley commented Aug 10, 2024

Latest GitHub artifacts for the Gradle build on branch gradle-coverage-report:
Image

binkley added a commit that referenced this issue Aug 10, 2024
binkley added a commit that referenced this issue Aug 12, 2024
This is to avoid conflicts between the Gradle and Maven build both
writing the same badge.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request reporting Things about badges, GH action pages, dashboards, etc
Projects
Status: In progress
Development

No branches or pull requests

1 participant