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

Use XML for Chocolatey, affects [Chocolatey Resharper PowershellGallery] #10344

Merged
merged 1 commit into from
Jul 9, 2024

Conversation

PyvesB
Copy link
Member

@PyvesB PyvesB commented Jul 9, 2024

Proposal to fix #10343.

The Chocolatey API seems to have started ignoring our "Accept": "application/atom+json,application/json" header, and sometimes now returns XML even when we're requesting JSON. The behaviour seems pretty inconsistent, changing slightly the filter parameter in the query can lead to a different format being returned. Switching to XML seems to produce stable results with all the examples I've tried.

@PyvesB PyvesB added bug Bugs in badges and the frontend service-badge New or updated service badge labels Jul 9, 2024
Copy link
Contributor

github-actions bot commented Jul 9, 2024

Warnings
⚠️ This PR modified service code for chocolatey but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for powershellgallery but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for resharper but not its test code.
That's okay so long as it's refactoring existing code.
Messages
📖 ✨ Thanks for your contribution to Shields, @PyvesB!

Generated by 🚫 dangerJS against b093aa2

@@ -20,26 +19,11 @@ function createFilter({ packageName, includePrereleases }) {
const releaseTypeFilter = includePrereleases
? 'IsAbsoluteLatestVersion eq true'
: 'IsLatestVersion eq true'
return `Id eq '${packageName}' and ${releaseTypeFilter}`
return `tolower(Id) eq '${packageName.toLowerCase()}' and ${releaseTypeFilter}`
Copy link
Member Author

Choose a reason for hiding this comment

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

Case now seems to matter on the Chocolatey API. Without this, our tests based on scriptcs fail, we'd need to use ScriptCs. I'm guessing other users may have relied on case-insensitivity in the past, so this keeps backwards compatibility.

@PyvesB PyvesB added this pull request to the merge queue Jul 9, 2024
Merged via the queue into badges:master with commit e685b1a Jul 9, 2024
24 checks passed
@PyvesB PyvesB deleted the chocolatey-xml branch July 9, 2024 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugs in badges and the frontend service-badge New or updated service badge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

chocolatey not found
2 participants