Skip to content

fix(gold): resolve task_status_intervals name collision - #1835

Merged
aleksdotbar merged 1 commit into
mainfrom
fix/task-status-intervals-collision
Jul 21, 2026
Merged

fix(gold): resolve task_status_intervals name collision#1835
aleksdotbar merged 1 commit into
mainfrom
fix/task-status-intervals-collision

Conversation

@aleksdotbar

@aleksdotbar aleksdotbar commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

The dbt gold model task_status_intervals (materialized=table) and the refreshable materialized view of the same name from migrations 20260429/20260708 both target insight.task_status_intervals. The gold build runs after migrations in the deploy hook, so dbt replaces the MV with a MergeTree table; a later migration run then executes DROP VIEW IF EXISTS task_status_intervals against a non-view and fails with code 80 (... is not a View), failing the post-upgrade hook.

Rename the dbt model and its alias to task_status_spans. The sibling task_issue_state already uses a name distinct from its MV counterpart task_issue_current_state; the intervals model missed the same treatment. Migrations are unchanged.

Validated with dbt parse (clean) and dbt ls: task_status_spans+ resolves task_metric_observations, and task_status_intervals no longer matches any node.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Standardized task status lifecycle data under the task_status_spans name.
    • Updated downstream task metrics to use the renamed status lifecycle data source.
    • Preserved existing status transition, in-progress, close, and reopen calculations.

Signed-off-by: Aleksandr Barkhatov <pm@aleks.bar>
@aleksdotbar
aleksdotbar requested a review from a team as a code owner July 21, 2026 11:37
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0ac9e0d2-3c8d-4fee-863c-93e7e34524a1

📥 Commits

Reviewing files that changed from the base of the PR and between 700bdf3 and 4c454ef.

📒 Files selected for processing (3)
  • src/ingestion/gold/schema.yml
  • src/ingestion/gold/task_metric_observations.sql
  • src/ingestion/gold/task_status_spans.sql

📝 Walkthrough

Walkthrough

The task lifecycle dbt model is renamed from task_status_intervals to task_status_spans, with its schema declaration and downstream metric-observation reference updated accordingly.

Changes

Task status spans rename

Layer / File(s) Summary
Publish renamed lifecycle model
src/ingestion/gold/task_status_spans.sql, src/ingestion/gold/schema.yml
The dbt alias and schema declaration now publish the lifecycle model as task_status_spans.
Consume renamed lifecycle model
src/ingestion/gold/task_metric_observations.sql
The status-derived metrics model references task_status_spans and updates the nearby explanatory comment.

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

Possibly related PRs

Suggested reviewers: ktursunov

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: resolving the task_status_intervals name collision by renaming the gold model.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/task-status-intervals-collision

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Checkov (3.3.8)
src/ingestion/gold/schema.yml

Traceback (most recent call last):
File "/usr/local/bin/checkov", line 2, in
from checkov.main import Checkov
ModuleNotFoundError: No module named 'checkov'


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.

@aleksdotbar
aleksdotbar enabled auto-merge July 21, 2026 11:40
@aleksdotbar
aleksdotbar merged commit 55aa2b2 into main Jul 21, 2026
28 checks passed
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