Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .apm/instructions/backend.instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,9 @@ applyTo: "**/*.go"
counts, a log.WithField() call is preferred over formatting values into a string.
* After making changes, always run `gofmt -w` on modified files to ensure proper formatting.
* When modifying any data provider (BigQuery or PostgreSQL), ensure **parity between both implementations**. Changes to query logic, filtering, or returned data in one provider must be reflected in the other.
* **Timestamps and dates**: Use proper types, never epoch integers.
- PostgreSQL columns: use `TIMESTAMP WITH TIME ZONE` for timestamps and `DATE` for date-only values. All timestamps are UTC.
- Go structs: use `time.Time` for timestamps. Use `civil.Date` (`cloud.google.com/go/civil`) for date-only values (e.g., GA dates, development start dates). Do not use `string` for date or timestamp fields; let JSON marshaling produce the correct format.
- API responses: timestamps serialize as RFC 3339 strings, dates as `YYYY-MM-DD` strings. Never return epoch millisecond integers. Never manually format with `time.Format()` into a string field.
- Materialized views: project timestamp columns directly from the source table. Do not convert to epoch with `EXTRACT(epoch FROM ...)`.
- GORM model tags: include `gorm:"type:date"` on date-only columns so GORM and migrations use the correct PostgreSQL type.
7 changes: 7 additions & 0 deletions .apm/instructions/frontend.instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,10 @@ npx prettier --write .
* Keep UI elements consistent with Material-UI standards.

The frontend uses `npm`. If you must install or update any dependencies, always use the `--ignore-scripts` flag.

