Repository navigation
Add --timezone and --locale to browsers create and update - #302
Open
tnsardesai wants to merge 3 commits into
Open
tnsardesai wants to merge 3 commits into
tnsardesai wants to merge 3 commits into
Conversation
Bump the Go SDK to v0.129.0 for the browser location fields. On update, an empty value (--timezone="") clears that override so the browser goes back to its region's default. browsers create, get, and update show the effective timezone and locale with whether each is an override or the region default.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
…cale Match --clear-name and the other update flags: --clear-timezone and --clear-locale send null so the browser goes back to its region's default, and an empty --timezone or --locale is rejected with a pointer to them.
tnsardesai
marked this pull request as ready for review
October 21, 2026 20:39
Contributor
Author
|
Picked bmsaadat to review: touched the changed code in |
bmsaadat
approved these changes
Oct 21, 2026
bmsaadat
left a comment
Contributor
There was a problem hiding this comment.
Approve. Set / clear-to-null / omit semantics match --clear-name and --clear-allowed-hosts, and the tests check real request bodies. A few non-blocking notes:
- Heads-up on #296: the coverage bot PR adds the same flags on the same SDK version, so it will conflict once this lands (duplicate
formatBrowserLocationFieldand duplicate--timezone/--localeregistrations onbrowsers create). CI will catch it, and the bot handled the same thing in #278, so just flagging it. - Pooled browsers (follow-up idea): since a reuse release keeps the override, an acquired browser can carry the previous lease's location. It might be worth showing the location rows on
browsers create --pool-*andbrowser-pools acquireat some point, and maybe a line in theupdatehelp like the--allowed-hostone about pool release. - Nit:
cmd/browsers.go:3020, "omit them to leave a field unchanged" reads as if it means the clear flags; maybe "omit a flag to leave that field unchanged".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
--timezoneand--localetokernel browsers createandkernel browsers update, plus--clear-timezoneand--clear-localetoupdate, so a session's timezone and locale can be set from the CLI. Bumpskernel-go-sdkfrom v0.126.0 to v0.129.0, which adds thelocationrequest and response fields.--timezone Europe/Berlin --locale de-DEsets either override. An omitted flag uses the browser region's default.--timezone/--localeset an override.--clear-timezone/--clear-localesendnull, which clears it so the browser goes back to its region's default, like--clear-nameand the other clear flags. An empty value is rejected with a pointer to the clear flag, and set plus clear is an error. An omitted flag leaves the field unchanged. Any one of the four counts as an update.create,get, andupdateshow the effective timezone and locale with their source, e.g.Europe/Berlin (override)orAmerica/New_York (default).-o jsonalready returnedlocation.The flags aren't added to pool acquire (
browsers create --pool-id), which doesn't accept a location; passing them there gets the existing "flags will be ignored" warning.Validation
make test(go vet ./...,go test ./...). New tests cover the create and update params,nullfor the clear flags, the empty-value and set-plus-clear errors (without calling the API), omitted flags not being sent,--clear-timezone --locale de-DEreaching the API through the cobra command, and the table output.golangci-lint run ./cmd/: no new findings.--timezone Europe/Berlin --locale de-DE, thenupdate --clear-timezone --locale ja-JP(timezone back toAmerica/New_York (default), localeja-JP (override)), thenupdate --clear-locale(both defaults).update --timezone=""andupdate --locale de-DE --clear-localewere rejected locally.getshowed the same values. The browser was deleted afterwards.Note
Low Risk
CLI and SDK wiring for an existing browser location API; no auth or infrastructure changes, with solid test coverage.
Overview
Adds CLI support for browser session timezone (IANA) and locale (BCP 47) via new flags on
kernel browsers createandkernel browsers update, with--clear-timezone/--clear-localeon update to reset overrides to the region default.Create sends optional
locationfields on the API; update sets values or sendsnullto clear, with the usual validation (non-empty set values, no mixing set and clear). create, get, and update table output now shows effective timezone/locale and whether each comes from an override or the region default.Bumps kernel-go-sdk from v0.126.0 to v0.129.0 for the
locationrequest/response types. README and tests cover flag wiring, PATCH payloads, errors, and display. Pool acquire (create --pool-id) does not accept location; those flags still trigger the existing “ignored with pool” behavior.Reviewed by Cursor Bugbot for commit de106a4. Bugbot is set up for automated code reviews on this repo. Configure here.