Commit graph

8728 commits

Author SHA1 Message Date
William Martin
b382b24728 Print informative message before prompting for secret repo 2025-01-15 14:55:17 +01:00
William Martin
a47327aee6 Secret base repo prompting should not use resolved remote
This is because the secret commands don't use the SmartBaseRepo behaviour, and therefore
don't care about the resolved remote.
2025-01-15 14:55:17 +01:00
William Martin
ce47fabc27 Move secret base repo prompting earlier 2025-01-15 14:55:17 +01:00
William Martin
5630252f78 Add acceptance test for secrets remote disambiguation 2025-01-15 14:55:17 +01:00
William Martin
d831e3e1db Remove validated TODO and add review warning 2025-01-15 14:55:17 +01:00
William Martin
4da4c82090 Rename secret BaseRepo func 2025-01-15 14:55:17 +01:00
William Martin
870da79886 Use smarter base repo funcs for secret commands 2025-01-15 14:55:17 +01:00
William Martin
73244c010e Move secret repo validation into secrets subpackage 2025-01-15 14:55:17 +01:00
William Martin
df8bb51c9c Always prompt on secret set when multiple remotes 2025-01-15 14:55:17 +01:00
Wing
0be5720c1c Update setdefault test 2025-01-15 14:55:17 +01:00
Wing
cad59036f5 Update docs for set-default
NOTE: gh does not use the default repository for managing repository and environment secrets.
2025-01-15 14:55:17 +01:00
Wing
3de2fd94b3 Prompt for secret commands
Co-authored-by: William Martin <williammartin@github.com>
2025-01-15 14:55:16 +01:00
Wing
57c9ee0ad2 Add tests for secret commands
Co-authored-by: William Martin <williammartin@github.com>
2025-01-15 14:55:16 +01:00
Wing
88988374b5 Add remote check to secret commands
Co-authored-by: William Martin <williammartin@github.com>
2025-01-15 14:55:16 +01:00
Tyler McGoffin
adc5f01d23
Merge pull request #10214 from cli/dependabot/go_modules/github.com/sigstore/protobuf-specs-0.3.3
Bump github.com/sigstore/protobuf-specs from 0.3.2 to 0.3.3
2025-01-14 16:08:39 -08:00
Tyler McGoffin
12ee8b7a86
Merge pull request #10154 from danochoa/gh-gist-delete-prompt
gh gist delete: prompt for gist id
2025-01-14 14:42:13 -08:00
Tyler McGoffin
3feeb9a826 Add tests for deleteGist 2025-01-14 14:21:49 -08:00
Daniel A. Ochoa
3370bc8a04
Merge branch 'trunk' into gh-gist-delete-prompt 2025-01-13 21:17:23 -06:00
Tyler McGoffin
6fe21d8f52
Merge pull request #10197 from cli/jtmcg/remove-named-returns
Remove naked return values from `ReadBranchConfig` and `prSelectorForCurrentBranch`
2025-01-13 09:55:17 -08:00
Meredith Lancaster
112552fec1
Merge pull request #10185 from malancas/fetch-artifact-attestation-bundles-with-sas-url 2025-01-13 08:20:33 -07:00
Andy Feller
41e99b9eab
Merge pull request #9934 from cli/andyfeller/cli-cli-8183-timeout-pt2
Ensure extension update notices only notify once within 24 hours, provide ability to disable all extension update notices
2025-01-13 09:12:32 -05:00
Andy Feller
3ada5af872 Enhance help docs on ext upgrade notices
- update `gh help environment` to include that upgrade notices only happen when gh or extensions are executed
- update `gh ext --help` to include reference to upgrade notices and points to `gh help environment` for info on disabling
2025-01-13 08:41:10 -05:00
Andy Feller
8a2be52be0
Merge pull request #10225 from zhuhaicity/fix_func_name
chore: fix some function names in comment
2025-01-13 08:08:18 -05:00
danochoa
1d9b4e4464 fix tests 2025-01-12 19:36:44 -06:00
danochoa
08f7706c42 fix tests 2025-01-12 19:18:24 -06:00
danochoa
7885167c70 gist delete - check no gists 2025-01-12 17:01:45 -06:00
zhuhaicity
13211af256 chore: fix some function names in comment
Signed-off-by: zhuhaicity <zhuhai@52it.net>
2025-01-12 15:07:04 +08:00
danochoa
5de282c970 drop description from prompts, fix tests 2025-01-11 01:35:12 -06:00
Andy Feller
0a1c9be656 Expand docs on cleaning extension update dir
This summarizes a conversation within cli/cli#9934 PR regarding how the new extension update directory metadata would affect gh if not cleaned up.
2025-01-10 14:57:10 -05:00
Andy Feller
97eb8a194e Simplifying cleanExtensionUpdateDir logic
This function was doing some unnecessary heavy lifting detecting if the directory being deleted actually existed when `os.RemoveAll()` would handle directories that exist or not.
2025-01-10 14:29:55 -05:00
Andy Feller
20062233c8 Separate logic for checking updates
During discussion in cli/cli#9934, we can to the conclusion that the logic around checking for core GitHub CLI updates would diverge from GitHub CLI
extension updates over time.  To that end, this commit splits that logic into a separate function with a new environment variable.
2025-01-10 14:16:46 -05:00
Andy Feller
1c32c986ec Capture greater detail on updaterEnabled
This commit expands the in-line docs around updaterEnabled package variable used to affect release checking.

Along with clarifying specific details discovered when talking with @williammartin, I'm also removing a useless local variable.
2025-01-10 13:55:16 -05:00
Tyler McGoffin
74cbd50d3f Restore old error functionality of prSelectorForCurrentBranch
Before this refactor, the errors emitted by ghrepo.FromURL and
rem.FindName() were suppressed. It isn't clear whether this was
intentional or not, but we've made the decision here to maintain the
original error behavior while still refactoring the return values for more
clarity. I've left a comment at each error handling block to explain this
decision.

Additionally, I've added the necessary git command stubs to the other
tests in status_test.go so that the tests are now passing.
2025-01-10 10:52:01 -08:00
Andy Feller
a6ea8fe4ed
Merge pull request #10216 from nobe4/improve-padded-display
fix: padded display
2025-01-10 13:45:51 -05:00
Kynan Ware
c0d41102a5
Merge pull request #10215 from cli/dependabot/go_modules/github.com/mattn/go-colorable-0.1.14
Bump github.com/mattn/go-colorable from 0.1.13 to 0.1.14
2025-01-10 11:17:21 -07:00
Tyler McGoffin
322a43feff Change error handling on ReadBranchConfig to respect git Exit Codes 2025-01-10 09:59:21 -08:00
nobe4
69b17272d6
fix: add back colon that I removed 2025-01-10 17:17:14 +01:00
nobe4
69ab0c9c85
fix: actually read how MaxFunc work and simplify the code 2025-01-10 16:31:13 +01:00
nobe4
1899b83509
fix: padded display
Apply code suggestion from @andyfeller from:
- https://github.com/cli/cli/pull/10194#discussion_r1909761552
- https://github.com/cli/cli/pull/10194#discussion_r1909764278
2025-01-10 16:28:50 +01:00
William Martin
889c4c75f3 Collapse dryrun checks in ext bin upgrade 2025-01-10 16:06:01 +01:00
dependabot[bot]
567624b550
Bump github.com/mattn/go-colorable from 0.1.13 to 0.1.14
Bumps [github.com/mattn/go-colorable](https://github.com/mattn/go-colorable) from 0.1.13 to 0.1.14.
- [Commits](https://github.com/mattn/go-colorable/compare/v0.1.13...v0.1.14)

---
updated-dependencies:
- dependency-name: github.com/mattn/go-colorable
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-10 14:39:26 +00:00
dependabot[bot]
ae36160ea5
Bump github.com/sigstore/protobuf-specs from 0.3.2 to 0.3.3
Bumps [github.com/sigstore/protobuf-specs](https://github.com/sigstore/protobuf-specs) from 0.3.2 to 0.3.3.
- [Release notes](https://github.com/sigstore/protobuf-specs/releases)
- [Changelog](https://github.com/sigstore/protobuf-specs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sigstore/protobuf-specs/compare/v0.3.2...v0.3.3)

---
updated-dependencies:
- dependency-name: github.com/sigstore/protobuf-specs
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-10 14:39:20 +00:00
Daniel A. Ochoa
d621b75ee7
Merge branch 'trunk' into gh-gist-delete-prompt 2025-01-10 01:25:19 -06:00
danochoa
7f71681ace gist delete - use in confirmation and success info 2025-01-10 01:07:11 -06:00
Tyler McGoffin
4c8d124d37
Merge pull request #10194 from nobe4/fancier-extention-upgrade
feat: make the extension upgrade fancier
2025-01-09 14:59:52 -08:00
Daniel A. Ochoa
928db3e66f
Merge branch 'trunk' into gh-gist-delete-prompt 2025-01-09 16:36:15 -06:00
Tyler McGoffin
3d2748789e Rename test user in tests 2025-01-09 12:58:31 -08:00
Tyler McGoffin
100f9b473f Change pr number in test 2025-01-09 12:57:23 -08:00
Tyler McGoffin
e4f0b79173 Surface and handle error from ReadBranchConfig in parseCurrentBranch
I've only added the one test for parseCurrentBranch because the function
appears to be largely exercised by TestFind. There's definitely an
opportunity for a bigger refactor of the tests, here, but I want to avoid
scope creep as I propagate the ReadBranchConfig api changes throughout the
codebase
2025-01-09 12:46:55 -08:00
Tyler McGoffin
e4320ccc4b Directly stub headBranchConfig in Test_tryDetermineTrackingRef 2025-01-09 11:58:33 -08:00