* **Timestamps and dates from the API**:
- Timestamps arrive as RFC 3339 strings (e.g., `"2024-06-27T15:30:00Z"`), not epoch millisecond integers. Use `new Date(value)` or `Temporal.Instant.from(value)` to parse them.
- Dates arrive as `YYYY-MM-DD` strings (e.g., `"2024-06-27"`). Use `Temporal.PlainDate.from(value)` for date arithmetic.
- For MUI DataGrid timestamp columns, use `type: 'date'` with a `valueGetter` that returns a `Date` object. Do not return epoch milliseconds from `valueGetter`.
- For filter values sent to the API, use ISO 8601 strings (e.g., `new Date(...).toISOString()`), not epoch millisecond integers.
- For day-level bucketing or date arithmetic, prefer `Temporal.PlainDate` over `Date` with manual millisecond math.
6 changes: 6 additions & 0 deletions .claude/rules/backend.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .claude/rules/frontend.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .cursor/rules/backend.mdc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .cursor/rules/frontend.mdc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion AGENTS.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion CLAUDE.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions apm.lock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ local_deployed_file_hashes:
.claude/commands/sippy-generate-release-views.md: sha256:eb4c9eeeea2ab2a90e8a8839147d8a1a309ea6ce3dafd397c6d2485c93068a9a
.claude/commands/sippy-update-ga-release-views.md: sha256:4a5589bacc05127e427a2de4d34a8f13e05e297bdf6ebf7473c9e71f47a6b4f4
.claude/commands/sippy-update-job-variant.md: sha256:f88742dddeec5024931959a8330fdce362ffdd9b8825e808830ac346605cbd16
.claude/rules/backend.md: sha256:b1bd6bacccc8bfc8ab2c060496fede3bdcece46b59cf218cd7cddc3617ead4c5
.claude/rules/backend.md: sha256:7b954581d356fb4f0d4ff966d774739847c1cf5e0ec60c29cb7c730a1b3966f0
.claude/rules/config.md: sha256:96c5e42c039230f1e4e7f9ba56d04e6f76f23deeecdd858634c440d6029a6a83
.claude/rules/dev-commands.md: sha256:eb32bdc640add2044138807572ea1afb73ee1bba038f5098032a89987a7ddc04
.claude/rules/frontend.md: sha256:ff22046c5b951769218bbdf36499e67c70896811b8ef161ca6d3729a3423997d
.claude/rules/frontend.md: sha256:cdfc2cdc3981c43d91dcf9583d0fff2d3f0b4f355ded4237aa264211fe42600c
.claude/rules/general.md: sha256:997f68e86cb43485ec5f108be3417f9bbb43ae1faffd660d598f18260f5df3ce
.claude/rules/mcp.md: sha256:ddfe965e7cf8cddbba1374c6ae582a20ac0af17c958bf10e1a4edff6ff2ad0b8
.claude/rules/testing.md: sha256:52bfc6e67b38d17b767d34c480530cd14c700ef8018d5c70c2deaa7133717904
Expand All @@ -124,10 +124,10 @@ local_deployed_file_hashes:
.cursor/commands/sippy-generate-release-views.md: sha256:eb4c9eeeea2ab2a90e8a8839147d8a1a309ea6ce3dafd397c6d2485c93068a9a
.cursor/commands/sippy-update-ga-release-views.md: sha256:4a5589bacc05127e427a2de4d34a8f13e05e297bdf6ebf7473c9e71f47a6b4f4
.cursor/commands/sippy-update-job-variant.md: sha256:f88742dddeec5024931959a8330fdce362ffdd9b8825e808830ac346605cbd16
.cursor/rules/backend.mdc: sha256:5ff740fc76c25ee64beb7f768399da6ef6510ecca8147e5c2f81fbb110043084
.cursor/rules/backend.mdc: sha256:9a3b22b249269e105a3958ac7a7fa8e78b5426347239c02567116f1acbf77ca1
.cursor/rules/config.mdc: sha256:d6e2195399bbb26a3fef7e54bd01862ffce39d89dce8aabdb0b89c89028192eb
.cursor/rules/dev-commands.mdc: sha256:3dc8a3ef5cbb22ebb09b7fe3785f24a32ab2baa4488c5514c9c6210b0af6c4eb
.cursor/rules/frontend.mdc: sha256:497f39372724f1ae127181fe3dac9ea9a95a51c532b68ccfee6080832cf9c556
.cursor/rules/frontend.mdc: sha256:6cbbb94363b782dc6763344a72f5a996fe25a4bd5db08862e578b611ed083612
.cursor/rules/general.mdc: sha256:5bc6e1e12d53d85656248c9dc1239c74bcc0df29d5987f3b08e3d79e3df413b7
.cursor/rules/mcp.mdc: sha256:c02472afd46e4c89f71d4487dcd5da98b0c1bcbcf7f9cbc4d7ed4e7d3a206ec1
.cursor/rules/testing.mdc: sha256:12ea7763599eb56fdd92ae09a9fed19495b17673ee34701803a6eae7ac50d3e8
Expand Down
38 changes: 19 additions & 19 deletions pkg/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,95 +294,95 @@ A summary of runs for job(s). Results contains of the following values for each
"name": "periodic-ci-openshift-release-master-nightly-4.9-e2e-metal-ipi-ovn-ipv6",
"results": [
{
"timestamp": 1628207039000,
"timestamp": "2021-08-06T03:43:59Z",
"result": "F",
"url": "https://prow.ci.openshift.org/view/gcs/origin-ci-test/logs/periodic-ci-openshift-release-master-nightly-4.9-e2e-metal-ipi-ovn-ipv6/1423429598720299008"
},
{
"timestamp": 1628045973000,
"timestamp": "2021-08-04T03:59:33Z",
"result": "F",
"url": "https://prow.ci.openshift.org/view/gcs/origin-ci-test/logs/periodic-ci-openshift-release-master-nightly-4.9-e2e-metal-ipi-ovn-ipv6/1422754032564310016"
},
{
"timestamp": 1628198644000,
"timestamp": "2021-08-05T21:24:04Z",
"result": "F",
"url": "https://prow.ci.openshift.org/view/gcs/origin-ci-test/logs/periodic-ci-openshift-release-master-nightly-4.9-e2e-metal-ipi-ovn-ipv6/1423394362347229184"
},
{
"timestamp": 1628485392000,
"timestamp": "2021-08-09T05:03:12Z",
"result": "F",
"url": "https://prow.ci.openshift.org/view/gcs/origin-ci-test/logs/periodic-ci-openshift-release-master-nightly-4.9-e2e-metal-ipi-ovn-ipv6/1424597097709047808"
},
{
"timestamp": 1628343908000,
"timestamp": "2021-08-07T14:25:08Z",
"result": "F",
"url": "https://prow.ci.openshift.org/view/gcs/origin-ci-test/logs/periodic-ci-openshift-release-master-nightly-4.9-e2e-metal-ipi-ovn-ipv6/1424003666343366656"
},
{
"timestamp": 1628325313000,
"timestamp": "2021-08-07T09:15:13Z",
"result": "F",
"url": "https://prow.ci.openshift.org/view/gcs/origin-ci-test/logs/periodic-ci-openshift-release-master-nightly-4.9-e2e-metal-ipi-ovn-ipv6/1423925674229370880"
},
{
"timestamp": 1628289649000,
"timestamp": "2021-08-06T23:20:49Z",
"result": "F",
"url": "https://prow.ci.openshift.org/view/gcs/origin-ci-test/logs/periodic-ci-openshift-release-master-nightly-4.9-e2e-metal-ipi-ovn-ipv6/1423776089259380736"
},
{
"timestamp": 1628277370000,
"timestamp": "2021-08-06T19:56:10Z",
"result": "S",
"url": "https://prow.ci.openshift.org/view/gcs/origin-ci-test/logs/periodic-ci-openshift-release-master-nightly-4.9-e2e-metal-ipi-ovn-ipv6/1423724523844276224"
},
{
"timestamp": 1628358891000,
"timestamp": "2021-08-07T18:34:51Z",
"result": "F",
"url": "https://prow.ci.openshift.org/view/gcs/origin-ci-test/logs/periodic-ci-openshift-release-master-nightly-4.9-e2e-metal-ipi-ovn-ipv6/1424066513538650112"
},
{
"timestamp": 1628190532000,
"timestamp": "2021-08-05T19:08:52Z",
"result": "F",
"url": "https://prow.ci.openshift.org/view/gcs/origin-ci-test/logs/periodic-ci-openshift-release-master-nightly-4.9-e2e-metal-ipi-ovn-ipv6/1423360364472438784"
},
{
"timestamp": 1628274962000,
"timestamp": "2021-08-06T19:16:02Z",
"result": "F",
"url": "https://prow.ci.openshift.org/view/gcs/origin-ci-test/logs/periodic-ci-openshift-release-master-nightly-4.9-e2e-metal-ipi-ovn-ipv6/1423714481237659648"
},
{
"timestamp": 1627391095000,
"timestamp": "2021-07-27T13:24:55Z",
"result": "F",
"url": "https://prow.ci.openshift.org/view/gcs/origin-ci-test/logs/periodic-ci-openshift-release-master-nightly-4.9-e2e-metal-ipi-ovn-ipv6/1420007279679246336"
},
{
"timestamp": 1627473363000,
"timestamp": "2021-07-28T12:16:03Z",
"result": "F",
"url": "https://prow.ci.openshift.org/view/gcs/origin-ci-test/logs/periodic-ci-openshift-release-master-nightly-4.9-e2e-metal-ipi-ovn-ipv6/1420352338517823488"
},
{
"timestamp": 1627617630000,
"timestamp": "2021-07-30T04:20:30Z",
"result": "F",
"url": "https://prow.ci.openshift.org/view/gcs/origin-ci-test/logs/periodic-ci-openshift-release-master-nightly-4.9-e2e-metal-ipi-ovn-ipv6/1420957438630170624"
},
{
"timestamp": 1627515377000,
"timestamp": "2021-07-29T00:56:17Z",
"result": "F",
"url": "https://prow.ci.openshift.org/view/gcs/origin-ci-test/logs/periodic-ci-openshift-release-master-nightly-4.9-e2e-metal-ipi-ovn-ipv6/1420528516700573696"
},
{
"timestamp": 1627396851000,
"timestamp": "2021-07-27T15:00:51Z",
"result": "F",
"url": "https://prow.ci.openshift.org/view/gcs/origin-ci-test/logs/periodic-ci-openshift-release-master-nightly-4.9-e2e-metal-ipi-ovn-ipv6/1420031423921786880"
},
{
"timestamp": 1627363991000,
"timestamp": "2021-07-27T05:53:11Z",
"result": "F",
"url": "https://prow.ci.openshift.org/view/gcs/origin-ci-test/logs/periodic-ci-openshift-release-master-nightly-4.9-e2e-metal-ipi-ovn-ipv6/1419893597473345536"
}
]
}
],
"start": 1627317573000,
"end": 1628508950000
"start": "2021-07-26",
"end": "2021-08-09"
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package bigquery

