Skip to content

docs: update documentation for Gradle plugin#7143

Merged
jeremylong merged 1 commit intodependency-check:mainfrom
tylervz:updateDocs
Nov 12, 2024
Merged

docs: update documentation for Gradle plugin#7143
jeremylong merged 1 commit intodependency-check:mainfrom
tylervz:updateDocs

Conversation

@tylervz
Copy link
Copy Markdown
Contributor

@tylervz tylervz commented Nov 7, 2024

Fixes Issue

Description of Change

Update the "Example" and "Advanced Configuration" sections of the Gradle plugin documentation to use non-deprecated code samples.

Using a closure to configure proxy or data is now deprecated:

https://github.com/dependency-check/dependency-check-gradle/blob/aaab86c7fa26a855a625999df24d6907f088ce85/src/main/groovy/org/owasp/dependencycheck/gradle/extension/DependencyCheckExtension.groovy#L229-L232

https://github.com/dependency-check/dependency-check-gradle/blob/aaab86c7fa26a855a625999df24d6907f088ce85/src/main/groovy/org/owasp/dependencycheck/gradle/extension/DependencyCheckExtension.groovy#L328-L337

When adding this plugin to a project today, I noticed that a code snippet in my build.gradle, similar to examples in the documentation, was highlighted in IntelliJ as being deprecated. I'm not super well versed in Gradle, but I was able to quickly find a fix which works for configuring the DependencyCheckExtension and does not rely on using a closure.

I don't know what the best way to update the analyzers code sample in the configuration-aggregate documentation would be, though:

https://github.com/jeremylong/DependencyCheck/blob/531743481768dd089f3f354284f8fd5495de77cf/src/site/markdown/dependency-check-gradle/configuration-aggregate.md?plain=1#L193-L206

https://github.com/dependency-check/dependency-check-gradle/blob/aaab86c7fa26a855a625999df24d6907f088ce85/src/main/groovy/org/owasp/dependencycheck/gradle/extension/DependencyCheckExtension.groovy#L307-L316

I feel like there's a better way to do it than the code below, so I did not include a change for this in my pull request. If anyone has suggestions on how to best write this configuration without using a closure, I'd love to hear your suggestions!

dependencyCheck {
    analyzers.assemblyEnabled=false
    analyzers.artifactory.enabled=true
    analyzers.artifactory.url='https://internal.artifactory.url'
    analyzers.retirejs.filters = ['(i)copyright Jeremy Long']
}

Have test cases been added to cover the new functionality?

no Because new functionality has not been added.

@boring-cyborg boring-cyborg Bot added the documentation site documentation label Nov 7, 2024
@tylervz tylervz changed the title Update documentation for the Gradle plugin docs: update documentation for Gradle plugin Nov 7, 2024
jeremylong
jeremylong previously approved these changes Nov 8, 2024
Copy link
Copy Markdown
Collaborator

@jeremylong jeremylong left a comment

Choose a reason for hiding this comment

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

LGTM

@tylervz
Copy link
Copy Markdown
Contributor Author

tylervz commented Nov 8, 2024

@jeremylong does that mean you would like me to update my pull request by changing the analyzers code sample in the configuration-aggregate documentation like so?

dependencyCheck {
    analyzers.assemblyEnabled=false
    analyzers.artifactory.enabled=true
    analyzers.artifactory.url='https://internal.artifactory.url'
    analyzers.retirejs.filters = ['(i)copyright Jeremy Long']
}

@jeremylong
Copy link
Copy Markdown
Collaborator

I'm ambivalent regarding the way this is documented. If the example works and doesn't produce warnings about deprecated functions - I'm good. How this is done is a matter of style and different teams will have different opinions. I'm not sure if there is any official preference/style guide for gradle.

@jeremylong jeremylong merged commit a20b0cd into dependency-check:main Nov 12, 2024
@jeremylong jeremylong added this to the 11.1.1 milestone Nov 12, 2024
@tylervz tylervz deleted the updateDocs branch November 12, 2024 21:13
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Dec 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

documentation site documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants