Skip to content

Conversation

@josephadamsdev
Copy link

Summary

Add an optional include_release_date query param to the WinGet version badge to append the manifest ReleaseDate (when available).

Related Issue

Fixes #11285

Testing

  • npx eslint services/winget/winget-version.service.js services/winget/winget-version.tester.js

Unable to run npm run test:services locally because this environment blocks binding to localhost ports.

Contribution by Gittensor, see my contribution statistics at https://gittensor.io/miners/details?githubId=105917501

@github-actions
Copy link
Contributor

github-actions bot commented Jan 7, 2026

Messages
📖 ✨ Thanks for your contribution to Shields, @josephadamsdev!

Generated by 🚫 dangerJS against 24f8497

@josephadamsdev
Copy link
Author

josephadamsdev commented Jan 8, 2026

@theflow would you review this PR?

@PyvesB
Copy link
Member

PyvesB commented Jan 10, 2026

Hello @josephadamsdev 👋🏻

Thanks for looking into this. Our badges generally perform a single upstream API request underneath the hood.

  • We've got tight constraints when it comes to latency. Many of our badges are rendered on GitHub, and GitHub's Camo proxy imposes a strict timeout above which the badge will render as a broken image. Performing more API requests means things will take more time, increasing the likelihood of hitting said timeout. Some random examples I tried locally took close to 3 seconds with the new include_release_date parameter, which is getting really close to Camo's timeout.
  • We've got tight constraints when it comes to API rate limits, especially as Shields.io becomes more popular over time. A quick search through our issues will highlight that this is a regular problem we need to deal with across a bunch of services. Having a single badge consume multiple API calls from a token's quota will make things worse.
  • We've short on maintainers for a project as big as Shields.io. This PR seems to add quite a bit of complexity with the new manifest API calls, we're careful about what extra maintenance overhead we're willing to take on.

Is there no way to retrieve the version number and its release date in a single API call to GitHub?

Address performance concerns raised in PR review by reducing API calls
from N+1 to 2 requests total.

Previous implementation:
- Made 1 GraphQL call to get version directories
- Made 1 additional GraphQL call PER manifest file to check for ReleaseDate
- Could result in 3-5+ API calls for packages with multiple manifest files
- Response times approaching 3 seconds

Optimized implementation:
- Make 1 GraphQL call to get version directories
- Make 1 GraphQL call to fetch ALL manifest files at once
- Parse files in memory to find ReleaseDate
- Total: 2 API calls regardless of manifest count
- Expected to reduce response time by 50%+ for release date badges

Changes:
- Replace fetchManifestText() with fetchAllManifests() that fetches entire
  directory in single GraphQL query
- Update multiManifestSchema to handle array of blob entries with text
- Update test to match new response format
- Remove unused manifestSchema

I addressesed the maintainer's concern about API rate limits and
response time approaching GitHub's Camo proxy timeout threshold.
@josephadamsdev
Copy link
Author

josephadamsdev commented Jan 10, 2026

@PyvesB Thanks for the feedback I've addressed the performance and rate limiting concerns.

What Changed

I've optimized the implementation to reduce API calls from N+1 to exactly 2 total requests:

Before:

  • 1 GraphQL call to get version directories
  • 1 additional call per manifest file to check for ReleaseDate (typically 3-5 files)
  • Total: 4-6+ API calls per badge request

After:

  • 1 GraphQL call to get version directories
  • 1 GraphQL call to fetch all manifest files at once
  • Total: 2 API calls regardless of manifest count

Implementation Details

The new fetchAllManifests() method uses GraphQL to fetch the entire manifest directory as a tree with blob text content in one request, then iterates through the files in memory to find the ReleaseDate field.

Testing

All 5 unit tests passing, including the release date test that validates the optimization works correctly.

This should address your concerns about Camo timeout threshold and rate limit constraints. Let me know if you'd like me to make any additional improvements

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

WinGet Service: add ReleaseDate

2 participants