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

(#127)(ENGTASKS-3098) Use absolute paths for Dependency-Check generated reports #128

Merged

Conversation

Windos
Copy link
Member

@Windos Windos commented Nov 7, 2023

Description Of Changes

The PR uses the MakeAbsolute method to ensure that the absolute path is used by SonarQube for the HTML and JSON reports generated by Dependency-Check.

Motivation and Context

These paths are specified in the Initialise-SonarQube task prior to the reports being generated, then the working directory changes before the Finalise-SonarQube task runs. The result is that the SonarQube upload looks in the wrong path when it is time to upload the reports.

By using the absolute path for these reports, the change in working directory does not affect the report upload.

Testing

  1. Set the SonarQube environment variables:
    • SONARQUBE_URL
    • SONARQUBE_ID
    • SONARQUBE_TOKEN
  2. Patch the recipe tool with the changes from this PR
  3. Run the build:
    .\build.bat --verbosity=diagnostic --target=CI --testExecutionType=none --shouldRunAnalyze=false --shouldRunIlMerge=false --shouldObfuscateOutputAssemblies=false --shouldRunChocolatey=false --shouldRunNuGet=false --shouldRunSonarQube=true --shouldRunDependencyCheck=true
  4. See that there are no errors about the reports not being found and that they are available withing the SonarQube interface

Operating Systems Testing

N/A

Change Types Made

  • Bug fix (non-breaking change).
  • Feature / Enhancement (non-breaking change).
  • Breaking change (fix or feature that could cause existing functionality to change).
  • Documentation changes.
  • PowerShell code changes.

Change Checklist

  • Requires a change to the documentation.
  • Documentation has been updated.
  • Tests to cover my changes, have been added.
  • All new and existing tests passed?
  • PowerShell code changes: PowerShell v2 compatibility checked?

Related Issue

Fixes #127
Task ENGTASKS-3098

@Windos Windos requested a review from gep13 November 7, 2023 04:30
@pauby
Copy link
Member

pauby commented Jan 1, 2024

@gep13 Can you review this and provide feedback?

@gep13 gep13 force-pushed the GH-127/dependency-check-absolute-path branch from 25d9cd8 to 4ce3671 Compare January 4, 2024 10:06
Copy link
Member

@gep13 gep13 left a comment

Choose a reason for hiding this comment

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

LGTM!

@gep13 gep13 merged commit 4e4ec46 into chocolatey:develop Jan 4, 2024
@gep13
Copy link
Member

gep13 commented Jan 4, 2024

@Windos thanks for getting this fixed up!

@Windos Windos deleted the GH-127/dependency-check-absolute-path branch January 4, 2024 20:55
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.

SonarQube not finding Dependency-Check Reports
3 participants