Skip to content

fix(web): use environment defaults in canary creation - #97

Merged
aceforeverd merged 2 commits into
modelsphere:release-canaryfrom
primowenjoy:fix/canary-environment-defaults
Oct 25, 2026
Merged

aceforeverd merged 2 commits into
modelsphere:release-canaryfrom
primowenjoy:fix/canary-environment-defaults

Conversation

@primowenjoy

@primowenjoy primowenjoy commented Oct 23, 2026 •

Copy link
Copy Markdown

What type of PR is this?

  • feature

What this PR does and why

North Star experiment authors currently pass through a read-only Gateway step and configure route infrastructure that already belongs to the environment. Remove the Gateway step and hide the HTTPRoute switch, dispatch port, force-header inputs and proxy Helm values editor. The route step retains the inherited path and production Service.

New drafts enable HTTPRoute, use x-canary: force, and omit the port override and proxy values so the backend uses environment defaults. Route readiness still validates Gateway configuration and explains missing environment settings in English and Chinese.

Which issue(s) this PR fixes

Fixes #95

How it was tested

  • npm run typecheck, npm test (480 tests), and npm run build in web/ passed.
  • go test ./..., go vet ./..., and formatting/diff checks passed.
  • Regression coverage checks defaults through target switching and CR emission, plus missing Gateway validation after removal of its step.
  • Deployed the tested commit to the test environment using its existing chart and values. Server-side Helm preview confirmed only the Console image changed; both replicas are ready on the pinned image digest.
  • Chrome verified five steps (Target → Arms → Traffic → Route → Review), no Gateway step, and a route page containing only the inherited path and production Service. The browser's actual prepare request enabled routing, sent x-canary: force, and omitted port/proxy-values overrides; creation returned HTTP 202.
  • The catalog's Mock image was unavailable. Stopped and cleaned that temporary experiment, then replayed the browser draft with an existing working Mock image in the arm edit layer and production/canary weights 100/0. Environment Gateway, proxy values and route defaults were retained.
  • The corrected Mock experiment reached Serving with both arms ready and observed generation 2. Its HTTPRoute was Accepted and ResolvedRefs, used the environment dispatch port 8080 and contained the exact force-header match. A request through the Gateway with x-canary: force returned HTTP 200 and a completion.
  • Captured before/after route screenshots and a Chinese Serving detail screenshot locally. Both temporary experiments are stopped, fully cleaned and archived; their HTTPRoutes and workloads are gone. The temporary test user, role and binding were removed.

Checks

  • go test ./... and gofmt -l . is empty
  • npm run typecheck && npm test && npm run build in web/
  • helm lint --strict helm/console (chart unchanged)
  • English/Chinese wizard guidance updated
  • No internal hostnames, IPs, registries or credentials

Notes for reviewers

Targets release-canary, which contains the Canary module and is the basis of the test deployment. main does not yet contain this module. Existing experiments retain their frozen configurations.

Release note

North Star experiment creation now uses environment Gateway and routing defaults automatically, enables HTTPRoute, and sets the force header to x-canary: force.

Remove the Gateway step and route infrastructure editors. New experiments enable HTTPRoute with x-canary: force and inherit the environment dispatch port and proxy values.

Fixes modelsphere#95
@aceforeverd
aceforeverd requested review from huskcass and removed request for huskcass October 25, 2026 06:10

@huskcass huskcass left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

No blockers at 770edd8. Typecheck and the canary tests pass locally.

Medium: with route.enabled now defaulting to true and the default 90:10 split, creating an experiment sends real traffic on that path to the canary as soon as the arms are ready. The wizard no longer offers a route-off option, and the detail page can't turn the route off either, so Stop is the only way out. That matches #95, but the review step should probably call it out more clearly than the route.enabled=true summary text.

Low:

  • needRoute lists Gateway, path and Service, but the Gateway values aren't shown on any step now, so users can't tell which one is missing. Showing the Gateway name and namespace read-only on the route step (or naming the missing field) would help.
  • The x-canary: force header is fixed in the UI rather than taken from the environment like the other route settings.
  • Several locale keys are now unused (stepGateway, gatewayHint, needGateway, routeEnabled*, proxyValues*, hostnameHint, sectionHint, servicePortHint).

Verdict: good to merge. The Medium is a UX call, not a correctness bug.

— Review Golden

@aceforeverd
aceforeverd requested a review from huskcass October 25, 2026 07:21

@huskcass huskcass left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Re-review at 6bcf6ca (merge of release-canary, bringing in #96 and #99).

No blockers. The PR's own diff is unchanged from 770edd8. The only conflict was create.armsHint in locales.ts, which kept this PR's text.

Low: that resolution drops #99's new hint ("Choose a catalog, then a model and variant for each arm. The default catalog is upstreamv2 when available." and the zh text), so the Arms step no longer mentions per-arm catalog selection or the upstreamv2 default. Consider merging both sentences.

Typecheck and vitest (508 tests) pass at this head. The medium from the last round still applies: the route is on by default, so a 90:10 split serves live traffic as soon as the arms are ready.

Verdict: good to merge once the hint text is settled.

— Review Golden

@aceforeverd
aceforeverd merged commit 4feac39 into modelsphere:release-canary Oct 25, 2026
4 checks passed
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.

3 participants