Skip to content
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

feat: add support for stateReason in gh pr view #9080

Merged
merged 3 commits into from
May 21, 2024
Merged

Conversation

nobe4
Copy link
Contributor

@nobe4 nobe4 commented May 14, 2024

Also extract the fields only available in issues into a variable for better discoverability.

Fixes #8782

Also extract the fields only available in issues into a variable for
better discoverability.
@nobe4 nobe4 requested a review from a team as a code owner May 14, 2024 06:39
@nobe4 nobe4 requested a review from williammartin May 14, 2024 06:39
@cliAutomation cliAutomation added the external pull request originating outside of the CLI core team label May 14, 2024
@cliAutomation cliAutomation added this to Needs review 🤔 in The GitHub CLI May 14, 2024
@nobe4 nobe4 self-assigned this May 14, 2024
Copy link
Member

@williammartin williammartin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm approving this but I'd like to see my comment addressed.

api/query_builder.go Show resolved Hide resolved
@@ -298,6 +299,12 @@ var PullRequestFields = append(IssueFields,
"statusCheckRollup",
)

// Some fields are only valid in the context of issues.
var IssueOnlyFields = []string{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this needs to be exported but otherwise I'm happy with the change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch, will make private

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

implemented in 9823fcc

@williammartin
Copy link
Member

➜  ./bin/gh issue view 9084 --json state,stateReason | cat
{"state":"CLOSED","stateReason":"COMPLETED"}

LGTM

@williammartin williammartin merged commit 140edf7 into trunk May 21, 2024
16 checks passed
@williammartin williammartin deleted the issue_stateReason branch May 21, 2024 17:54
Copy link

@Mustafakara1199 Mustafakara1199 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

izumin5210 pushed a commit to izumin5210/dotfiles that referenced this pull request Jun 2, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [cli/cli](https://togithub.com/cli/cli) | minor | `v2.49.2` ->
`v2.50.0` |

---

### Release Notes

<details>
<summary>cli/cli (cli/cli)</summary>

### [`v2.50.0`](https://togithub.com/cli/cli/releases/tag/v2.50.0):
GitHub CLI 2.50.0

[Compare Source](https://togithub.com/cli/cli/compare/v2.49.2...v2.50.0)

#### What's Changed

- Refactor git credential flow code by
[@&#8203;williammartin](https://togithub.com/williammartin) in
[cli/cli#9089
- feat: add json output for `gh pr checks` by
[@&#8203;nobe4](https://togithub.com/nobe4) in
[cli/cli#9079
- Rework first auth tests with new gitcredential abstractions by
[@&#8203;williammartin](https://togithub.com/williammartin) in
[cli/cli#9095
- list the various alias permutations for the command and subcommands,
via '--help' and 'gh reference' by
[@&#8203;gabemontero](https://togithub.com/gabemontero) in
[cli/cli#8824
- Removed tty message when checking for extension upgrades by
[@&#8203;leevic31](https://togithub.com/leevic31) in
[cli/cli#9088
- Fix doc bug for gh run watch by
[@&#8203;jasonodonnell](https://togithub.com/jasonodonnell) in
[cli/cli#9052
- feat: add support for stateReason in `gh pr view` by
[@&#8203;nobe4](https://togithub.com/nobe4) in
[cli/cli#9080
- fix: rename the `Attempts` field to `Attempt`; expose in `gh run view`
and `gh run ls` by [@&#8203;cawfeecake](https://togithub.com/cawfeecake)
in
[cli/cli#8905
- Update regex in changedFilesNames to handle quoted paths by
[@&#8203;anda3](https://togithub.com/anda3) in
[cli/cli#9115
- Add a `gh variable get FOO` command by
[@&#8203;arnested](https://togithub.com/arnested) in
[cli/cli#9106
- Add macOS pkg installer to deployment
([#&#8203;7554](https://togithub.com/cli/cli/issues/7554)) by
[@&#8203;paulober](https://togithub.com/paulober) in
[cli/cli#7555
- Add integration tests for `gh attestation verify` shared workflow use
case by [@&#8203;malancas](https://togithub.com/malancas) in
[cli/cli#9107
- Add build provenance for gh CLI releases by
[@&#8203;malancas](https://togithub.com/malancas) in
[cli/cli#9087
- build(deps): bump github.com/gabriel-vasile/mimetype from 1.4.3 to
1.4.4 by [@&#8203;dependabot](https://togithub.com/dependabot) in
[cli/cli#9124
- Build completions during release on macos by
[@&#8203;williammartin](https://togithub.com/williammartin) in
[cli/cli#9136
- Clarify Mac OS Installer packages are unsigned by
[@&#8203;andyfeller](https://togithub.com/andyfeller) in
[cli/cli#9140

#### New Contributors

- [@&#8203;gabemontero](https://togithub.com/gabemontero) made their
first contribution in
[cli/cli#8824
- [@&#8203;jasonodonnell](https://togithub.com/jasonodonnell) made their
first contribution in
[cli/cli#9052
- [@&#8203;anda3](https://togithub.com/anda3) made their first
contribution in
[cli/cli#9115
- [@&#8203;arnested](https://togithub.com/arnested) made their first
contribution in
[cli/cli#9106
- [@&#8203;paulober](https://togithub.com/paulober) made their first
contribution in
[cli/cli#7555

**Full Changelog**: cli/cli@v2.49.2...v2.50.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/izumin5210/dotfiles).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zNzcuOCIsInVwZGF0ZWRJblZlciI6IjM3LjM3Ny44IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: izumin5210-update-aqua-checksum[bot] <169593670+izumin5210-update-aqua-checksum[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external pull request originating outside of the CLI core team
Projects
No open projects
The GitHub CLI
  
Needs review 🤔
Development

Successfully merging this pull request may close these issues.

Unable to provide stateReason to --json flag of issue view
4 participants