Skip to content

fix(rilltime): accept legacy DAX comparison offsets in ParseLegacy - #9869

Open
pjain1 wants to merge 2 commits into
mainfrom
parag/fix-legacy-dax-comparison-offset
Open

fix(rilltime): accept legacy DAX comparison offsets in ParseLegacy#9869
pjain1 wants to merge 2 commits into
mainfrom
parag/fix-legacy-dax-comparison-offset

Conversation

@pjain1

@pjain1 pjain1 commented Sep 7, 2026

Copy link
Copy Markdown
Member

Alerts and reports created before the legacy time range refactor store comparison time ranges with an iso_offset of rill-PD/PW/PM/PQ/PY, which ParseLegacy rejected with "offset cannot have DAX notation". Map those tokens to the equivalent ISO offsets and treat rill-PP as a previous period offset, matching the pre-refactor behaviour.

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated. If so, create a separate Linear DOCS issue
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

Alerts and reports created before the legacy time range refactor store
comparison time ranges with an iso_offset of rill-PD/PW/PM/PQ/PY, which
ParseLegacy rejected with "offset cannot have DAX notation". Map those
tokens to the equivalent ISO offsets and treat rill-PP as a previous
period offset, matching the pre-refactor behaviour.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@pjain1
pjain1 requested review from AdityaHegde and a balanced review from Copilot September 7, 2026 16:33

Copilot AI 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.

🟡 Changes recommended

The unrelated CLI test always fails because EditCmd does not define the flag it exercises.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds backward compatibility for legacy DAX comparison offsets in ParseLegacy.

Changes:

  • Maps legacy DAX offsets to ISO durations.
  • Supports rill-PP as the previous period.
  • Adds compatibility tests and an unrelated CLI test.
File summaries
File Description
runtime/pkg/rilltime/rilltime.go Parses legacy DAX comparison offsets.
runtime/pkg/rilltime/rilltime_test.go Tests valid and invalid legacy offsets.
cli/cmd/sudo/project/edit_test.go Adds an unsupported cloud-editing command test.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread cli/cmd/sudo/project/edit_test.go Outdated

Copilot AI 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.

🟢 Approval recommended

The compatibility behavior is narrowly scoped and adequately covered by tests.

Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants