Skip to content

test(workspace): guard the pending-invite menu against raw i18n keys - #19307

Closed
dante01yoon wants to merge 1 commit into
mainfrom
glary/guard-invite-link-i18n-keys
Closed

dante01yoon wants to merge 1 commit into
mainfrom
glary/guard-invite-link-i18n-keys

Conversation

@dante01yoon

Copy link
Copy Markdown
Collaborator

PR Created by the Glary-Bot Agent


Companion to #19300, based on main as requested.

Why this is a test and not a locale fix

All six locale keys from #17315 are already present on main — I verified each one against origin/main:src/locales/en/main.json:

PRESENT workspacePanel.members.actions.copyInviteLink = 'Copy invite link'
PRESENT workspacePanel.inviteLinks.sentTitle          = '{count} invite sent | {count} invites sent'
PRESENT workspacePanel.inviteLinks.sentLead           = 'Each invite has a personal link you can share directly:'
PRESENT workspacePanel.inviteLinks.copyLink           = 'Copy invite link'
PRESENT workspacePanel.inviteLinks.copied             = 'Copied!'
PRESENT workspacePanel.inviteLinks.copyAll            = 'Copy invite link | Copy all links ({count})'

So there is no string to add here. What main is missing is a guard: every existing test in PendingInvitesList.test.ts builds i18n with messages: { en: {} } and asserts the raw key strings as accessible names, so a present translation and a missing one are indistinguishable. That is exactly how workspacePanel.members.actions.copyInviteLink reached production on cloud/1.54 with every gate green.

Change

One test that renders the menu against the shipped en bundle and asserts no button is left with a name in the workspacePanel namespace, plus the three expected labels.

