Skip to content

bb uppercases flag values in every locale - #143

Merged
jwloka merged 2 commits into
mainfrom
bug/bb-upper-locale
Nov 24, 2026
Merged

jwloka merged 2 commits into
mainfrom
bug/bb-upper-locale

Conversation

@jwloka

@jwloka jwloka commented Nov 24, 2026

Copy link
Copy Markdown
Member

Closes #142

bb_upper uppercased with tr, which follows the caller's locale. Under tr_TR.UTF-8, GNU tr leaves i unchanged, so --state declined became DECLiNED and bb pr list rejected it. BSD tr (macOS) is not affected.

Change

  • cli/bb: bb_upper runs tr under LC_ALL=C, like bb_account_key since bb gives one account key in every locale #139. The two lowercasings of the --match-head-commit SHAs (cli/bb:2368, :2383) get LC_ALL=C too. They had no failing input, because I is no hex digit, but they were the last case conversions in cli/bb that followed the locale.
  • tests/upper-locale.test.ts: bb pr list --state declined under LC_ALL=tr_TR.UTF-8 sends state=DECLINED. With CI=true and no such locale, the test fails instead of skipping.
  • bb-tests.yml: the Linux job runs sudo locale-gen tr_TR.UTF-8 and lists the result. The Ubuntu runner does not ship that locale.
  • A patch changeset for working-with-bitbucket-api.

Checks

  • Linux, GNU coreutils 9.7 (node:20-bookworm with locales-all): the new test fails on main with invalid --state 'DECLiNED' and passes on this branch.
  • macOS: pnpm test in skills/working-with-bitbucket-api/tests/ gives 463 pass, 0 fail, 1 skipped, with bash 5 and with /bin/bash 3.2.57. Only bb-tests-linux can fail on the new test.
  • pnpm test and pnpm run validate at the root: pass.

🤖 Generated with Claude Code

jwloka and others added 2 commits November 24, 2026 22:32
bb_upper uppercased with tr, which follows the caller's locale. Under
tr_TR.UTF-8, GNU tr maps i to i, so `--state declined` became
DECLiNED and bb pr list rejected it. The tr now runs under LC_ALL=C.
The Linux job generates tr_TR.UTF-8, because only GNU tr shows the bug.

Closes #142

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The two hex lowercasings were the last case conversions in cli/bb that
followed the caller's locale. The test reads CI only when it is "true",
and the comments say that GNU tr leaves i unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jwloka
jwloka marked this pull request as ready for review November 24, 2026 22:51
@jwloka
jwloka merged commit 0934da8 into main Nov 24, 2026
3 checks passed
@jwloka
jwloka deleted the bug/bb-upper-locale branch November 24, 2026 22:51
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.

bb_upper follows the locale: --state declined fails under tr_TR.UTF-8 on Linux

1 participant