-
Notifications
You must be signed in to change notification settings - Fork 131
WIP: Rework feature gate test filtering to cover component owned jobs #3731
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,7 +15,6 @@ import { | |
| findFirstNonGARelease, | ||
| getReportStartDate, | ||
| getUrlWithoutParams, | ||
| pathForTestSubstringByVariant, | ||
| relativeTime, | ||
| } from './helpers' | ||
| import { JobAnalysis } from './jobs/JobAnalysis' | ||
|
|
@@ -46,6 +45,7 @@ import CollapsibleChatDrawer from './chat/CollapsibleChatDrawer' | |
| import ComponentReadiness from './component_readiness/ComponentReadiness' | ||
| import Drawer from '@mui/material/Drawer' | ||
| import EventsChart from './prow_job_runs/EventsChart' | ||
| import FeatureGateDetail from './tests/FeatureGateDetail' | ||
| import FeatureGates from './tests/FeatureGates' | ||
| import IconButton from '@mui/material/IconButton' | ||
| import Install from './releases/Install' | ||
|
|
@@ -259,16 +259,17 @@ const JobsWrapper = () => { | |
| ) | ||
| } | ||
|
|
||
| const FeatureGateRedirectWrapper = () => { | ||
| const FeatureGateDetailWrapper = () => { | ||
| let { release, feature_gate } = useParams() | ||
| if (release === 'latest') { | ||
| release = findFirstNonGARelease(React.useContext(ReleasesContext)) | ||
| } | ||
|
|
||
| return ( | ||
| <Navigate | ||
| to={pathForTestSubstringByVariant(release, 'FeatureGate:' + feature_gate)} | ||
| replace | ||
| return RedirectLatestReleaseWrapper( | ||
| <FeatureGateDetail | ||
| key={'fg-detail-' + release + '-' + feature_gate} | ||
| release={release} | ||
| featureGate={feature_gate} | ||
| /> | ||
| ) | ||
| } | ||
|
Comment on lines
+262
to
275
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Inspect other usages of RedirectLatestReleaseWrapper on multi-segment routes
# to confirm whether this relative-navigation pattern is already known/handled elsewhere.
rg -n -B3 -A15 'RedirectLatestReleaseWrapper' sippy-ng/src/App.jsRepository: openshift/sippy Length of output: 5644 🏁 Script executed: #!/bin/bash
set -euo pipefail
# Inspect the feature gate routes and the wrapper implementation in context.
sed -n '150,310p' sippy-ng/src/App.js
printf '\n--- package version ---\n'
jq -r '.dependencies["react-router-dom"] // .devDependencies["react-router-dom"] // empty' sippy-ng/package.jsonRepository: openshift/sippy Length of output: 4466 🏁 Script executed: #!/bin/bash
set -euo pipefail
# Find the feature gate route definitions and any navigation helpers tied to them.
rg -n -A4 -B4 'FeatureGateDetailWrapper|FeatureGatesWrapper|feature_gate|feature-gates|feature_gates' sippy-ng/src/App.jsRepository: openshift/sippy Length of output: 1476 🏁 Script executed: #!/bin/bash
set -euo pipefail
# Look for the actual feature-gate route path in the router config.
rg -n -A3 -B3 'FeatureGateDetail|featureGate|feature-gates|feature_gates' sippy-ng/src/App.jsRepository: openshift/sippy Length of output: 1486 🏁 Script executed: #!/bin/bash
set -euo pipefail
# Inspect the router table around the feature gate routes.
rg -n -A8 -B8 'FeatureGateDetailWrapper|FeatureGatesWrapper|Route path=.*feature|<Route' sippy-ng/src/App.jsRepository: openshift/sippy Length of output: 7265 🌐 Web query:
💡 Result: In React Router v6, the useNavigate hook (and Link component) provides the relative option to control how relative paths, such as "../", are resolved [1][2]. By default, React Router v6 uses relative: "route" [1]. In this mode, ".." navigates up one level in the route hierarchy, effectively traversing the nested route tree rather than the URL string segments [2][3]. When you specify relative: "path", React Router switches to path-based resolution [1]. In this mode, ".." behaves similarly to a command-line "cd" operation, removing exactly one segment from the current URL path [1][2]. Key points regarding this behavior: - Scope: The relative: "path" option only impacts how the relative path string is resolved [1]. It does not change the "starting" location, which is always the route where the hook is called (or where the Link is rendered) [1][2]. - Difference from standard URL resolution: Because React Router's default behavior is based on the route hierarchy, it can sometimes produce results that differ from standard browser link behavior if your route structure does not align perfectly with your URL segments [1][3]. - Usage Example: navigate("..", { relative: "path" }); If you require resolution against the literal current URL path regardless of the route hierarchy, the recommended approach is to use the current location and the browser's URL constructor [1][2]: let location = useLocation; new URL("..", window.origin + location.pathname); Citations:
🌐 Web query:
💡 Result: In React Router v6.30.3, the useNavigate hook supports relative path segments (such as "../") for navigation [1][2]. There is no "feature_gate" required or present to enable this base functionality, as it is a core feature of the library [1]. Key behavioral details for relative paths in v6.30.3: Default Behavior (Route Hierarchy): By default, navigation is relative to the route hierarchy [1]. Using ".." in the navigate function will move the user up one level in the defined route structure, not necessarily one segment in the URL path [1][2]. Path-Relative Routing: If you want ".." to resolve relative to the actual URL path segments (e.g., to navigate to a sibling route), you can opt into this behavior by passing the relative: "path" option to the navigate function [1][3]: navigate("..", { relative: "path" }); Important Considerations: 1. The relative: "path" option only impacts how the relative path is resolved; it does not change the starting location, which remains tied to the route hierarchy where the hook is called [1][4]. 2. Splat Paths: While there is no feature gate for general "../" functionality, React Router does include a future flag named future.v7_relativeSplatPath, which affects how relative paths (including "..") resolve when inside splat routes [3][5]. This flag was introduced to fix legacy, buggy behavior regarding splat path resolution and is recommended for preparing applications for v7, but it is not a gate for the core ability to use "../" in navigation [5]. resolvePath: The resolvePath utility function follows similar resolution logic and is used internally by React Router components and hooks (like useResolvedPath) to resolve relative paths [6][7][8]. Citations:
🤖 Prompt for AI Agents |
||
|
|
@@ -713,7 +714,7 @@ function App(props) { | |
|
|
||
| <Route | ||
| path="/feature_gates/:release/:feature_gate" | ||
| element={<FeatureGateRedirectWrapper />} | ||
| element={<FeatureGateDetailWrapper />} | ||
| /> | ||
|
|
||
| <Route | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: openshift/sippy
Length of output: 153
🏁 Script executed:
Repository: openshift/sippy
Length of output: 18733
🏁 Script executed:
Repository: openshift/sippy
Length of output: 50372
🏁 Script executed:
Repository: openshift/sippy
Length of output: 20233
🏁 Script executed:
Repository: openshift/sippy
Length of output: 12971
🏁 Script executed:
Repository: openshift/sippy
Length of output: 1594
🏁 Script executed:
Repository: openshift/sippy
Length of output: 562
🏁 Script executed:
Repository: openshift/sippy
Length of output: 587
🏁 Script executed:
Repository: openshift/sippy
Length of output: 713
🏁 Script executed:
Repository: openshift/sippy
Length of output: 983
Include both feature-gate tag forms
tests_by_annotationonly matchesFeatureGate:%s], but the data also carriesOCPFeatureGate:%s]tags, so this link can miss valid tests.tests_by_capabilityshould use exact array membership (has entry) instead ofcontains; array filtering here is substring-based, so prefix collisions can pull in unrelated tests.🤖 Prompt for AI Agents