Consolidates multiple individual test functions into a single table-driven test, improving maintainability and readability. This change makes it easier to add new test cases and ensures consistent test structure for agent task command authentication scenarios.
Changed the RunE function of the agent-task command to display help output instead of returning nil, improving user guidance when the command is run without arguments.
Introduces a new `agent-task` command under pkg/cmd/agent with strict OAuth (device flow) token validation. Includes comprehensive tests for token source and host validation, and registers the command in the root command set.
* Ensure that the `--ref` flag cannot be used in conjunction with a cache ID.
* Update error handling to provide clear feedback when this condition is violated.
* Add tests to cover scenarios involving the `--ref` flag and cache ID.
* Added validation to ensure that the `--ref` flag cannot be used when a cache ID is provided.
* Updated error message to include the reference when a cache is not found with the specified `--ref`.
* Replaced direct conversion of cache ID string to int with a dedicated `parseCacheID` function.
* Improved readability and maintainability of the `deleteCaches` function.
* Changed the error message from "--ref cannot be used without cache key/ID" to "must provide a cache key" for clarity.
* Updated corresponding test case to reflect the new error message.
* Clarified the description of the `--ref` flag to specify its purpose more accurately.
* Ensures users understand that it narrows down deletion by cache key and ref.
* Implemented test cases for handling the `--ref` flag in cache deletion commands.
* Added validation for using `--ref` with cache key and ID.
* Ensured proper error messages are returned for invalid usage of `--ref`.
- Introduced `--ref` flag to narrow down cache deletion to a specific branch or PR reference.
- Updated command examples to include usage of `--ref`.
- Added validation to ensure `--ref` cannot be used with `--all` and must accompany a cache key/ID.
* feat: add ability to copy one-time OAuth code while authenticating
Signed-off-by: Andrey <andrekabatareika@gmail.com>
* fix(docs): wrong example for gh auth refresh
* chore(authflow): update message to include one-time code to it
Co-authored-by: Kynan Ware <47394200+BagToad@users.noreply.github.com>
* chore(authflow): improve message when copied one-time code
Co-authored-by: Kynan Ware <47394200+BagToad@users.noreply.github.com>
* chore(authflow): don't early return error when could not copy OAuth code
Co-authored-by: Kynan Ware <47394200+BagToad@users.noreply.github.com>
* refactor(authflow): make code for working with OAuth code more readable
* Adjust language in `gh auth` help for clipboard
---------
Signed-off-by: Andrey <andrekabatareika@gmail.com>
Co-authored-by: Kynan Ware <47394200+BagToad@users.noreply.github.com>
* docs(release create): distinguish difference between '--generate-notes' and '--notes-from-tag'
Signed-off-by: Andrey <andrekabatareika@gmail.com>
* Clarify release notes behavior for unannotated tags
Updated help text to specify that if a git tag is not annotated, the release notes will use the commit message instead of the tag annotation.
---------
Signed-off-by: Andrey <andrekabatareika@gmail.com>
Co-authored-by: Kynan Ware <47394200+BagToad@users.noreply.github.com>
* feat: add --force flag to run cancel command
Signed-off-by: Andrey <andrekabatareika@gmail.com>
* docs: use less prescriptive docs for --force flag
Co-authored-by: Kynan Ware <47394200+BagToad@users.noreply.github.com>
* chore: remove short flag
Signed-off-by: Andrey <andrekabatareika@gmail.com>
---------
Signed-off-by: Andrey <andrekabatareika@gmail.com>
Co-authored-by: Kynan Ware <47394200+BagToad@users.noreply.github.com>
These changes enhance the existing `gh issue view` experience by listing v2 projects in interactive and non-interactive forms.
Additionally, the tests have been enhanced to use a more standard `httpStubs` approach from other tests.
This commit moves the `gh pr create` tab completion test closer to the logic rather than the commands that use it.
This should ensure that any command or flag that lists reviewers will present teams and users as expected.