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: rename the Attempts
field to Attempt
; expose in gh run view
and gh run ls
#8905
Conversation
Hi! Thanks for the pull request. Please ensure that this change is linked to an issue by mentioning an issue number in the description of the pull request. If this pull request would close the issue, please put the word 'Fixes' before the issue number somewhere in the pull request body. If this is a tiny change like fixing a typo, feel free to ignore this message. |
@cawfeecake : While we appreciate contributors improving the GitHub CLI, could you create an issue that we might discuss this need outside of the PR? |
@@ -97,7 +98,7 @@ type Run struct { | |||
workflowName string // cache column | |||
WorkflowID int64 `json:"workflow_id"` | |||
Number int64 `json:"run_number"` | |||
Attempts uint64 `json:"run_attempt"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm genuinely surprised there is no other code that uses this field since it was added in #5945 🤯
That said, how should test cases within the following be updated to ensure this is being exported?
cli/pkg/cmd/run/shared/shared_test.go
Line 111 in ed5690c
func TestRunExportData(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm genuinely surprised there is no other code that uses this field since it was added in #5945 🤯
I also went down this rabbit hole like gahhh. It's funny because it was even updated to use uint64
instead of 8 bits because it was causing an unmarshal error even tho it was never useeeeeed.
@cawfeecake please create an issue that describes your use case for this field to help us understand the motivation. It's very useful for us and the rest of the community to see what outcomes people are using the CLI for. |
run_attempt
field (as attempt
) when getting a workflow runAttempts
field to Attempt
; expose in gh run view
and gh run ls
apologies for the delay. created issue and updated the PR info to align |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before
➜ gh run ls --json attempt
Unknown JSON field: "attempt"
Available fields:
conclusion
createdAt
databaseId
displayTitle
event
headBranch
headSha
name
number
startedAt
status
updatedAt
url
workflowDatabaseId
workflowName
After
➜ ./bin/gh run ls --json attempt | cat
[{"attempt":1},{"attempt":1},{"attempt":1},{"attempt":1},{"attempt":1},{"attempt":1},{"attempt":1},{"attempt":1},{"attempt":1},{"attempt":1},{"attempt":1},{"attempt":1},{"attempt":1},{"attempt":1},{"attempt":1},{"attempt":1},{"attempt":1},{"attempt":1},{"attempt":1},{"attempt":1}]
I added a test as well, though it only covers ExportData
working correctly, and not that you can actually pass this field to gh run ls
or gh run view
.
Thanks for your work here @cawfeecake ! |
Fixes #9099