Skip to content

TRT-2364: Fix timestamp and date type inconsistencies#3716

Open
mstaeble wants to merge 1 commit into
openshift:mainfrom
mstaeble:trt-2364-timestamp-consistency
Open

TRT-2364: Fix timestamp and date type inconsistencies#3716
mstaeble wants to merge 1 commit into
openshift:mainfrom
mstaeble:trt-2364-timestamp-consistency

Conversation

@mstaeble

@mstaeble mstaeble commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Replace epoch millisecond integers with proper TIMESTAMP WITH TIME ZONE and DATE types across the database schema, API layer, and frontend
  • Enforce UTC timezone on all PostgreSQL connections
  • Use civil.Date for date-only fields (GA dates, development start dates, CountByDate, CalendarEvent)
  • Change CalendarEvent.Start/End from string to time.Time
  • Change ChatConversationResponse.CreatedAt from string to time.Time
  • Change JobRun.Timestamp from int to time.Time (RFC 3339 in JSON)
  • Use ISO 8601 strings for timestamp filter values (frontend and backend)
  • Remove epoch extraction from SQL filters; compare timestamptz directly
  • Fix pre-existing bug: /api/jobs failed when timestamp filters were present (added filter.StripJobRunFilters)
  • Rewrite JobsDetail day bucketing with Temporal.PlainDate
  • Add timestamp/date type guidelines to project instructions
  • Update API docs to show RFC 3339 and YYYY-MM-DD formats

Note: Production databases should also have their default timezone set to UTC via ALTER DATABASE <name> SET timezone = 'UTC'.

Depends on (will need conflict resolution):

Test plan

  • make lint passes
  • make test passes (Go + JS + MCP)
  • make verify-apm passes
  • Independent code review (isolated sub-agent, two rounds)

Manual verification against staging-2 (prod database clone)

Ran sippy migrate and sippy refresh against a clone of the production database, then served locally with --data-provider postgres.

API responses verified:

  • /api/jobs/runs - timestamp is RFC 3339 string (was epoch ms integer)
  • /api/releases - ga_dates are YYYY-MM-DD, dates.ga are YYYY-MM-DD, last_updated is RFC 3339
  • /api/jobs/details - start/end are YYYY-MM-DD (civil.Date), JobRunResult.timestamp is RFC 3339
  • /api/tests/analysis/overall - CountByDate.date is YYYY-MM-DD (civil.Date)
  • /api/releases/tags/events - CalendarEvent.start is RFC 3339
  • /api/incidents - CalendarEvent.start/end are RFC 3339

UI pages verified:

  • Job runs table renders timestamps correctly, sorting and filtering work
  • Job analysis day/hour toggle works (found and fixed pre-existing StripJobRunFilters bug)
  • Build cluster details page loads with timestamp filter
  • Release payloads calendar renders tags on correct dates
  • Component Readiness - skipped (pre-existing Suite variant error with postgres data provider, unrelated to this PR)
  • JobsDetail day bucketing - skipped (dead code since April 2022, no UI route)
  • E2E tests

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Job details, releases, job runs, and test analysis now expose timestamps as ISO-8601/RFC 3339 and dates as YYYY-MM-DD consistently across API and UI views.
    • Frontend grid/chart filtering and rendering now standardize date handling using proper date objects.
  • Bug Fixes
    • Improved UTC-consistent date calculations, report-window boundaries, and day bucketing.
    • Timestamp filtering now correctly interprets ISO-8601 values end-to-end.
  • Documentation
    • Updated API examples and timestamp/date coding standards to match the new formats.
  • Chores
    • Refreshed locally deployed rule/config lock hashes.

@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 commented Jun 29, 2026

Copy link
Copy Markdown

@mstaeble: This pull request references TRT-2364 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

  • Replace epoch millisecond integers with proper TIMESTAMP WITH TIME ZONE and DATE types across the database schema, API layer, and frontend
  • Enforce UTC timezone on all PostgreSQL connections
  • Use civil.Date for date-only fields (GA dates, development start dates)
  • Change JobRun.Timestamp from int to time.Time (RFC 3339 in JSON)
  • Use ISO 8601 strings for timestamp filter values (frontend and backend)
  • Rewrite JobsDetail day bucketing with Temporal.PlainDate
  • Add timestamp/date type guidelines to project instructions

Note: Production databases should also have their default timezone set to UTC via ALTER DATABASE <name> SET timezone = 'UTC'.

Depends on (will need conflict resolution):

Test plan

  • make lint passes
  • make test passes (Go + JS + MCP)
  • make verify-apm passes
  • Manual verification: job runs table renders timestamps correctly
  • Manual verification: timestamp filter date picker works
  • Manual verification: Component Readiness GA date handling works
  • E2E tests pass

🤖 Generated with Claude Code

@coderabbitai ignore

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-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jun 29, 2026
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 29, 2026
@openshift-ci

openshift-ci Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

@openshift-ci-robot Thanks for the heads-up. This looks like a Jira metadata warning rather than a code review issue on the PR itself.

The actionable item here is for the linked story TRT-2364 to have its target version set to 5.0.0 for this branch. Once that Jira field is updated, this warning should clear.

@openshift-ci

openshift-ci Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mstaeble
Once this PR has been reviewed and has the lgtm label, please assign xueqzhan 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

@mstaeble mstaeble force-pushed the trt-2364-timestamp-consistency branch 2 times, most recently from bb354da to 0ce2e75 Compare June 30, 2026 03:33
@mstaeble

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 30, 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.

@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

The PR standardizes timestamp and date handling across backend types, database/query logic, API responses, tests, and frontend controls. It replaces epoch-millisecond and ad hoc string handling with UTC timestamps, civil dates, ISO 8601 strings, and Temporal-based date processing.

Changes

Timestamp and date normalization

Layer / File(s) Summary
Standards and examples
.apm/instructions/backend.instructions.md, .apm/instructions/frontend.instructions.md, pkg/api/README.md, apm.lock.yaml
The coding standards and API examples now describe timestamp/date representations, and the lockfile hashes for the corresponding local rule files are updated.
Public time and date types
pkg/apis/api/types.go, pkg/apis/sippy/v1/types.go, pkg/apis/sippyprocessing/v1/types.go, pkg/sippyserver/chat_conversations.go
Public structs change timestamp and date fields to time.Time, civil.Date, or related date-aware JSON shapes.
Database and release-date handling
pkg/db/db.go, pkg/db/views.go, pkg/filter/filterable.go, pkg/util/utils.go, pkg/api/componentreadiness/dataprovider/bigquery/releasedates.go, pkg/api/componentreadiness/dataprovider/postgres/provider.go, pkg/api/releases.go
The DB session timezone is forced to UTC, the materialized view emits raw timestamps, filter SQL no longer rewrites timestamp fields, and release-date helpers/providers use UTC and civil dates.
API queries and filter flow
pkg/api/job_runs.go, pkg/api/jobs.go, pkg/api/test_analysis.go, pkg/sippyserver/parameters.go, pkg/sippyserver/server.go
Job and test-analysis queries pass timestamps and civil dates directly, and server-side filter splitting no longer parses timestamp filters as integers or returns splitting errors.
Updated date fixtures
pkg/api/componentreadiness/*_test.go, pkg/api/releases_test.go, pkg/util/utils_test.go
Test fixtures now construct release dates with civil.Date helpers and literals instead of timestamp-based values.
Frontend date handling
sippy-ng/src/App.js, sippy-ng/src/build_clusters/BuildClusterDetails.js, sippy-ng/src/component_readiness/RegressedTestsPanel.js, sippy-ng/src/component_readiness/TriagedRegressionTestList.js, sippy-ng/src/datagrid/GridToolbarFilterItem.js, sippy-ng/src/datagrid/utils.js, sippy-ng/src/helpers.js, sippy-ng/src/jobs/JobRunsTable.js, sippy-ng/src/jobs/JobStackedChart.js, sippy-ng/src/jobs/JobsDetail.js
Frontend fetch, filters, tables, charts, and job detail views now use ISO 8601 strings, Date objects, and Temporal.PlainDate bucketing.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

🚥 Pre-merge checks | ✅ 19 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Test Coverage For New Features ⚠️ Warning Some paths are covered (CivilDatePtr, transformRelease, queryparamparser), but the /api/jobs filter fix and touched frontend components lack regression/unit tests. Add regression tests for StripJobRunFilters and splitJobAndJobRunFilters, plus frontend tests/snapshots for JobsDetail, JobRunsTable, GridToolbarFilterItem, and other changed components.
✅ Passed checks (19 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the PR’s main theme: fixing timestamp and date type inconsistencies across the stack.
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 PASS: New Go paths wrap errors with %w, avoid panic, and nil-check pointer fields; remaining _ ignores are pre-existing, not introduced here.
Sql Injection Prevention ✅ Passed New/changed queries use placeholders (?, @name); the only string interpolation is internal view/schema SQL, not user input.
Excessive Css In React Should Use Styles ✅ Passed No PR changes add oversized inline CSS; modified React files use useStyles or only small 1-4 prop style objects.
Single Responsibility And Clear Naming ✅ Passed The PR’s new helpers and DTOs are narrowly scoped and descriptively named; I found no newly introduced broad packages, vague methods, or bloated structs.
Feature Documentation ✅ Passed docs/features only has job-analysis-symptoms.md, and this PR’s timestamp/date and filter changes aren’t covered there, so no feature-doc update was needed.
Stable And Deterministic Test Names ✅ Passed Modified tests use static t.Run names (e.g. "empty base URL", "release with ga date"); no Ginkgo titles or runtime-built names were added.
Test Structure And Quality ✅ Passed The modified test files are standard testing.T unit tests; no Ginkgo Describe/It/Eventually blocks or cluster-resource patterns are present.
Microshift Test Compatibility ✅ Passed No new Ginkgo tests were added; changed e2e files use plain testing.T and contain no MicroShift-unsafe API refs or missing skip guards.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No new Ginkgo e2e tests were added; the touched test files are standard Go unit tests and contain no multi-node/SNO assumptions.
Topology-Aware Scheduling Compatibility ✅ Passed PR only touches docs/API/backend/frontend logic; scanned manifest-like YAMLs and found no affinity/topology-spread/nodeSelector/toleration scheduling constraints.
Ote Binary Stdout Contract ✅ Passed PR changes API/docs/frontend and library code only; no touched main/init/TestMain/BeforeSuite setup added stdout writes.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No new Ginkgo/e2e tests were added; changed test files are unit tests and contain no Describe/It/Context/When declarations.
No-Weak-Crypto ✅ Passed Changed files only alter timestamp/date handling; no MD5/SHA1/DES/RC4/3DES/Blowfish/ECB or secret-comparison code was introduced.
Container-Privileges ✅ Passed No touched manifest shows privileged/hostPID/hostNetwork/allowPrivilegeEscalation/SYS_ADMIN, and devcontainer/Dockerfiles run as vscode, not root.
No-Sensitive-Data-In-Logs ✅ Passed PASS: The PR only changes date/time handling and filter logic; I found no new logs exposing secrets or PII in the modified lines.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ 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.

@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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
sippy-ng/src/component_readiness/TriagedRegressionTestList.js (1)

215-235: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Set type: 'date' on the Last Failure column.

The valueGetter now returns a Date object, but the column lacks type: 'date', so DataGrid sorting/filtering will not treat it as a date.

♻️ Proposed change
     {
       field: 'last_failure',
       headerName: 'Last Failure',
       flex: 12,
       filterable: false,
+      type: 'date',
       valueGetter: (params) => {

As per coding guidelines: "For MUI DataGrid timestamp columns, use type: 'date' with a valueGetter that returns a Date object."

🤖 Prompt for 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.

In `@sippy-ng/src/component_readiness/TriagedRegressionTestList.js` around lines
215 - 235, The Last Failure column in TriagedRegressionTestList is returning a
Date from its valueGetter but is missing the DataGrid date type. Update the
column definition for the last_failure field to include type: 'date' so MUI
DataGrid sorts and filters it as a date; keep the existing valueGetter and
renderCell behavior unchanged.

Source: Coding guidelines

sippy-ng/src/component_readiness/RegressedTestsPanel.js (1)

215-265: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Set type: 'date' on these timestamp columns.

Both Regressed Since and Last Failure now return Date objects from valueGetter, but neither column declares type: 'date'. Per the frontend guideline, MUI DataGrid timestamp columns should use type: 'date' with a valueGetter returning a Date so sorting and any date filtering behave correctly.

♻️ Proposed change
     {
       field: 'regression',
       headerName: 'Regressed Since',
       flex: 12,
       filterable: false,
+      type: 'date',
       valueGetter: (params) => {
     {
       field: 'last_failure',
       headerName: 'Last Failure',
       flex: 12,
       filterable: false,
+      type: 'date',
       valueGetter: (params) => {

As per coding guidelines: "For MUI DataGrid timestamp columns, use type: 'date' with a valueGetter that returns a Date object."

🤖 Prompt for 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.

In `@sippy-ng/src/component_readiness/RegressedTestsPanel.js` around lines 215 -
265, The RegressedTestsPanel DataGrid columns for Regessed Since and Last
Failure return Date objects from their valueGetter functions but do not declare
the column type, so update both column definitions to use type: 'date' while
keeping the existing valueGetter logic in place. This applies to the column
objects that define field 'regression' and field 'last_failure', so sorting and
date-aware behavior work consistently with the Date values being returned.

Source: Coding guidelines

pkg/api/test_analysis.go (1)

25-43: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Anchor the overall analysis window to reportEnd.

The grouped queries use the caller-provided reportEnd, but the overall query still uses wall-clock time.Now() and has no upper bound. Historical report requests can return an overall series for a different 14-day window than the job or variant series.

Proposed fix
-		Where("date >= ?", time.Now().Add(-24*14*time.Hour)).
+		Where("date <= ?", reportEnd).
+		Where("date >= ?", reportEnd.Add(-24*14*time.Hour)).
🤖 Prompt for 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.

In `@pkg/api/test_analysis.go` around lines 25 - 43, The overall query in
GetTestAnalysisOverallFromDB is using wall-clock time instead of the
caller-provided reportEnd, so its date window can drift from the other series.
Update the time filter in GetTestAnalysisOverallFromDB to anchor the 14-day
lookback on reportEnd, and add an upper bound at reportEnd so the overall series
matches the grouped queries’ window; use the existing query builder chain in
GetTestAnalysisOverallFromDB to make the change.
🤖 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/datagrid/GridToolbarFilterItem.js`:
- Around line 107-112: The date filter update in GridToolbarFilterItem’s
onChange handler is rebuilding the filter model without carrying over
props.filterModel.not, which causes negated date filters to lose their negation
state after a picker change. Update the props.setFilterModel call in this date
value change path to preserve the existing not flag from props.filterModel
alongside columnField, operatorValue, and value so the filter behavior stays
consistent.

In `@sippy-ng/src/jobs/JobsDetail.js`:
- Around line 57-58: The job details flow in JobsDetail.js uses
Temporal.PlainDate.from directly, but the frontend does not guarantee native
Temporal support. Import the Temporal polyfill in this module (or a shared entry
point used before JobsDetail runs) and ensure the existing
setStartDate/setEndDate logic uses that polyfilled Temporal reference so opening
job details works in browsers without native support.

---

Outside diff comments:
In `@pkg/api/test_analysis.go`:
- Around line 25-43: The overall query in GetTestAnalysisOverallFromDB is using
wall-clock time instead of the caller-provided reportEnd, so its date window can
drift from the other series. Update the time filter in
GetTestAnalysisOverallFromDB to anchor the 14-day lookback on reportEnd, and add
an upper bound at reportEnd so the overall series matches the grouped queries’
window; use the existing query builder chain in GetTestAnalysisOverallFromDB to
make the change.

In `@sippy-ng/src/component_readiness/RegressedTestsPanel.js`:
- Around line 215-265: The RegressedTestsPanel DataGrid columns for Regessed
Since and Last Failure return Date objects from their valueGetter functions but
do not declare the column type, so update both column definitions to use type:
'date' while keeping the existing valueGetter logic in place. This applies to
the column objects that define field 'regression' and field 'last_failure', so
sorting and date-aware behavior work consistently with the Date values being
returned.

In `@sippy-ng/src/component_readiness/TriagedRegressionTestList.js`:
- Around line 215-235: The Last Failure column in TriagedRegressionTestList is
returning a Date from its valueGetter but is missing the DataGrid date type.
Update the column definition for the last_failure field to include type: 'date'
so MUI DataGrid sorts and filters it as a date; keep the existing valueGetter
and renderCell behavior unchanged.
🪄 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: 2edbb857-8aaf-4fc5-8ae1-8d17c2410c15

📥 Commits

Reviewing files that changed from the base of the PR and between 82be7b8 and 0ce2e75.

⛔ Files ignored due to path filters (8)
  • .claude/rules/backend.md is excluded by !.claude/**
  • .claude/rules/frontend.md is excluded by !.claude/**
  • .cursor/rules/backend.mdc is excluded by !.cursor/**
  • .cursor/rules/frontend.mdc is excluded by !.cursor/**
  • AGENTS.md is excluded by !AGENTS.md
  • CLAUDE.md is excluded by !CLAUDE.md
  • sippy-ng/AGENTS.md is excluded by !sippy-ng/AGENTS.md
  • sippy-ng/CLAUDE.md is excluded by !sippy-ng/CLAUDE.md
📒 Files selected for processing (35)
  • .apm/instructions/backend.instructions.md
  • .apm/instructions/frontend.instructions.md
  • apm.lock.yaml
  • pkg/api/README.md
  • pkg/api/componentreadiness/dataprovider/bigquery/releasedates.go
  • pkg/api/componentreadiness/dataprovider/postgres/provider.go
  • pkg/api/componentreadiness/queryparamparser_test.go
  • pkg/api/componentreadiness/triage_test.go
  • pkg/api/componentreadiness/utils/utils_test.go
  • pkg/api/job_runs.go
  • pkg/api/jobs.go
  • pkg/api/releases.go
  • pkg/api/releases_test.go
  • pkg/api/test_analysis.go
  • pkg/apis/api/types.go
  • pkg/apis/sippy/v1/types.go
  • pkg/apis/sippyprocessing/v1/types.go
  • pkg/db/db.go
  • pkg/db/views.go
  • pkg/filter/filterable.go
  • pkg/sippyserver/chat_conversations.go
  • pkg/sippyserver/parameters.go
  • pkg/sippyserver/server.go
  • pkg/util/utils.go
  • pkg/util/utils_test.go
  • sippy-ng/src/App.js
  • sippy-ng/src/build_clusters/BuildClusterDetails.js
  • sippy-ng/src/component_readiness/RegressedTestsPanel.js
  • sippy-ng/src/component_readiness/TriagedRegressionTestList.js
  • sippy-ng/src/datagrid/GridToolbarFilterItem.js
  • sippy-ng/src/datagrid/utils.js
  • sippy-ng/src/helpers.js
  • sippy-ng/src/jobs/JobRunsTable.js
  • sippy-ng/src/jobs/JobStackedChart.js
  • sippy-ng/src/jobs/JobsDetail.js
💤 Files with no reviewable changes (1)
  • sippy-ng/src/App.js

Comment thread sippy-ng/src/datagrid/GridToolbarFilterItem.js
Comment thread sippy-ng/src/jobs/JobsDetail.js
@mstaeble mstaeble force-pushed the trt-2364-timestamp-consistency branch from 0ce2e75 to 4c44aed Compare June 30, 2026 13:08
@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 Jun 30, 2026
@mstaeble mstaeble force-pushed the trt-2364-timestamp-consistency branch from 4c44aed to fddef49 Compare June 30, 2026 13:57
@mstaeble mstaeble changed the title [WIP] TRT-2364: Fix timestamp and date type inconsistencies TRT-2364: Fix timestamp and date type inconsistencies Jun 30, 2026
@mstaeble mstaeble marked this pull request as ready for review June 30, 2026 14:08
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 30, 2026
@openshift-ci openshift-ci Bot requested review from deepsm007 and smg247 June 30, 2026 14:09

@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: 8

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
sippy-ng/src/tests/FeatureGates.js (1)

213-225: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Potential in-place mutation of the memoized default.

When the filters param is absent, filterModel is the memoized defaultFilterModel. requestSearch mutates currentFilters.items in place (filterModel.items.filter(...) assigned back), and bookmarks[0].model also points at defaultFilterModel.items (Line 127). Mutating the shared default can corrupt the bookmark/default state. Consider cloning before mutating.

🤖 Prompt for 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.

In `@sippy-ng/src/tests/FeatureGates.js` around lines 213 - 225, The requestSearch
helper in FeatureGates is mutating the shared memoized defaultFilterModel
through filterModel/currentFilters, which can corrupt bookmark/default state
because bookmarks[0].model also points at that same items array. Update
requestSearch to work on a cloned filter model and cloned items before
filtering/pushing the feature_gate criterion, then pass the new object to
setFilterModel so defaultFilterModel is never modified in place.
pkg/testidentification/ocp_variants.go (1)

110-114: 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Bug: existence check uses the wrong map key, dropping accumulated variant values.

variantKeyValues is keyed by variant name (e.g. AllPlatforms() reads variantValues["Platform"]), and the insert/create branches both key by v.VariantName. Changing the lookup to variantKeyValues[v.VariantValue] means the ok check almost never matches the key actually written. As a result, the else branch runs on every value for a given name and overwrites the set instead of inserting, so only the last value per variant name survives.

The check must use the same key as the writes (v.VariantName):

🐛 Proposed fix
-			if _, ok := variantKeyValues[v.VariantValue]; ok {
+			if _, ok := variantKeyValues[v.VariantName]; ok {
 				variantKeyValues[v.VariantName].Insert(v.VariantValue)
 			} else {
 				variantKeyValues[v.VariantName] = sets.NewString(v.VariantValue)
 			}
🤖 Prompt for 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.

In `@pkg/testidentification/ocp_variants.go` around lines 110 - 114, The existence
check in the variant accumulation logic uses the wrong map key, causing
previously collected values to be lost. In the code that updates
variantKeyValues, make sure the lookup matches the same key used for writes,
namely v.VariantName, so the insert branch is taken when that variant name
already exists and values are accumulated instead of overwritten.
🧹 Nitpick comments (3)
sippy-ng/src/App.js (1)

498-502: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Restore the [isLoaded] dependency array.

Dropping the dependency array makes this effect run after every render. The if (!isLoaded) guard prevents repeated fetches, so behavior is effectively unchanged, but running the callback on every render is unnecessary and diverges from the prior intent (run when isLoaded transitions). Re-adding [isLoaded] is clearer and keeps react-hooks/exhaustive-deps happy.

♻️ Suggested change
   useEffect(() => {
     if (!isLoaded) {
       fetchData()
     }
-  })
+  }, [isLoaded])
🤖 Prompt for 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.

In `@sippy-ng/src/App.js` around lines 498 - 502, Restore the missing dependency
array on the useEffect in App.js so the fetch logic only runs when isLoaded
changes, not after every render. Update the effect that calls fetchData to
include [isLoaded], keeping the existing !isLoaded guard intact and preserving
the intended transition-based behavior while satisfying
react-hooks/exhaustive-deps.
sippy-ng/src/tests/TestAnalysis.js (1)

63-72: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Inline default recreates filterModel every render.

When the filters param is absent, this destructure default produces a brand-new object on each render (unlike the prior stable-reference helper). It feeds the dependency array of the page-context effect (Lines 162-170), so setPageContextForChat will rerun on every render. Consider wrapping the default in useMemo keyed on testName.

🤖 Prompt for 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.

In `@sippy-ng/src/tests/TestAnalysis.js` around lines 63 - 72, The inline fallback
for `filterModel` in `TestAnalysis` creates a new object on every render when
`filters` is missing, which makes the `useEffect` that calls
`setPageContextForChat` keep retriggering. Move that default construction into a
`useMemo` in `TestAnalysis`, keyed on `testName`, and use the memoized value in
the `useQueryParam('filters', SafeJSONParam)` destructure so the `filterModel`
reference stays stable across renders.
pkg/filter/filterable.go (1)

58-68: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use sets.String for jobRunFields. This is a hand-rolled set; switch to k8s.io/apimachinery/pkg/util/sets and Has() for consistency with the Go guidelines.

🤖 Prompt for 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.

In `@pkg/filter/filterable.go` around lines 58 - 68, The `jobRunFields` lookup in
`StripJobRunFilters` is a hand-rolled set and should be converted to
`k8s.io/apimachinery/pkg/util/sets.String` for consistency. Update the
`jobRunFields` declaration to use a `sets.String` value, then change the
membership check inside `StripJobRunFilters` to use `Has()` instead of map
indexing. Keep the rest of the filter-copy logic unchanged.

Source: Coding guidelines

🤖 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 `@pkg/filter/filterable.go`:
- Line 670: Update Filter.Filter in filterable.go to handle
apitype.ColumnTypeTimestamp in-memory alongside the existing string, numerical,
and array branches, since JobRun.GetFieldType("timestamp") now resolves to a
timestamp type. Add a dedicated timestamp branch that parses the filter value as
RFC3339, compares it against the item's timestamp field, and returns the same
style of match/non-match result as the other field-type handlers. Also add
regression coverage around the Filter.Filter path to verify timestamp filtering
works and no longer falls through to the “unknown field or field type” case.

In `@sippy-ng/src/component_readiness/TriagedRegressionTestList.js`:
- Around line 221-226: The `valueGetter` in `TriagedRegressionTestList` should
guard against `params.row.last_failure` being null or undefined before accessing
`.Valid`. Update the existing `valueGetter` logic to first check that
`last_failure` exists, then return null when it is missing or invalid, and only
construct the `Date` from `params.row.last_failure.Time` when the object is
present and valid.

In `@sippy-ng/src/jobs/JobAnalysis.js`:
- Around line 160-162: The fetch effect in JobAnalysis is missing props.release
in its dependency list, so navigation between releases can reuse stale data.
Update the useEffect that calls fetchData() to depend on props.release as well
as filterModel and period, and ensure fetchData uses the current release value
from props.release when building the request.

In `@sippy-ng/src/jobs/JobRunsTable.js`:
- Around line 165-172: The timestamp handling in JobRunsTable is missing a
null/invalid guard, so `valueGetter` and `renderCell` can produce `Invalid Date`
when `params.value` is absent or bad. Update the column logic in `JobRunsTable`
to match the defensive pattern used in `RegressedTestsPanel`: return `null` from
`valueGetter` when the timestamp is missing/invalid, and short-circuit
`renderCell` so it renders nothing instead of calling `toLocaleString()` or
`relativeTime()` on an invalid date.

In `@sippy-ng/src/jobs/JobTable.js`:
- Around line 549-551: JobTable does not refetch data when props.release
changes, so stale rows can remain in release-scoped views. Update the useEffect
that calls fetchData() in JobTable to include props.release in its dependency
list, ensuring the effect reruns whenever the release context changes. Keep the
fix localized to the fetchData-triggering effect and preserve the existing
period, filterModel, sort, and sortField dependencies.

In `@sippy-ng/src/pull_requests/PullRequestsTable.js`:
- Around line 371-373: The fetch effect in PullRequestsTable is missing
props.release from its dependency list, so release changes can leave stale pull
request data on screen. Update the useEffect that calls fetchData to include
props.release alongside filterModel, sort, sortField, and view so the request
reruns whenever the active release changes, especially when rendered from
RepositoryDetails.

In `@sippy-ng/src/releases/PayloadStreamTestFailures.js`:
- Around line 198-200: The fetch effect is missing the release stream query
inputs it actually depends on, so updates to release, arch, or stream can leave
PayloadStreamTestFailures showing stale results. Update the useEffect in
PayloadStreamTestFailures so its dependency array includes the values read by
fetchData(), alongside the existing filterModel, sort, and sortField
dependencies, ensuring the table refetches whenever those query params change.

In `@sippy-ng/src/releases/ReleasePayloadPullRequests.js`:
- Around line 159-161: The effect in ReleasePayloadPullRequests is missing the
server-side sort dependencies, so changing sort no longer triggers a refetch.
Update the useEffect that calls fetchData to depend on filterModel, sort, and
sortField, matching the other table components and ensuring the query rebuilt by
fetchData stays in sync with sorting changes. Keep the logic in
ReleasePayloadPullRequests aligned with PayloadStreamsTable,
ReleasePayloadTable, and ReleasePayloadJobRuns so server-side sorting continues
to work.

---

Outside diff comments:
In `@pkg/testidentification/ocp_variants.go`:
- Around line 110-114: The existence check in the variant accumulation logic
uses the wrong map key, causing previously collected values to be lost. In the
code that updates variantKeyValues, make sure the lookup matches the same key
used for writes, namely v.VariantName, so the insert branch is taken when that
variant name already exists and values are accumulated instead of overwritten.

In `@sippy-ng/src/tests/FeatureGates.js`:
- Around line 213-225: The requestSearch helper in FeatureGates is mutating the
shared memoized defaultFilterModel through filterModel/currentFilters, which can
corrupt bookmark/default state because bookmarks[0].model also points at that
same items array. Update requestSearch to work on a cloned filter model and
cloned items before filtering/pushing the feature_gate criterion, then pass the
new object to setFilterModel so defaultFilterModel is never modified in place.

---

Nitpick comments:
In `@pkg/filter/filterable.go`:
- Around line 58-68: The `jobRunFields` lookup in `StripJobRunFilters` is a
hand-rolled set and should be converted to
`k8s.io/apimachinery/pkg/util/sets.String` for consistency. Update the
`jobRunFields` declaration to use a `sets.String` value, then change the
membership check inside `StripJobRunFilters` to use `Has()` instead of map
indexing. Keep the rest of the filter-copy logic unchanged.

In `@sippy-ng/src/App.js`:
- Around line 498-502: Restore the missing dependency array on the useEffect in
App.js so the fetch logic only runs when isLoaded changes, not after every
render. Update the effect that calls fetchData to include [isLoaded], keeping
the existing !isLoaded guard intact and preserving the intended transition-based
behavior while satisfying react-hooks/exhaustive-deps.

In `@sippy-ng/src/tests/TestAnalysis.js`:
- Around line 63-72: The inline fallback for `filterModel` in `TestAnalysis`
creates a new object on every render when `filters` is missing, which makes the
`useEffect` that calls `setPageContextForChat` keep retriggering. Move that
default construction into a `useMemo` in `TestAnalysis`, keyed on `testName`,
and use the memoized value in the `useQueryParam('filters', SafeJSONParam)`
destructure so the `filterModel` reference stays stable across renders.
🪄 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: d990cb2f-d180-42be-82df-c4e55ba8c139

📥 Commits

Reviewing files that changed from the base of the PR and between d32d1f8 and fddef49.

⛔ Files ignored due to path filters (8)
  • .claude/rules/backend.md is excluded by !.claude/**
  • .claude/rules/frontend.md is excluded by !.claude/**
  • .cursor/rules/backend.mdc is excluded by !.cursor/**
  • .cursor/rules/frontend.mdc is excluded by !.cursor/**
  • AGENTS.md is excluded by !AGENTS.md
  • CLAUDE.md is excluded by !CLAUDE.md
  • sippy-ng/AGENTS.md is excluded by !sippy-ng/AGENTS.md
  • sippy-ng/CLAUDE.md is excluded by !sippy-ng/CLAUDE.md
📒 Files selected for processing (51)
  • .apm/instructions/backend.instructions.md
  • .apm/instructions/frontend.instructions.md
  • apm.lock.yaml
  • config/openshift.yaml
  • pkg/api/README.md
  • pkg/api/componentreadiness/dataprovider/bigquery/releasedates.go
  • pkg/api/componentreadiness/dataprovider/postgres/provider.go
  • pkg/api/componentreadiness/queryparamparser_test.go
  • pkg/api/componentreadiness/triage_test.go
  • pkg/api/componentreadiness/utils/utils_test.go
  • pkg/api/job_runs.go
  • pkg/api/jobs.go
  • pkg/api/releases.go
  • pkg/api/releases_test.go
  • pkg/api/test_analysis.go
  • pkg/apis/api/types.go
  • pkg/apis/sippy/v1/types.go
  • pkg/apis/sippyprocessing/v1/types.go
  • pkg/db/db.go
  • pkg/db/views.go
  • pkg/filter/filterable.go
  • pkg/sippyserver/chat_conversations.go
  • pkg/sippyserver/parameters.go
  • pkg/sippyserver/server.go
  • pkg/testidentification/ocp_variants.go
  • pkg/util/utils.go
  • pkg/util/utils_test.go
  • pkg/variantregistry/snapshot.yaml
  • sippy-ng/src/App.js
  • sippy-ng/src/build_clusters/BuildClusterDetails.js
  • sippy-ng/src/component_readiness/RegressedTestsPanel.js
  • sippy-ng/src/component_readiness/TriagedRegressionTestList.js
  • sippy-ng/src/datagrid/GridToolbarFilterItem.js
  • sippy-ng/src/datagrid/utils.js
  • sippy-ng/src/helpers.js
  • sippy-ng/src/jobs/JobAnalysis.js
  • sippy-ng/src/jobs/JobRunsTable.js
  • sippy-ng/src/jobs/JobStackedChart.js
  • sippy-ng/src/jobs/JobTable.js
  • sippy-ng/src/jobs/JobsDetail.js
  • sippy-ng/src/pull_requests/PullRequestsTable.js
  • sippy-ng/src/releases/PayloadStreamTestFailures.js
  • sippy-ng/src/releases/PayloadStreamsTable.js
  • sippy-ng/src/releases/PayloadTestFailures.js
  • sippy-ng/src/releases/ReleasePayloadJobRuns.js
  • sippy-ng/src/releases/ReleasePayloadPullRequests.js
  • sippy-ng/src/releases/ReleasePayloadTable.js
  • sippy-ng/src/repositories/RepositoriesTable.js
  • sippy-ng/src/tests/FeatureGates.js
  • sippy-ng/src/tests/TestAnalysis.js
  • sippy-ng/src/tests/TestTable.js

Comment thread pkg/filter/filterable.go
Comment thread sippy-ng/src/component_readiness/TriagedRegressionTestList.js
Comment thread sippy-ng/src/jobs/JobAnalysis.js Outdated
Comment thread sippy-ng/src/jobs/JobRunsTable.js
Comment thread sippy-ng/src/jobs/JobTable.js Outdated
Comment thread sippy-ng/src/pull_requests/PullRequestsTable.js Outdated
Comment thread sippy-ng/src/releases/PayloadStreamTestFailures.js Outdated
Comment thread sippy-ng/src/releases/ReleasePayloadPullRequests.js Outdated
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e

@mstaeble mstaeble force-pushed the trt-2364-timestamp-consistency branch from fddef49 to 2937c21 Compare June 30, 2026 16:47

@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: 1

🤖 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 `@pkg/variantregistry/snapshot.yaml`:
- Around line 26693-26695: The perfscale `multi-ns` jobs are being recorded with
`Architecture: multi`, which causes x86-only jobs to be treated as multi-arch in
downstream variant consumers. Update the snapshot generation in
`pkg/variantregistry/snapshot.go` so these `*-x86-*` entries keep `Architecture`
as `amd64`, and move the `multi-ns` distinction into a separate variant field or
the job key instead. Then regenerate the affected `snapshot.yaml` entries for
the
`periodic-ci-openshift-eng-ocp-qe-perfscale-ci-main-aws-4.22-nightly-x86-cudn-density-multi-ns-500-24nodes`
family.
🪄 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: 634f7723-be81-4a5e-b5b0-3b1a6059594c

📥 Commits

Reviewing files that changed from the base of the PR and between fddef49 and 2937c21.

⛔ Files ignored due to path filters (8)
  • .claude/rules/backend.md is excluded by !.claude/**
  • .claude/rules/frontend.md is excluded by !.claude/**
  • .cursor/rules/backend.mdc is excluded by !.cursor/**
  • .cursor/rules/frontend.mdc is excluded by !.cursor/**
  • AGENTS.md is excluded by !AGENTS.md
  • CLAUDE.md is excluded by !CLAUDE.md
  • sippy-ng/AGENTS.md is excluded by !sippy-ng/AGENTS.md
  • sippy-ng/CLAUDE.md is excluded by !sippy-ng/CLAUDE.md
📒 Files selected for processing (38)
  • .apm/instructions/backend.instructions.md
  • .apm/instructions/frontend.instructions.md
  • apm.lock.yaml
  • config/openshift.yaml
  • pkg/api/README.md
  • pkg/api/componentreadiness/dataprovider/bigquery/releasedates.go
  • pkg/api/componentreadiness/dataprovider/postgres/provider.go
  • pkg/api/componentreadiness/queryparamparser_test.go
  • pkg/api/componentreadiness/triage_test.go
  • pkg/api/componentreadiness/utils/utils_test.go
  • pkg/api/job_runs.go
  • pkg/api/jobs.go
  • pkg/api/releases.go
  • pkg/api/releases_test.go
  • pkg/api/test_analysis.go
  • pkg/apis/api/types.go
  • pkg/apis/sippy/v1/types.go
  • pkg/apis/sippyprocessing/v1/types.go
  • pkg/db/db.go
  • pkg/db/views.go
  • pkg/filter/filterable.go
  • pkg/sippyserver/chat_conversations.go
  • pkg/sippyserver/parameters.go
  • pkg/sippyserver/server.go
  • pkg/testidentification/ocp_variants.go
  • pkg/util/utils.go
  • pkg/util/utils_test.go
  • pkg/variantregistry/snapshot.yaml
  • sippy-ng/src/App.js
  • sippy-ng/src/build_clusters/BuildClusterDetails.js
  • sippy-ng/src/component_readiness/RegressedTestsPanel.js
  • sippy-ng/src/component_readiness/TriagedRegressionTestList.js
  • sippy-ng/src/datagrid/GridToolbarFilterItem.js
  • sippy-ng/src/datagrid/utils.js
  • sippy-ng/src/helpers.js
  • sippy-ng/src/jobs/JobRunsTable.js
  • sippy-ng/src/jobs/JobStackedChart.js
  • sippy-ng/src/jobs/JobsDetail.js
✅ Files skipped from review due to trivial changes (6)
  • pkg/db/db.go
  • pkg/api/componentreadiness/queryparamparser_test.go
  • .apm/instructions/frontend.instructions.md
  • .apm/instructions/backend.instructions.md
  • apm.lock.yaml
  • pkg/api/README.md
🚧 Files skipped from review as they are similar to previous changes (31)
  • pkg/api/componentreadiness/dataprovider/bigquery/releasedates.go
  • pkg/sippyserver/chat_conversations.go
  • pkg/api/componentreadiness/utils/utils_test.go
  • pkg/util/utils_test.go
  • pkg/api/job_runs.go
  • sippy-ng/src/jobs/JobStackedChart.js
  • sippy-ng/src/datagrid/utils.js
  • pkg/apis/sippy/v1/types.go
  • sippy-ng/src/component_readiness/RegressedTestsPanel.js
  • pkg/db/views.go
  • sippy-ng/src/build_clusters/BuildClusterDetails.js
  • sippy-ng/src/App.js
  • sippy-ng/src/component_readiness/TriagedRegressionTestList.js
  • pkg/testidentification/ocp_variants.go
  • sippy-ng/src/jobs/JobRunsTable.js
  • sippy-ng/src/datagrid/GridToolbarFilterItem.js
  • pkg/api/componentreadiness/dataprovider/postgres/provider.go
  • sippy-ng/src/jobs/JobsDetail.js
  • pkg/api/releases_test.go
  • pkg/util/utils.go
  • pkg/api/componentreadiness/triage_test.go
  • pkg/sippyserver/server.go
  • pkg/apis/sippyprocessing/v1/types.go
  • sippy-ng/src/helpers.js
  • pkg/api/test_analysis.go
  • pkg/api/releases.go
  • pkg/sippyserver/parameters.go
  • pkg/filter/filterable.go
  • pkg/apis/api/types.go
  • pkg/api/jobs.go
  • config/openshift.yaml

Comment thread pkg/variantregistry/snapshot.yaml Outdated
@mstaeble mstaeble force-pushed the trt-2364-timestamp-consistency branch 4 times, most recently from 16f7c71 to bc4cd1a Compare June 30, 2026 17:12
@mstaeble mstaeble force-pushed the trt-2364-timestamp-consistency branch 3 times, most recently from ae5ec5d to 7df6cbc Compare June 30, 2026 18:06

@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: 3

🤖 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 `@pkg/api/test_analysis.go`:
- Around line 42-43: The DATE filter in the analysis query is using time-based
bounds from reportEnd, which can shift the intended day range; update the date
predicates to compare DATE to DATE using civil.Date values. Normalize reportEnd
and the start boundary once in the test setup, then pass those date-only values
into the Where clauses in the analysis query near the reportEnd.Add-based logic.

In `@pkg/filter/filterable.go`:
- Around line 65-66: StripJobRunFilters currently dereferences fil immediately,
so passing nil will panic and break the no-filter case. Update
StripJobRunFilters to handle a nil *Filter input up front by returning nil
before any field access, keeping the existing behavior intact for non-nil
filters. Use the StripJobRunFilters function as the main fix point and ensure
any future dereferences in the function are guarded the same way.

In `@sippy-ng/src/datagrid/GridToolbarFilterItem.js`:
- Around line 103-114: The timestamp filter hydration in GridToolbarFilterItem
is too strict and breaks older bookmarked/shared URLs that still persist
millisecond strings in the filters query param. Update the read path around the
value passed into the date picker to accept both ISO 8601 and numeric-string
timestamps, and reuse the same parsing logic in sippy-ng/src/datagrid/utils.js
so JobRunsTable and other consumers stay consistent. Keep the existing write
path intact, but ensure the parser converts legacy values into a valid Date
before rendering or round-tripping the filter.
🪄 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: 4d73c2e5-2ddd-49f0-a824-115dd32b3314

📥 Commits

Reviewing files that changed from the base of the PR and between d53b4a4 and 7df6cbc.

⛔ Files ignored due to path filters (8)
  • .claude/rules/backend.md is excluded by !.claude/**
  • .claude/rules/frontend.md is excluded by !.claude/**
  • .cursor/rules/backend.mdc is excluded by !.cursor/**
  • .cursor/rules/frontend.mdc is excluded by !.cursor/**
  • AGENTS.md is excluded by !AGENTS.md
  • CLAUDE.md is excluded by !CLAUDE.md
  • sippy-ng/AGENTS.md is excluded by !sippy-ng/AGENTS.md
  • sippy-ng/CLAUDE.md is excluded by !sippy-ng/CLAUDE.md
📒 Files selected for processing (35)
  • .apm/instructions/backend.instructions.md
  • .apm/instructions/frontend.instructions.md
  • apm.lock.yaml
  • pkg/api/README.md
  • pkg/api/componentreadiness/dataprovider/bigquery/releasedates.go
  • pkg/api/componentreadiness/dataprovider/postgres/provider.go
  • pkg/api/componentreadiness/queryparamparser_test.go
  • pkg/api/componentreadiness/triage_test.go
  • pkg/api/componentreadiness/utils/utils_test.go
  • pkg/api/job_runs.go
  • pkg/api/jobs.go
  • pkg/api/releases.go
  • pkg/api/releases_test.go
  • pkg/api/test_analysis.go
  • pkg/apis/api/types.go
  • pkg/apis/sippy/v1/types.go
  • pkg/apis/sippyprocessing/v1/types.go
  • pkg/db/db.go
  • pkg/db/views.go
  • pkg/filter/filterable.go
  • pkg/sippyserver/chat_conversations.go
  • pkg/sippyserver/parameters.go
  • pkg/sippyserver/server.go
  • pkg/util/utils.go
  • pkg/util/utils_test.go
  • sippy-ng/src/App.js
  • sippy-ng/src/build_clusters/BuildClusterDetails.js
  • sippy-ng/src/component_readiness/RegressedTestsPanel.js
  • sippy-ng/src/component_readiness/TriagedRegressionTestList.js
  • sippy-ng/src/datagrid/GridToolbarFilterItem.js
  • sippy-ng/src/datagrid/utils.js
  • sippy-ng/src/helpers.js
  • sippy-ng/src/jobs/JobRunsTable.js
  • sippy-ng/src/jobs/JobStackedChart.js
  • sippy-ng/src/jobs/JobsDetail.js
💤 Files with no reviewable changes (1)
  • sippy-ng/src/App.js

Comment thread pkg/api/test_analysis.go
Comment thread pkg/filter/filterable.go
Comment thread sippy-ng/src/datagrid/GridToolbarFilterItem.js
@mstaeble mstaeble force-pushed the trt-2364-timestamp-consistency branch 2 times, most recently from eee8932 to 7536045 Compare June 30, 2026 19:47
Replace epoch millisecond integers with proper timestamp and date types
across the database schema, API layer, and frontend.

Backend:
- Enforce UTC timezone on all PostgreSQL connections via pgx RuntimeParams
- Change matview timestamp from bigint epoch to TIMESTAMP WITH TIME ZONE
- Use civil.Date for date-only fields (GA dates, development start dates,
  CountByDate, jobDetailAPIResult start/end)
- Change CalendarEvent.Start/End from string to time.Time
- Change ChatConversationResponse.CreatedAt from string to time.Time
- Change JobRun.Timestamp from int to time.Time (RFC 3339 in JSON)
- Remove epoch extraction from SQL filters; compare timestamptz directly
- Handle ColumnTypeTimestamp in Compare() via GetNumericalValue
- Fix PrintJobsReportFromDB to strip job-run filters (timestamp, cluster)
  before querying the prow_jobs table (pre-existing bug)
- Add filter.StripJobRunFilters for reusable job-run filter removal
- Fix GetTestAnalysisOverallFromDB to use reportEnd instead of time.Now()
  for consistent date windowing with pinned time (pre-existing bug)

Frontend:
- Use ISO 8601 strings for timestamp filter values throughout
- Remove dead ga_dates timezone hack in App.js
- Use valueGetter returning Date objects for DataGrid timestamp columns
- Add type: 'date' to all date/timestamp DataGrid columns
- Preserve 'not' flag when updating date filter values
- Rewrite JobsDetail day bucketing with Temporal.PlainDate
- Update DateTimePicker and filter display to use ISO strings

Documentation:
- Add timestamp/date type guidelines to backend and frontend instructions
- Update API docs to show RFC 3339 and YYYY-MM-DD formats

Note: production databases should also have their default timezone set to
UTC via ALTER DATABASE <name> SET timezone = 'UTC'.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mstaeble mstaeble force-pushed the trt-2364-timestamp-consistency branch from 7536045 to 8906ae3 Compare June 30, 2026 21:21
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e

@openshift-ci

openshift-ci Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

@mstaeble: all tests passed!

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

mstaeble added a commit to mstaeble/sippy that referenced this pull request Jul 1, 2026
Cherry-pick from PR openshift#3716 with conflict resolution:
- Use civil.Date for date-only fields (GA dates, development start dates)
- Use TIMESTAMP WITH TIME ZONE and DATE types in PostgreSQL
- RFC 3339 for API timestamps, YYYY-MM-DD for dates
- Resolve conflict in postgres provider (keep GetReleasesFromDB from PR openshift#3679)
- Add time.Time to civil.Date conversion in DefinitionToRelease

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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. 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