Skip to content

feat(cli): name the machine on the approval page - #1828

Open
sileht wants to merge 1 commit into
devs/sileht/mrgfy-9262-cli-login-ux/open-browser-auth-login--90e2ca4cfrom
devs/sileht/mrgfy-9262-cli-login-ux/name-machine-approval-page--7e2ec96a
Open

feat(cli): name the machine on the approval page#1828
sileht wants to merge 1 commit into
devs/sileht/mrgfy-9262-cli-login-ux/open-browser-auth-login--90e2ca4cfrom
devs/sileht/mrgfy-9262-cli-login-ux/name-machine-approval-page--7e2ec96a

Conversation

@sileht

@sileht sileht commented Sep 11, 2026

Copy link
Copy Markdown
Member

The approval page defaulted every token to "Mergify CLI", the client
name every machine shares, on a page whose own helper text asks the
user to name it after the machine. auth login now sends the
hostname as the device_name field of the grant request, so the
default reads "Mergify CLI on work-laptop" and a user with a laptop,
a desktop and a devbox can tell three tokens apart on the CLI Tokens
page.

The bare hostname, not a composed label: the server composes
<client name> on <device name> itself, so sending "Mergify CLI on
host" would render "Mergify CLI on Mergify CLI on host".

Nothing is trimmed, lower-cased, or cut to length on this side. The
server sanitizes the value — printable ASCII, collapsed whitespace,
60 characters — and caps the label it composes, and a client that
pre-trimmed would only disagree with what the page then shows.

The field is optional and the machine may have no answer, so
machine::name() returns an Option and the field is omitted rather
than sent empty: a grant without it is what every client sent until
it existed, and the server keeps its own default for one. The name
comes from hostname(1), which ships on all three platforms and
stays right when the name changes under a running shell, falling back
to COMPUTERNAME / HOSTNAME for a container that has no hostname
on PATH. No new dependency for it.

A hostname can carry a person's name, and this sends it to the API.
It is shown in an editable field on the approval page before anything
is stored, so the user sees the value and can change it in the moment
they are already looking at that page.

Fixes MRGFY-9262

Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com

Depends-On: #1827

@sileht

sileht commented Sep 11, 2026

Copy link
Copy Markdown
Member Author

This pull request is part of a Mergify stack:

# Pull Request Link
1 feat(cli): open the browser on auth login #1827
2 feat(cli): name the machine on the approval page #1828 👈

@mergify
mergify Bot had a problem deploying to Mergify Merge Protections September 11, 2026 15:49 Failure
@sileht
sileht deployed to func-tests-live September 11, 2026 15:49 — with GitHub Actions Active
@mergify

mergify Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🔴 3 of 7 protections blocking · waiting on 👀 reviews and ⛓️ dependency

Protection Waiting on
🔴 ⛓️ Depends-On Requirements ⛓️ dependency
🔴 👀 Review Requirements 👀 reviews
🔴 🔎 Reviews 👀 reviews
🟢 🤖 Continuous Integration
🟢 Enforce conventional commit
🟢 📕 PR description
🟢 🚦 Auto-queue

🔴 ⛓️ Depends-On Requirements

Waiting for

This rule is failing.

Requirement based on the presence of Depends-On in the body of the pull request

🔴 👀 Review Requirements

Waiting for

  • #approved-reviews-by>=2
This rule is failing.
  • any of:
    • #approved-reviews-by>=2
    • author = dependabot[bot]
    • author = mergify-ci-bot
    • author = renovate[bot]

🔴 🔎 Reviews

Waiting for

  • #review-requested = 0
This rule is failing.
  • #review-requested = 0
  • #changes-requested-reviews-by = 0
  • #review-threads-unresolved = 0

Show 4 satisfied protections

🟢 🤖 Continuous Integration

  • all of:
    • check-success=ci-gate

🟢 Enforce conventional commit

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|internal|docs|style|refactor|perf|test|build|ci|chore|revert|ui)(?:\(.+\))?!?:

🟢 📕 PR description

  • body ~= (?ms:.{48,})

🟢 🚦 Auto-queue

When all merge protections are satisfied, this pull request will be queued automatically.

The approval page defaulted every token to "Mergify CLI", the client
name every machine shares, on a page whose own helper text asks the
user to name it after the machine. `auth login` now sends the
hostname as the `device_name` field of the grant request, so the
default reads "Mergify CLI on work-laptop" and a user with a laptop,
a desktop and a devbox can tell three tokens apart on the CLI Tokens
page.

The bare hostname, not a composed label: the server composes
`<client name> on <device name>` itself, so sending "Mergify CLI on
host" would render "Mergify CLI on Mergify CLI on host".

Nothing is trimmed, lower-cased, or cut to length on this side. The
server sanitizes the value — printable ASCII, collapsed whitespace,
60 characters — and caps the label it composes, and a client that
pre-trimmed would only disagree with what the page then shows.

The field is optional and the machine may have no answer, so
`machine::name()` returns an `Option` and the field is omitted rather
than sent empty: a grant without it is what every client sent until
it existed, and the server keeps its own default for one. The name
comes from `hostname(1)`, which ships on all three platforms and
stays right when the name changes under a running shell, falling back
to `COMPUTERNAME` / `HOSTNAME` for a container that has no `hostname`
on `PATH`. No new dependency for it.

A hostname can carry a person's name, and this sends it to the API.
It is shown in an editable field on the approval page before anything
is stored, so the user sees the value and can change it in the moment
they are already looking at that page.

Fixes MRGFY-9262

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Change-Id: I7e2ec96a405831003ab0eb03e2a9208f2e7db5d8
@mergify
mergify Bot requested a review from a team September 11, 2026 15:58
@sileht
sileht force-pushed the devs/sileht/mrgfy-9262-cli-login-ux/open-browser-auth-login--90e2ca4c branch from 65c58ec to 15ef21b Compare September 11, 2026 16:00
@sileht
sileht force-pushed the devs/sileht/mrgfy-9262-cli-login-ux/name-machine-approval-page--7e2ec96a branch from 33a4e8e to fc4baeb Compare September 11, 2026 16:00
@sileht

sileht commented Sep 11, 2026

Copy link
Copy Markdown
Member Author

Revision history

# Type Changes Reason Date
1 initial 33a4e8e 2026-09-11 16:00 UTC
2 rebase 33a4e8e → fc4baeb (rebase only) 2026-09-11 16:00 UTC

@sileht
sileht deployed to func-tests-live September 11, 2026 16:00 — with GitHub Actions Active
@mergify
mergify Bot had a problem deploying to Mergify Merge Protections September 11, 2026 16:00 Failure
@sileht
sileht marked this pull request as ready for review September 11, 2026 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant