Skip to content

fix(cells) Hide US2 in customer facing dropdowns#116529

Open
markstory wants to merge 1 commit into
fix-prodeng-1457from
fix-us2-visible
Open

fix(cells) Hide US2 in customer facing dropdowns#116529
markstory wants to merge 1 commit into
fix-prodeng-1457from
fix-us2-visible

Conversation

@markstory
Copy link
Copy Markdown
Member

Currently US2 is hidden, and only visible to users who already have membership there. However, in the future US2 will become visible, but we still don't want it to be listed as a unique storage location in the UI.

Instead we will be mapping 'us' to us2/us1 serverside. These changes update the org-create view and relocation import views to use a common set of helpers to create select options for regions.

I took the time to trim out some redundant formatters, switch from choices to options and expand test coverage as well.

Refs INFRENG-331

Currently US2 is hidden, and only visible to users who already have
membership there. However, in the future US2 will become visible, but we
still don't want it to be listed as a unique storage location in the UI.

Instead we will be mapping 'us' to us2/us1 serverside. These changes
update the org-create view and relocation import views to use a common
set of helpers to create select options for regions.

I took the time to trim out some redundant formatters and expand test
coverage as well.

Refs INFRENG-331
@markstory markstory requested a review from a team May 29, 2026 20:55
@markstory markstory requested review from a team as code owners May 29, 2026 20:55
@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 29, 2026

INFRENG-331

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label May 29, 2026
@github-actions
Copy link
Copy Markdown
Contributor

📊 Type Coverage Diff

✅ No new type safety issues introduced. Coverage: 93.59%

Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a57167b. Configure here.

const stepIndex = onboardingSteps.findIndex(({id}) => stepId === id);
const api = useApi();
const regions = ConfigStore.get('regions');
const regionOptions = getRegionUrlOptions();
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.

US2 excluded from relocation API data-fetching calls

High Severity

getRegionUrlOptions() filters out US2 via CUSTOMER_HIDDEN_REGIONS, but in relocation.tsx this result is used for API data-fetching — querying /relocations/ and /publickeys/relocations/ across all regions. The old code used ConfigStore.get('regions') (unfiltered). Now, existing relocations on US2 won't be detected (so users won't be redirected to the in-progress page and could attempt a second relocation), and public keys for US2 won't be fetched. The UI-display filter is being incorrectly applied to backend data-fetching logic. This call site needs unfiltered regions (e.g. via getRegions()), not the customer-facing dropdown options.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit a57167b. Configure here.

const regions = ConfigStore.get('regions').filter(region =>
selectableRegions.includes(region.name)
);
const regionOptions = getRegionUrlOptions([], selectableRegions);
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.

Empty selectableRegions now shows all regions instead of none

Medium Severity

When selectableRegions is an empty array (e.g., when relocationConfig is undefined), the old code filtered to an empty list since no region matched the whitelist. The new call getRegionUrlOptions([], selectableRegions) passes an empty only array, which triggers the only.length > 0 short-circuit in the filter, causing all regions to be shown. This changes the semantics from "nothing is selectable" to "everything is selectable" when relocation config is missing.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit a57167b. Configure here.

const regionChoices = getRegionChoices(currentRegionData ? [currentRegionData] : []);
const regionOptions = getRegionUrlOptions(
currentRegionData ? [currentRegionData] : []
);
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.

Admin fork dropdown incorrectly hides US2 region

Medium Severity

The admin "Duplicate into Region" dropdown in forkCustomer.tsx now uses getRegionUrlOptions(), which filters out US2 via CUSTOMER_HIDDEN_REGIONS. This is an internal admin tool (gsAdmin/), not a customer-facing view. The PR title specifies hiding US2 in "customer facing dropdowns," but this change also prevents admins from forking organizations into US2.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit a57167b. Configure here.

const stepIndex = onboardingSteps.findIndex(({id}) => stepId === id);
const api = useApi();
const regions = ConfigStore.get('regions');
const regionOptions = getRegionUrlOptions();
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.

Bug: The new getRegionUrlOptions() function incorrectly filters out hidden regions like us2, breaking admin tools and failing to detect existing relocations in those regions.
Severity: HIGH

Suggested Fix

The getRegionUrlOptions function should accept an optional parameter to include hidden regions, e.g., includeHidden: true. This parameter should be used in internal tools and system checks like forkCustomer.tsx and fetchExistingRelocation that require a complete list of all regions. The default behavior for customer-facing UIs can remain as is.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: static/app/views/relocation/relocation.tsx#L79

Potential issue: The new `getRegionUrlOptions()` utility function filters out regions
defined in `CUSTOMER_HIDDEN_REGIONS`, which includes `us2`. This function is now used in
two places where a complete list of all regions is required. First, in the admin tool
`forkCustomer.tsx`, it prevents admins from forking customer data into the `us2` region.
Second, in `relocation.tsx`, it prevents the `fetchExistingRelocation` check from
querying the `us2` region. This could lead to a user with an active relocation in `us2`
being able to start a new, conflicting relocation, as the system would fail to detect
the existing one.

Also affects:

  • static/gsAdmin/components/forkCustomer.tsx:68

Did we get this right? 👍 / 👎 to inform future reviews.

Copy link
Copy Markdown
Member

@GabeVillalobos GabeVillalobos left a comment

Choose a reason for hiding this comment

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

The change itself looks good, though I do wonder if we should be filtering out these regions from the API-side. Alternatively, could we do some of the locality surfacing work up front to obscure these choices, while we set org provisioning via control instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants