Fix logs command parameter naming confusion in pagination function#2049
Merged
Fix logs command parameter naming confusion in pagination function#2049
Conversation
The listWorkflowRunsWithPagination function had a confusing parameter name 'count' which was actually used as the batch size limit for the GitHub CLI API call. This was confusing because: - The user's -c flag means "total matching runs to find" - The 'count' parameter in listWorkflowRunsWithPagination meant "batch size per API call" Fixed by renaming the parameter to 'limit' to clarify it represents the API batch size (passed to gh run list --limit), not the total number of matching runs. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix count argument logic in logs command
Fix logs command parameter naming confusion in pagination function
Oct 21, 2025
pelikhan
reviewed
Oct 21, 2025
LOGS_COUNT_FIX.md
Outdated
| @@ -0,0 +1,76 @@ | |||
| # Fix: Logs Command Count Parameter Confusion | |||
Contributor
Author
There was a problem hiding this comment.
Deleted in commit 3f8e8d1
Contributor
|
Agentic Changeset Generator triggered by this pull request. |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
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.
Problem
The
listWorkflowRunsWithPaginationfunction had a confusing parameter name that obscured the algorithm's behavior. The parameter was namedcount, which suggested it represented the total number of matching runs the user wants to find (from the-cflag). However, it was actually used as the batch size for GitHub CLI API calls.This created ambiguity between two distinct concepts:
-cflag): Total number of matching workflow runs to findgh run listcallBefore
When
batchSize(100 or 250) was passed as thecountparameter, it was unclear whether it represented the user's desired total or the API batch size.Solution
Renamed the parameter from
counttolimitto clearly indicate its purpose as the API batch size:Algorithm Behavior
When a user runs
./gh-aw logs -c 10:len(processedRuns) >= 10(the user's count)listWorkflowRunsWithPagination(workflowName, batchSize, ...)batchSize(100 or 250) becomes thelimitparameter →gh run list --limit 100maxDownloads = count - len(processedRuns)runs from each batchChanges
pkg/cli/logs.go: Renamed parameter and enhanced documentationpkg/cli/logs_filtering_test.go: Added test documenting parameter semanticsThis clarification makes the code more maintainable and ensures the algorithm correctly distinguishes between the user's total desired matching runs and the API batch size per request.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.