fix: remove 100 tag limit by implementing pagination#69
Open
hughesjs wants to merge 1 commit intoietf-tools:mainfrom
Open
fix: remove 100 tag limit by implementing pagination#69hughesjs wants to merge 1 commit intoietf-tools:mainfrom
hughesjs wants to merge 1 commit intoietf-tools:mainfrom
Conversation
The previous implementation limited maxTagsToFetch to 100, silently resetting to 10 if a higher value was specified. This caused CI failures for repositories with more than 100 tags. This fix: - Removes the arbitrary > 100 cap that reset maxTagsToFetch to 10 - Implements cursor-based pagination for the GraphQL tag query - Fetches tags in batches of up to 100 (GitHub API limit) until the requested number is reached or no more tags exist Fixes ietf-tools#44
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes the arbitrary 100 tag limit issue described in #44.
Problem
The current implementation silently resets
maxTagsToFetchto 10 if a value greater than 100 is specified:This causes CI failures for repositories with more than 100 tags, as the action cannot find the correct semver tag within the first 10 results.
Solution
> 100cap that was resetting the value to 10Changes
index.js: Removed the> 100check and wrapped the GraphQL query in a pagination loopdist/index.js: Rebuilt withnpm run buildBackwards Compatibility
This change is fully backwards compatible:
Test Evidence
A dedicated test repository demonstrates this issue in action:
Repository: hughesjs/semver-action-test
Test Case 1: Basic (12 tags)
Demonstrates the issue with
v1.0.0at position 12.v1.0.0Test Case 2: Full Pagination (150 tags)
Proves the fix works with pagination across multiple pages -
v1.0.0at position 150.v1.0.0The tests use annotated tags with controlled tagger dates to ensure deterministic tag ordering in the API response.
Fixes #44