feat(pr): add changeType field to files JSON output#12657
Merged
Conversation
5192ddb to
befb35d
Compare
Contributor
Author
58cdd56 to
70ebb4d
Compare
Contributor
Author
|
bumping this as well — pretty small change, adds changeType to the files JSON output. let me know if there's anything blocking review. |
Add the changeType field from the PullRequestChangedFile GraphQL type to the PullRequestFile struct. This exposes the file status (added, modified, deleted, renamed, copied, changed) in gh pr list --json files and gh pr view --json files output. Closes cli#11385
70ebb4d to
de61b2b
Compare
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.
Adds the
changeTypefield to thefilesJSON output forgh pr listandgh pr view.This exposes the file's patch status (
ADDED,MODIFIED,DELETED,RENAMED,COPIED,CHANGED) which was already available in the GraphQL API but not surfaced in the CLI output.Before:
{ "files": [ { "path": "docs/readme.md", "additions": 1, "deletions": 1 } ] }After:
{ "files": [ { "path": "docs/readme.md", "additions": 1, "deletions": 1, "changeType": "MODIFIED" } ] }Changes:
ChangeTypefield toPullRequestFilestruct (api/queries_pr.go)changeTypeto the GraphQL files query (api/query_builder.go)Closes #11385