Verification

  • Passes on main as-is (7/7 in the file)
  • Proven non-vacuous: deleting copyInviteLink from src/locales/en/main.json on main fails it with expected [ <button …> ] to have a length of +0 but got 1; restored afterwards
  • pnpm typecheck exit 0 (matters here — a large JSON bundle is fed into createI18n's typed messages), eslint exit 0, oxfmt clean

Known limits

  • Covers the three workspacePanel.members.actions.* keys this menu renders. The other three in that namespace (changeRole, setCreditLimit, removeMember) are consumed via useMembersPanel.ts, whose tests use a hand-written stub bundle and so share the original blind spot.
  • A per-component guard only protects the branch it is picked onto. The branch-independent fix is a repo-wide used→defined key check — scripts/check-unused-i18n-keys.ts scans the opposite direction today, and @intlify/vue-i18n/no-missing-keys is not enabled in eslint.config.ts (only no-raw-text is). Both are follow-ups, noted on FE-1225.

Related

The pending-invite row menu shipped a raw
workspacePanel.members.actions.copyInviteLink label to production on the
cloud/1.54 release line. main has the locale entry, but nothing stops it
being dropped again: every existing test in this file builds i18n with
`messages: { en: {} }` and asserts the raw key strings, so a missing
translation is indistinguishable from a present one.

Renders the menu against the shipped en bundle instead and asserts no
button is left with a name in the workspacePanel namespace. Verified it
fails when copyInviteLink is removed from src/locales/en/main.json.
@coderabbitai

coderabbitai Bot commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

Warning

Review paused — included plan limit reached

Keep your review moving with free on-demand reviews.

  • Run this review for free

On-demand reviews are free for the next 11 days.

Promotion and pricing details

On-demand reviews are free for the next 11 days. After that, they cost $0.25 per reviewed file.

Review limit details

Or wait 13 minutes for your next included review.

Check out review usage here.

Limit details: You’ve used all 8 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository: Comfy-Org/ComfyUI_frontend/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 9aa92703-64d4-4313-926e-f74b8595fe68

📥 Commits

Reviewing files that changed from the base of the PR and between 4dde68b and aad9e1e.

📒 Files selected for processing (1)
  • src/platform/workspace/components/dialogs/settings/PendingInvitesList.test.ts

Comment @coderabbitai help to get the list of available commands.

@glary-bot

glary-bot Bot commented Sep 28, 2026

Copy link
Copy Markdown

Asked to rebase this onto main. I can't do that here, and the numbers say why — flagging rather than silently leaving it.

The strings already exist on main. All six keys from #17315 are present in origin/main:src/locales/en/main.json (they are where this PR's values were copied from), so a main-based version of this change would be an empty diff. cloud/1.54 is the only branch missing them: git log -S copyInviteLink origin/cloud/1.54 -- src/locales/en/main.json returns nothing — the key never existed there.

Retargeting this PR's base would not produce a rebase, it would produce a merge of the release line into main:

$ git diff --stat origin/main...glary/fix-invite-link-i18n-cloud-1.54
999 files changed, 129803 insertions(+), 14440 deletions(-)

$ git rev-list --count origin/main..HEAD      # commits the PR would contain
139
$ git rev-list --count origin/cloud/1.54..origin/main   # main commits not on 1.54
977

cloud/1.54 has diverged by 138 commits, so main...head sweeps all of it in.

What I did instead: opened #19307 against main with the piece main genuinely lacks — the regression guard. main has the keys but nothing stopping them being dropped again, since every test in this file uses messages: { en: {} } and asserts raw keys, which is how this bug shipped green. That test passes on main and fails when the key is deleted.

This PR stays based on cloud/1.54, which also matches how the branch takes fixes — 10 of the last 12 commits on it are [backport cloud/1.54] ….

Also addressed the review feedback on the test itself: replaced the for loop with expect(screen.queryAllByRole('button', { name: /^workspacePanel\./ })).toHaveLength(0), per docs/guidance/testing-principles.md ("a loop over outputs is one assertion on the whole collection"). Re-verified it still fails with the locale entries reverted.

If the intent was that the reported bug should just ride 1.55 rather than be patched on 1.54, say so and I'll close this — but note cloud/v1.54.15 (Sep 27) is the newest cloud tag, so the raw key stays visible in production until 1.55 rolls out.

@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

🌾 Fallow: ✅ Passed

Fallow audits the diff for duplication, complexity and dead code. It gates on new findings only, so when the audit completes, a red is something this PR introduced or moved — never inherited backlog. A red can also mean the audit itself did not finish; the details below say which happened.

No new findings in the changed files.

Reproduce locally
# the base the gate compared against
npx fallow audit --root . --quiet --format json \
  --changed-since 4dde68ba9e6a3f29691a353abb1301cd4e291b94

Full docs: ADR-DEVEX-LINT-0015

🧩 Custom Nodes Ecosystem Matrix: 🟡 Withheld — could not measure

Executes the frontend JS of every registry pack that ships any, against this change, in both renderers. The eight ecosystem-matrix shard checks are a harness self-test; the pack verdict is matrix-verdict.

This candidate changes nothing the matrix measures, so every expensive stage was skipped.

Reproduce locally
# build one shard's fixture, then run it
python3 scripts/registry-census/build_matrix.py --shard 1/4
MATRIX_RENDERER=vue MATRIX_VUE=1 \
  npx vitest run --config vitest.matrix.config.mts

Full docs: scripts/registry-census/README.md

🎨 Storybook: ✅ Built — View Storybook

Details

⏰ Completed at: 09/28/2026, 10:29:46 PM UTC

Links

@glary-bot

glary-bot Bot commented Sep 28, 2026

Copy link
Copy Markdown

No code changes from this — the review was paused by the org's included-review quota (8/8 used), not by anything in the diff. Zero technical feedback was given.

Worth getting it to actually run rather than leaving it: .coderabbit.yaml sets fail_commit_status: true specifically so a review that never happened doesn't read as green ("an unreviewed PR is indistinguishable from a cleanly reviewed one"). So this PR keeps a failing CodeRabbit status until a review executes.

I waited for the included window to reset and am triggering through the included quota rather than ticking the on-demand checkbox — that path is tied to the promo/pricing meter, and spending org review budget isn't my call to make.

For context while it runs: this is 33 added lines in one test file. It already went through a two-model deep review, which caught a real issue I've since fixed — a for loop in the test body, replaced with expect(screen.queryAllByRole('button', { name: /^workspacePanel\./ })).toHaveLength(0) per docs/guidance/testing-principles.md ("a loop over outputs is one assertion on the whole collection"). I re-verified the guard is still non-vacuous afterwards: deleting copyInviteLink from src/locales/en/main.json fails it with expected [ <button …> ] to have a length of +0 but got 1.

Also confirmed the one commit main gained since I branched (#19291, fix(website)) touches only apps/website — no overlap with locales or the workspace dialogs, and the merge-base diff for this PR is still just the single test file.

@coderabbitai review

@github-actions github-actions Bot added the risk:high PR risk grade (advisory shadow check; grader-owned) label Sep 28, 2026
@codecov

codecov Bot commented Sep 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@            Coverage Diff             @@
##             main   #19307      +/-   ##
==========================================
+ Coverage   84.22%   85.12%   +0.89%     
==========================================
  Files        3213     2341     -872     
  Lines      156702   134730   -21972     
  Branches    40693    36458    -4235     
==========================================
- Hits       131989   114692   -17297     
+ Misses      23020    19684    -3336     
+ Partials     1693      354    -1339     
Flag Coverage Δ
billing-web-unit ?
unit 81.52% <ø> (ø)
website-unit ?

Flags with carried forward coverage won't be shown. Click here to find out more.
see 872 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dante01yoon dante01yoon closed this Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:high PR risk grade (advisory shadow check; grader-owned)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant