Skip to content

feat(vulnerabilities): set, maintain and expose vulnerabilitySeverity for templated fields - #21939

Merged
JamieMagee merged 22 commits into
renovatebot:mainfrom
setchy:feature/osv-severity
May 11, 2023
Merged

feat(vulnerabilities): set, maintain and expose vulnerabilitySeverity for templated fields#21939
JamieMagee merged 22 commits into
renovatebot:mainfrom
setchy:feature/osv-severity

Conversation

@setchy

@setchy setchy commented May 2, 2023

Copy link
Copy Markdown
Collaborator

Changes

Set vulnerabilitySeverity for package rules, maintain the highest rating for the update group and expose for use in any template-eligible fields, such as commitMessageSuffix.

Demonstration repository: https://github.com/setchy/renovate-demo-osv-severity

Context

#21937

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

@setchy
setchy marked this pull request as draft May 2, 2023 21:14
@setchy setchy changed the title DRAFT feat(vulnerabilities): optional flag to include severity in commitMessageSuffix feat(vulnerabilities): optional flag to include severity in commitMessageSuffix May 2, 2023
Comment thread lib/config/options/index.ts Outdated
Comment thread lib/config/options/index.ts Outdated
Comment thread lib/config/types.ts
Comment thread lib/workers/repository/process/vulnerabilities.ts Outdated
@setchy

setchy commented May 3, 2023

Copy link
Copy Markdown
Collaborator Author

Update to draft PR pushed that addresses #21937 (comment) from @Churro, albeit in a somewhat hacky method

@setchy

setchy commented May 3, 2023

Copy link
Copy Markdown
Collaborator Author

Demonstration repository also created - https://github.com/setchy/renovate-demo-osv-severity

@setchy setchy changed the title feat(vulnerabilities): optional flag to include severity in commitMessageSuffix feat(vulnerabilities): surface highestVulnerabilitySeverity for use in templated fields May 3, 2023
@setchy setchy changed the title feat(vulnerabilities): surface highestVulnerabilitySeverity for use in templated fields feat(vulnerabilities): set highestVulnerabilitySeverity for use in templated fields May 3, 2023
@setchy
setchy marked this pull request as ready for review May 3, 2023 16:51
@setchy

setchy commented May 3, 2023

Copy link
Copy Markdown
Collaborator Author

An alternate name to highestVulnerabilitySeverity might be aggregateVulnerabilitySeverity. Also open to other suggestions

@Churro

Churro commented May 3, 2023

Copy link
Copy Markdown
Collaborator

Update to draft PR pushed that addresses #21937 (comment) from @Churro, albeit in a somewhat hacky method

Probably that was a misunderstanding but I didn't intend to recommend the implementation a hacky solution in my comment. I'm convinced there is a more elegant way to implement this in renovate but, personally, I'd rather spend longer tinkering with a nicer solution than implementing this with a crowbar.

@setchy

setchy commented May 3, 2023

Copy link
Copy Markdown
Collaborator Author

Update to draft PR pushed that addresses #21937 (comment) from @Churro, albeit in a somewhat hacky method

Probably that was a misunderstanding but I didn't intend to recommend the implementation a hacky solution in my comment. I'm convinced there is a more elegant way to implement this in renovate but, personally, I'd rather spend longer tinkering with a nicer solution than implementing this with a crowbar.

I was only referring to the multiple vulnerabilities piece you pointed out. was not suggesting you recommended this method of implementation - sorry if it came across that way. 😄

as always, absolutely happy to iterate on these PRs to find the best solution. I did spend a few hours this morning trying to find the "right place" before flattening etc occurs, but need further input.

@setchy setchy changed the title feat(vulnerabilities): set highestVulnerabilitySeverity for use in templated fields feat(vulnerabilities): maintain highest vulnerabilitySeverity for updates and expose to templated fields May 8, 2023
@setchy setchy changed the title feat(vulnerabilities): maintain highest vulnerabilitySeverity for updates and expose to templated fields feat(vulnerabilities): set, maintain and expose vulnerabilitySeverity for templated fields May 8, 2023
@setchy
setchy requested a review from Churro May 8, 2023 15:23
@setchy

setchy commented May 8, 2023

Copy link
Copy Markdown
Collaborator Author

Reworked the implementation this morning. Removed the crowbar approach 😅

Feedback of course welcomed.

Demo repo updated: https://github.com/setchy/renovate-demo-osv-severity/pulls

Comment thread lib/config/index.spec.ts Outdated
Comment thread lib/util/vulnerability/utils.spec.ts Outdated
Comment thread lib/util/vulnerability/utils.ts Outdated
Comment thread lib/workers/repository/process/vulnerabilities.ts
Comment thread lib/workers/repository/process/vulnerabilities.ts
Comment thread lib/workers/repository/process/vulnerabilities.ts Outdated
@setchy
setchy requested a review from viceice May 9, 2023 01:37
@viceice
viceice requested a review from JamieMagee May 9, 2023 13:41
Comment thread lib/util/vulnerability/utils.ts Outdated
Comment thread lib/util/vulnerability/utils.ts Outdated
@setchy
setchy requested a review from JamieMagee May 9, 2023 19:01
JamieMagee
JamieMagee previously approved these changes May 9, 2023
Comment thread lib/util/template/index.ts Outdated
@JamieMagee
JamieMagee added this pull request to the merge queue May 11, 2023
Merged via the queue into renovatebot:main with commit a2e036e May 11, 2023
@renovate-release

Copy link
Copy Markdown

🎉 This PR is included in version 35.80.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@setchy
setchy deleted the feature/osv-severity branch May 13, 2023 16:02
mjunker pushed a commit to mjunker/renovate that referenced this pull request May 17, 2023
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jun 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants