Skip to content

TRT-1963: Sippy FeatureGate readiness dashboard is not filtering failures/flakes for the "2 day time period" - its showing older data as well#3754

Open
openshift-trt-agent[bot] wants to merge 3 commits into
openshift:mainfrom
openshift-trt:trt-1963

Conversation

@openshift-trt-agent

@openshift-trt-agent openshift-trt-agent Bot commented Jul 9, 2026

Copy link
Copy Markdown

Summary

Fixes TRT-1963: The "2 day" period filter on the tests page was not propagated when navigating to linked pages (Test Analysis, Job Runs). Users selecting the twoDay period and clicking on test names, flake icons, or failure icons would see data from a wider time range (7 days or 30 days), defeating the purpose of the period filter.

Changes:

  • helpers.js: Renamed last7DaysFilter() to timestampFilterForPeriod(period) so job runs timestamp filters use a 2-day or 7-day window based on the active period. Added an optional period parameter to pathForExactTestAnalysis, pathForExactTestAnalysisWithFilter, pathForJobRunsWithTest, pathForJobRunsWithTestFailure, and pathForJobRunsWithTestFlake to append the period to generated URLs.
  • TestTable.js: Passes the current period value to all link-generating helper function calls (test name links, bugs links, failure icon links, flake icon links).
  • TestAnalysis.js: Reads period from URL query params, passes it to the API call so the backend returns period-appropriate data, forwards it to "All Runs"/"Failed Runs"/"Flaked Runs" button links, passes it to the embedded TestTable component, and updates the SummaryCard label to show "2 Day Overall" when appropriate.

Test Plan

  • make lint passes with 0 issues
  • make test (Jest + Go tests) passes
  • Verified in browser: navigating to test details page with period=twoDay generates links that include &period=twoDay (confirmed via DOM inspection)
  • Existing callers that don't pass period continue to work with the default 7-day behavior (parameter is optional, defaults to 7 days)

Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added a selectable time period for test analysis and job-run views.
    • Updated navigation links to preserve the selected period across related pages.
    • Made summary labels and instructions period-aware (2-day vs 7-day).
  • Bug Fixes
    • Updated job-run filtering to use period-based time ranges instead of a fixed 7-day window.
    • Fixed drill-down links and analysis requests to include the selected period (when not set to the default).

When a user selects the "2 day" period on the tests page and clicks
links to Test Analysis or Job Runs pages, the period was not carried
over, causing those pages to show data from a wider (7-day or 30-day)
time range. This fixes the usability issue by propagating the period
parameter through all navigation paths:

- Helper functions (pathForExactTestAnalysis*, pathForJobRunsWith*)
  now accept an optional period parameter
- The timestamp filter for job runs uses 2-day or 7-day window based
  on the period
- TestTable passes the current period to all generated links
- TestAnalysis reads period from URL params, passes it to the API,
  and forwards it to job runs links and the embedded TestTable

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: automatic mode

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 9, 2026
@openshift-ci openshift-ci Bot added the ready-for-human-review Indicates a PR has been reviewed by automated tools and is ready for human review label Jul 9, 2026
@openshift-ci-robot

openshift-ci-robot commented Jul 9, 2026

Copy link
Copy Markdown

@openshift-trt-agent[bot]: This pull request references TRT-1963 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Summary

Fixes TRT-1963: The "2 day" period filter on the tests page was not propagated when navigating to linked pages (Test Analysis, Job Runs). Users selecting the twoDay period and clicking on test names, flake icons, or failure icons would see data from a wider time range (7 days or 30 days), defeating the purpose of the period filter.

Changes:

  • helpers.js: Renamed last7DaysFilter() to timestampFilterForPeriod(period) so job runs timestamp filters use a 2-day or 7-day window based on the active period. Added an optional period parameter to pathForExactTestAnalysis, pathForExactTestAnalysisWithFilter, pathForJobRunsWithTest, pathForJobRunsWithTestFailure, and pathForJobRunsWithTestFlake to append the period to generated URLs.
  • TestTable.js: Passes the current period value to all link-generating helper function calls (test name links, bugs links, failure icon links, flake icon links).
  • TestAnalysis.js: Reads period from URL query params, passes it to the API call so the backend returns period-appropriate data, forwards it to "All Runs"/"Failed Runs"/"Flaked Runs" button links, passes it to the embedded TestTable component, and updates the SummaryCard label to show "2 Day Overall" when appropriate.

Test Plan

  • make lint passes with 0 issues
  • make test (Jest + Go tests) passes
  • Verified in browser: navigating to test details page with period=twoDay generates links that include &period=twoDay (confirmed via DOM inspection)
  • Existing callers that don't pass period continue to work with the default 7-day behavior (parameter is optional, defaults to 7 days)

Generated with Claude Code

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci Bot requested review from deads2k and xueqzhan July 9, 2026 19:20
@openshift-ci

openshift-ci Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: openshift-trt-agent[bot]
Once this PR has been reviewed and has the lgtm label, please assign neisw for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jul 9, 2026
@openshift-ci

openshift-ci Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Hi @openshift-trt-agent[bot]. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@@ -81,10 +82,14 @@ export function TestAnalysis(props) {
}

const filter = safeEncodeURIComponent(JSON.stringify(filterModel))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Did you consider adding the period to the filterModel? Is there a reason why this cannot be done? Is it used in too many places that don't require it? Are there other similar params there?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Good question. The filterModel is structured as a DataGrid-style filter with items that have columnField, operatorValue, and value — it maps to column-based filters like name and variants. The period parameter is fundamentally different: it controls the time range for the query (e.g. twoDay vs the default 7-day window), not a column filter. On the API side, filter and period are handled as separate query parameters (see TestTable.js lines 930-945 where they are appended independently). Embedding period in filterModel would conflate two different concerns — the filter toolbar UI (GridToolbarFilterMenu) would need special-casing to handle a non-column parameter, and the API deserialization would need to extract it back out. Keeping them separate is cleaner and consistent with how other non-filter params like sortField, sort, limit, and overall are handled.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

To follow up on this: I verified the approach and it is the right one. The filterModel is designed for DataGrid column filters (columnField/operatorValue/value items rendered by GridToolbarFilterMenu), while period is a query-level parameter like sortField, sort, limit, and overall — all of which are handled as separate query params rather than filter items. Mixing them would require special-casing in both the filter UI and the API deserialization layer.

I also fixed a missing period dependency in the setPageContextForChat useEffect — the period variable was used in the instructions template literal but was not listed in the dependency array.

@smg247

smg247 commented Jul 9, 2026

Copy link
Copy Markdown
Member

@coderabbitai review

@smg247

smg247 commented Jul 9, 2026

Copy link
Copy Markdown
Member

/ok-to-test

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@openshift-ci openshift-ci Bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 9, 2026
@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 0a1ae123-5b1f-477e-9531-753d54949c09

📥 Commits

Reviewing files that changed from the base of the PR and between 4d54acf and f7a91db.

📒 Files selected for processing (1)
  • sippy-ng/src/tests/TestAnalysis.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • sippy-ng/src/tests/TestAnalysis.js

Walkthrough

Adds period-aware test analysis state, API requests, labels, and navigation URLs. Helper builders now accept period, append it to analysis links, and select two-day or seven-day job-run timestamp filters. TestAnalysis and TestTable propagate the selected period.

Changes

Period-aware test analysis

Layer / File(s) Summary
Period state and data loading
sippy-ng/src/tests/TestAnalysis.js
Reads the period query parameter, appends non-default values to /api/tests, reloads data when the period changes, and updates context and summary labels.
Period-aware URL and time-window helpers
sippy-ng/src/helpers.js
Path builders append period values to analysis URLs and use two-day or seven-day timestamp filters for job-run URLs.
Navigation link propagation
sippy-ng/src/tests/TestAnalysis.js, sippy-ng/src/tests/TestTable.js
Analysis, bug, failed-run, and flaked-run links pass through the selected period; TestAnalysis also passes it to TestTable.

Estimated code review effort: 2 (Simple) | ~12 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Browser
  participant TestAnalysis
  participant API
  participant helpers
  participant TestTable
  Browser->>TestAnalysis: provide period query parameter
  TestAnalysis->>API: fetch test data with optional period
  API-->>TestAnalysis: return test analysis data
  TestAnalysis->>helpers: build period-aware navigation URLs
  TestAnalysis->>TestTable: pass selected period
  TestTable->>helpers: build analysis and job-run links
Loading
🚥 Pre-merge checks | ✅ 20 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Test Coverage For New Features ⚠️ Warning Only one JS test file exists (CompReadyUtils.test.js), and none target the new period-aware helpers/TestAnalysis/TestTable behavior. Add regression tests for timestampFilterForPeriod and period propagation in TestAnalysis/TestTable link builders, including twoDay/default cases.
✅ Passed checks (20 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the core fix: preserving the 2-day period filter so older failure/flake data no longer appears.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Go Error Handling ✅ Passed No Go files changed in the PR; the diff only touches sippy-ng JS/UI code, so Go error-handling patterns aren’t implicated.
Sql Injection Prevention ✅ Passed Touched files only build URLs and HTTP fetch params; no SQL strings, DB queries, or concatenated SQL were added.
Excessive Css In React Should Use Styles ✅ Passed The commit only adds period to a dependency array; no new large inline style objects were introduced in the PR diff.
Single Responsibility And Clear Naming ✅ Passed PASS: The PR stays within focused URL-builder helpers and the TestAnalysis/TestTable test flow; new names like timestampFilterForPeriod and period are explicit and specific.
Feature Documentation ✅ Passed No docs/features page covers this tests-page period/navigation change; the only feature doc is unrelated job-analysis symptoms, and no docs files changed in the PR.
Stable And Deterministic Test Names ✅ Passed The only changed file is a React component; no Ginkgo test titles or dynamic test-name changes were introduced.
Test Structure And Quality ✅ Passed PASS: The PR only changes frontend JS; no Go/Ginkgo test files were modified, so the Ginkgo test quality criteria are not applicable.
Microshift Test Compatibility ✅ Passed PR only changes a React JS file; no new Ginkgo e2e tests or MicroShift-unsafe OpenShift API usage were added.
Single Node Openshift (Sno) Test Compatibility ✅ Passed PR only changes JS frontend files; diff contains no Go/Ginkgo e2e specs, so SNO multi-node assumptions are not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed Only UI JS files changed; no manifests, controllers, or scheduling constraints were introduced.
Ote Binary Stdout Contract ✅ Passed Touched files are only sippy-ng browser JS; no main/init/TestMain/suite setup code or stdout writes were added.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed Only sippy-ng/src/tests/TestAnalysis.js changed; no new Ginkgo e2e tests or network/IP assumptions were added, so the check is not applicable.
No-Weak-Crypto ✅ Passed Touched files only add period query plumbing and UI text; no MD5/SHA1/DES/RC4/3DES/Blowfish/ECB, custom crypto, or secret/token compares found.
Container-Privileges ✅ Passed Only sippy-ng/src/tests/TestAnalysis.js changed; no K8s/container manifests or privilege flags were added.
No-Sensitive-Data-In-Logs ✅ Passed Touched files add no logging of secrets/PII; diff search found no console/logger calls, and the only nearby log was unrelated.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@sippy-ng/src/helpers.js`:
- Line 163: Remove the stray debug logging from pathForExactTestAnalysis in
helpers.js by deleting the console.log(excludedVariants) statement. Keep the
rest of the excludedVariants handling unchanged and ensure no other temporary
console output remains in that helper.

In `@sippy-ng/src/tests/TestAnalysis.js`:
- Around line 85-92: The page context text in setPageContextForChat is hardcoded
for the 7-day timeframe, but TestAnalysis also supports period="twoDay" via
periodParam, so the instructions can become stale. Update the
setPageContextForChat message to reflect the active period dynamically based on
the current period value, and make sure the wording changes for twoDay instead
of always describing a 7-day comparison.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 990cd1ce-bc3e-4757-a4cd-1a5f25df57c5

📥 Commits

Reviewing files that changed from the base of the PR and between 58d68e5 and 0c81b95.

📒 Files selected for processing (3)
  • sippy-ng/src/helpers.js
  • sippy-ng/src/tests/TestAnalysis.js
  • sippy-ng/src/tests/TestTable.js

Comment thread sippy-ng/src/helpers.js Outdated
Comment thread sippy-ng/src/tests/TestAnalysis.js
Remove stray console.log(excludedVariants) left in pathForExactTestAnalysis
and update setPageContextForChat instructions to dynamically reflect the
active period (2-day vs 7-day) instead of hardcoding 7-day.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e

@smg247

smg247 commented Jul 10, 2026

Copy link
Copy Markdown
Member

/test agentic-staging

@openshift-trt-agent

Copy link
Copy Markdown
Author

Sippy Staging Environment

URL: https://palestinian-ins-expenses-sms.trycloudflare.com

This environment is built from this PR and will remain available for approximately 60 minutes (until ~18:00 UTC).

…ffect

The period variable is used in the instructions template literal but was
not listed in the dependency array. This ensures the page context text
updates correctly when the period changes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. ready-for-human-review Indicates a PR has been reviewed by automated tools and is ready for human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants