Skip to content

Fix breadcrumb resolving the wrong domain for an execution - #939

Open
1fanwang wants to merge 1 commit into
flyteorg:masterfrom
1fanwang:1fannnw/breadcrumb-execution-domain
Open

Fix breadcrumb resolving the wrong domain for an execution#939
1fanwang wants to merge 1 commit into
flyteorg:masterfrom
1fanwang:1fannnw/breadcrumb-execution-domain

Conversation

@1fanwang

@1fanwang 1fanwang commented Aug 13, 2026

Copy link
Copy Markdown

TL;DR

getExecutionSpecProjectDomain decides which domain a breadcrumb link should point at. The domain branch compares breadcrumb.projectId against the execution's domain:

const project =
  breadcrumb.projectId === executionSpecIdentifier.project     // project vs project
    ? breadcrumb.projectId
    : executionSpecIdentifier.project;
const domain =
  breadcrumb.projectId === executionSpecIdentifier.domain      // project vs domain
    ? breadcrumb.domainId
    : executionSpecIdentifier.domain;

The project branch above compares project to project, so the domain branch is reading the wrong field.

It matters when a project is named after a domain, which is easy to end up with — a project called production, staging or development. The comparison then succeeds and the breadcrumb resolves to whichever domain the user is currently browsing instead of the execution's own. Browsing project production / domain staging, an execution that lives in production produces:

- domain: "production"
+ domain: "staging"

Type

  • Bug Fix
  • Feature
  • Plugin

Are all requirements met?

  • Code completed
  • Smoke tested
  • Unit tests added
  • Code documentation added
  • Any pending items have an associated Issue

Complete description

Compare breadcrumb.domainId to the execution's domain, matching the project branch directly above.

Added getExecutionSpecProjectDomain.test.ts covering the ordinary case and the project-named-after-a-domain case. The second fails without the change:

yarn jest packages/oss-console/src/components/Breadcrumbs/
Raw output

Before:

FAIL packages/oss-console/src/components/Breadcrumbs/async/utils/tests/getExecutionSpecProjectDomain.test.ts
  ● getExecutionSpecProjectDomain › returns the execution domain when a project is named after a domain

    expect(received).toEqual(expected) // deep equality

    - Expected  - 1
    + Received  + 1

      Object {
    -   "domain": "production",
    +   "domain": "staging",
        "project": "my-project",
      }

Tests:       1 failed, 1 passed, 2 total

After, running every Breadcrumbs suite:

Test Suites: 8 passed, 8 total
Tests:       31 passed, 31 total
Time:        9.192 s

The repo's own CI jobs, run locally (yarn run lint, NODE_ENV=test yarn run jest):

✖ 123 problems (0 errors, 123 warnings)

Test Suites: 1 skipped, 85 passed, 85 of 86 total
Tests:       3 skipped, 1084 passed, 1087 total
Time:        140.45 s

The lint warnings are pre-existing and none are in the files this touches.

Tracking Issue

NA

Follow-up issue

NA

…cution's domain

getExecutionSpecProjectDomain tests breadcrumb.projectId against the execution's
domain when deciding which domain to use. The project branch above it compares
projectId to project, so the domain branch is comparing the wrong field.

When a project happens to be named after a domain, the comparison succeeds and
the breadcrumb resolves to whatever domain the user is currently browsing rather
than the execution's own.

Signed-off-by: 1fanwang <1fannnw@gmail.com>
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.

1 participant