import (
"context"
"time"

"github.com/openshift/sippy/pkg/api"
"github.com/openshift/sippy/pkg/apis/api/componentreport/crtest"
Expand Down Expand Up @@ -34,9 +35,10 @@ func (c *releaseDateQuerier) QueryReleaseDates(ctx context.Context) ([]crtest.Re
for _, release := range releases {
timeRange := crtest.ReleaseTimeRange{Release: release.Release}
if release.GADate != nil {
prior := util.AdjustReleaseTime(*release.GADate, true, "30", c.reqOptions.CacheOption.CRTimeRoundingFactor, c.reqOptions.CacheOption.CRTimeRoundingOffset)
gaTime := release.GADate.In(time.UTC)
prior := util.AdjustReleaseTime(gaTime, true, "30", c.reqOptions.CacheOption.CRTimeRoundingFactor, c.reqOptions.CacheOption.CRTimeRoundingOffset)
timeRange.Start = &prior
timeRange.End = release.GADate
timeRange.End = &gaTime
}
timeRanges = append(timeRanges, timeRange)
}
Expand Down
5 changes: 3 additions & 2 deletions pkg/api/componentreadiness/dataprovider/postgres/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"strings"
"time"

"cloud.google.com/go/civil"
"github.com/lib/pq"

"github.com/openshift/sippy/pkg/api/componentreadiness/dataprovider"
Expand Down Expand Up @@ -165,7 +166,7 @@ func (p *PostgresProvider) QueryReleases(ctx context.Context) ([]v1.Release, err
v1.SippyClassicCap: true,
}

now := time.Now().UTC()
today := civil.DateOf(time.Now().UTC())
var releases []v1.Release
for _, name := range releaseNames {
rel := v1.Release{
Expand All @@ -176,7 +177,7 @@ func (p *PostgresProvider) QueryReleases(ctx context.Context) ([]v1.Release, err
if meta, ok := releaseMetadata[name]; ok {
rel.PreviousRelease = meta.previousRelease
if meta.gaOffsetDays != 0 {
ga := now.AddDate(0, 0, meta.gaOffsetDays)
ga := today.AddDays(meta.gaOffsetDays)
rel.GADate = &ga
}
if meta.product != "" {
Expand Down
Loading