feat: @W-22861359 add jp1 region preset to portal try-it auth panel#127
Draft
leandrogilcarrano wants to merge 4 commits into
Draft
feat: @W-22861359 add jp1 region preset to portal try-it auth panel#127leandrogilcarrano wants to merge 4 commits into
leandrogilcarrano wants to merge 4 commits into
Conversation
This reverts commit 9c586ad.
- Add jp1 as static option in regionPreset select (visible only when serverType=platform)
- Declare enum [ca1, jp1] on variables.region in 27 specs that expose {region}.platform.mulesoft.com
- Extract restoreServerSelectionFromSessionStorage() so tests can invoke production restore directly
- Add 4 Jest tests covering visibility toggle, base URL, and sessionStorage round-trip
Note: original plan to centralize via shared $ref fragment was abandoned —
OpenAPI 3.0 forbids $ref inside servers[].variables (rejected by AMF).
…y default After review with the team: - Revert the inline `enum: [ca1, jp1]` on 27 specs. OpenAPI 3.0 forbids `$ref` inside `servers[].variables.<var>`, so we cannot centralize regions in a shared fragment; and adding `enum` per-spec means every new region forces touching every spec. Cost outweighs benefit while the cardinality is small. - Move the source of truth for known regions to `REGIONS_BY_HOST` in `portal.js` (anypoint: [eu1], platform: [ca1, jp1]). New regions = edit one constant. - Hide the `jp1` option in the auth modal by default (`<option ... hidden>`). `onServerChange` reveals it only when serverType is `platform` (the only domain where `jp1` exists), preventing the invalid `jp1.anypoint.mulesoft.com` combination. - Replace the per-operation server combobox with a plain text URL bar that reflects the active server/region from the auth modal. Selecting a different region requires re-login anyway, so a per-operation override added complexity without value. - Add Jest test for the default-hidden initial state (208 total tests).
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
Regional (platform.mulesoft.com)server type.enum: [ca1, jp1]on thevariables.regionblock of every API spec that exposes{region}.platform.mulesoft.com(27 specs).restoreServerSelectionFromSessionStorage()from the IIFE inportal.jsso tests can invoke the real production restore logic.Why not a shared
\$reffragment?The original ask was to centralize the duplicated
servers:block into a shared OAS fragment. OpenAPI 3.0 does NOT allow\$refinsideservers[].variables.<var>—Server Variable Objectis not aReference Objectper the spec, and AMF (the governed validator) rejects every spec that uses it there withserver-variable-missing-default+ missing-description errors. Verified empirically — see audit trail indocs/sdd/changes/jp1-region-shared-servers/migration-classification.mdfor the full pivot rationale, including a tracking table of which 27 specs got jp1 and which 9 are out of scope.Validation
make test-portal→ 206/206 passing (202 baseline + 4 new jp1 tests).make validate-all-governed→ 35 passed, 0 failed, 1 skipped (anypoint-api-governance, pre-existing skip).apis/api-managerandapis/api-portal-xapi→ 0 violations.Out of scope (follow-up WI candidates)
The analyzer flagged 4 latent UX gaps that are NOT regressions of this change but worth tracking:
serverType=eu+ storedregion=jp1)onServerChangeclobbers user's jp1 selection on serverType togglejp1while EU is selectedoption.hiddenvs surroundingstyle.displayconventionTest plan