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

Fix bug around handling security advisories with 100 or more affected packages #9279

Merged
merged 1 commit into from
Oct 19, 2022

Conversation

joelverhagen
Copy link
Member

The original implementation used a securityAdvisory(databaseId) query which no longer exists. This switches to using GHSA ID as the parameter.

Fixes https://github.com/NuGet/Engineering/issues/4619.

… packages

The original implementation used a securityAdvisory(databaseId) query which no longer exists. This switches to using GHSA ID as the parameter.
@joelverhagen joelverhagen requested a review from a team as a code owner October 19, 2022 17:10
type
value
}
securityAdvisory(ghsaId: " + JsonConvert.SerializeObject(advisory.GhsaId) + @") {
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason we're not directly using string interpolation and have to pass the value to SerializeObject?

Copy link
Member Author

Choose a reason for hiding this comment

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

If we use string interpolation, we'll need to escape the curly brackets which are part of the GraphQL query. So, either string concatenation with no curly escaping, or string interpolation with curly escaping. I think the string concatenation is a bit more readable.

Copy link
Contributor

@drewgillies drewgillies left a comment

Choose a reason for hiding this comment

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

Love that "query = not great" error. :)

@joelverhagen joelverhagen merged commit 61e0169 into main Oct 19, 2022
@joelverhagen joelverhagen deleted the jver-ghsa branch October 19, 2022 23:16
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.

4 participants