Fix breadcrumb resolving the wrong domain for an execution - #939
Open
1fanwang wants to merge 1 commit into
Open
Conversation
…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>
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.
TL;DR
getExecutionSpecProjectDomaindecides which domain a breadcrumb link should point at. The domain branch comparesbreadcrumb.projectIdagainst the execution's 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,stagingordevelopment. The comparison then succeeds and the breadcrumb resolves to whichever domain the user is currently browsing instead of the execution's own. Browsing projectproduction/ domainstaging, an execution that lives inproductionproduces:Type
Are all requirements met?
Complete description
Compare
breadcrumb.domainIdto the execution's domain, matching the project branch directly above.Added
getExecutionSpecProjectDomain.test.tscovering the ordinary case and the project-named-after-a-domain case. The second fails without the change:Raw output
Before:
After, running every Breadcrumbs suite:
The repo's own CI jobs, run locally (
yarn run lint,NODE_ENV=test yarn run jest):The lint warnings are pre-existing and none are in the files this touches.
Tracking Issue
NA
Follow-up issue
NA