Refreshable tokens: bump cli/oauth to v1.3.0 and fix `gh status` column width by babakks · Pull Request #14768 · cli/cli · GitHub
Skip to content

Refreshable tokens: bump cli/oauth to v1.3.0 and fix gh status column width - #14768

Merged
babakks merged 2 commits into
trunkfrom
babakks/refresh-token-bump-deps
Oct 21, 2026
Merged

babakks merged 2 commits into
trunkfrom
babakks/refresh-token-bump-deps

Conversation

@babakks

@babakks babakks commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Description

This PR sits on top of #14752 in the refreshable-token stack. Until now the stack pinned a pre-release pseudo-version of cli/oauth. The changes are now released, so this moves gh to the tagged version:

  • github.com/cli/oauth v1.3.0: the token expiry fields are now time.Duration values, so internal/authflow converts them when building the stored credential. Refresh also keeps the previous refresh token when the server omits a new one, which the godoc and the related test now reflect.

github.com/cli/go-gh/v2 v2.17.0 is already on trunk via #14148. As expected, that release was a breaking change for gh because it moved its markdown package to Glamour v2 (cli/go-gh#281), and #14148 took care of the migration.

This PR also fixes a small gh status regression from that migration. Lip Gloss v2 counts borders within Width, so the bordered left column became one cell narrower than the right one and truncated rows wrapped onto a second line. The left column is now one cell wider, and the status_test.go expectations are restored to what they were before #14148.

How did you test this change?

Not tested by hand. I have not run gh status or the auth commands interactively against this branch.

Key points

  • The gh status fix is unrelated to oauth, but it is small and keeps the go-gh/Glamour follow-up in one place before release.

Notes for reviewers

Start with internal/authflow/refresh.go for the oauth change, then pkg/cmd/status/status.go for the one-line width fix. The status_test.go diff only moves the column divider back by one cell and unwraps the truncated rows.

Authorship and follow-up

Who wrote this:

  • A human wrote it.
  • An agent wrote it under close human direction.
  • An agent wrote it independently, and no human has guided the implementation beyond the initial prompt.

Who answers review comments:

  • @babakks will read and reply directly.
  • An agent will draft replies and @babakks will read them before they are posted.
  • Nobody has explicitly committed to replying.

@babakks
babakks requested a review from a team as a code owner October 20, 2026 16:40
@babakks
babakks requested review from BagToad and a balanced review from Copilot and removed request for a team and Copilot October 20, 2026 16:40
@babakks
babakks added this pull request to stack #14457 October 20, 2026 16:41
@babakks
babakks requested review from williammartin and removed request for BagToad October 21, 2026 08:12
Copilot AI balanced review requested due to automatic review settings October 21, 2026 09:42
@babakks
babakks force-pushed the babakks/refresh-token-bump-deps branch from 04b3929 to 831b934 Compare October 21, 2026 09:42
@babakks babakks changed the title Refreshable tokens: bump cli/oauth and cli/go-gh to released versions Refreshable tokens: bump cli/oauth to v1.3.0 and fix gh status column width Oct 21, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Runtime validation of the authentication dependency upgrade remains unverified and needs human confirmation.

1 open issue
What changed in this PR

Updates the refreshable-token stack to the released OAuth library and restores status column alignment after the Lip Gloss v2 migration.

Changes:

  • Upgrade cli/oauth to v1.3.0 and convert token durations to stored seconds.
  • Update documentation and tests for refresh-token reuse.
  • Restore status column width and expected output.
File Description
pkg/​cmd/​status/​status.go Account for border width in the left column.
pkg/​cmd/​status/​status_test.go Restore aligned, unwrapped output expectations.
internal/​authflow/​refresh.go Convert durations and document token reuse.
internal/​authflow/​refresh_test.go Update duration fixtures and token-reuse assertions.
go.sum Update OAuth dependency checksums.
go.mod Pin cli/oauth v1.3.0.

Review effort: Balanced

Comment thread pkg/cmd/status/status.go
@babakks
babakks force-pushed the babakks/refresh-token-bump-deps branch from 831b934 to b38159e Compare October 21, 2026 09:46
@williammartin
williammartin requested a balanced review from Copilot October 21, 2026 09:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The authentication dependency upgrade needs regression-test validation and human review before approval.

1 open issue

Review effort: Balanced

@babakks
babakks force-pushed the babakks/refresh-token-bump-deps branch 11 times, most recently from 128b7c6 to 15e431d Compare October 21, 2026 11:56
Base automatically changed from babakks/refresh-token-test-env to trunk October 21, 2026 12:06
babakks and others added 2 commits October 21, 2026 13:06
cli/oauth v1.3.0 exposes the access and refresh token expiry fields as
time.Duration values, so convert them when building the stored credential.
Refresh now keeps the previous refresh token when the server omits a new
one, which the godoc and the omitted refresh token test reflect.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ac178b5a-5b62-49bd-9e83-4796c7ddec46
Lip Gloss v2 includes borders in Width, which made the bordered left
column one cell narrower and wrapped truncated rows. Widen it by one
cell and restore the original test expectations.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ac178b5a-5b62-49bd-9e83-4796c7ddec46
@babakks
babakks force-pushed the babakks/refresh-token-bump-deps branch from 15e431d to 6ec1ba5 Compare October 21, 2026 12:06
@babakks
babakks merged commit 99750e1 into trunk Oct 21, 2026
11 checks passed
@babakks
babakks deleted the babakks/refresh-token-bump-deps branch October 21, 2026 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants