fix(jira): tag bronze_promoted 'staging' so prod promotes bronze before enrich (#1886) - #1889
Merged
mitasovr merged 1 commit intoJul 24, 2026
Conversation
The prod jira pipeline runs its staging dbt step with the selector `tag:staging,tag:jira` (an AND-intersection, hardcoded in render_cronworkflow.py / render_sync_trigger.py). The MergeTree -> ReplacingMergeTree promotion lives in the jira__bronze_promoted model, which was tagged only ['jira']. The AND-selector therefore never matched it, and with no `+` in the selector it was not pulled in as an upstream either, so on a real Airbyte sync bronze stayed plain MergeTree. The enrich step that runs right after reads `FROM bronze_jira.jira_issue AS ji FINAL`, which ClickHouse 25.7 rejects on a MergeTree table (Code: 181 ILLEGAL_FINAL). Enrich exited 1, the pipeline aborted before dbt built silver/gold, and no jira/task metrics were ever produced. This was masked in dev/CI (bootstrap-db selects the promote model by name) and in the e2e rig (uses `+<staging>` and bypasses the Rust enrich binary), so working there was not evidence the real path worked. Add the `staging` tag (schema='staging' is the target DATABASE, not a dbt tag, so it does not participate in tag selection) so the existing prod staging step selects the promote model and runs it before enrich. jira is the only connector with an enrich step; non-enrich connectors use the legacy `tag:<connector>+` path, which already pulls in their bronze_promoted, so no other connector needs this change. Add a manifest-level regression test asserting the prod staging selector `tag:staging,tag:jira` includes jira__bronze_promoted (a metric e2e test cannot cover this: the rig bypasses enrich and uses a masking selector). Also drop two pre-existing unused local assignments the linter flagged in the touched test file. Fixes constructorfabric#1886 Signed-off-by: Roman Mitasov <Roman.Mitasov@constructor.tech>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe Jira bronze promotion model now carries the ChangesJira staging promotion
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
mitasovr
enabled auto-merge (squash)
July 24, 2026 02:41
mozhaev-dev
approved these changes
Jul 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1886 — on a real Airbyte-synced install the jira pipeline crashes at the enrich step every run with
Code: 181 … Storage MergeTree doesn't support FINAL (ILLEGAL_FINAL), so dbt silver/gold never runs and no jira/task metrics ever appear.Root cause
The prod jira pipeline's staging dbt step uses the selector
tag:staging,tag:jira(an AND-intersection, hardcoded inreconcile-connectors/python/render_cronworkflow.pyandrender_sync_trigger.py). The MergeTree → ReplacingMergeTree promotion lives in thejira__bronze_promotedmodel, which was tagged only['jira'].Because the selector requires both tags and has no
+(so no upstream pull-in), it never selected the promote model. On a real sync bronze therefore stayed a plainMergeTree, and the enrich step'sFROM bronze_jira.jira_issue AS ji FINALis illegal onMergeTreein ClickHouse 25.7 → enrich exits 1 → pipeline aborts before silver/gold.schema='staging'on the model sets the target database, not a dbt tag, so it never participated in tag selection.This was masked everywhere we test:
--select jira__bronze_promoted).+<staging>(the+pulls the promote in as an upstream) and seeds silver directly, bypassing the Rust enrich binary.So "works in dev" was never evidence the real Airbyte path worked.
Fix
Add the
stagingtag:tags=['jira', 'staging']. The existing prod staging step now selects the promote model and runs it (before enrich, via thedepends_onedges the other staging models already declare). Minimal and aligns prod with the bootstrap-db contract.jira is the only connector with an enrich step (verified: only
connectors/task-tracking/jirahasimages.enrich/ anenrich/dir). Non-enrich connectors use the legacytag:<connector>+path, which already pulls in their<connector>__bronze_promoted, so no other connector needs this change.tag:stagingis never used bare anywhere — only insidetag:staging,tag:jira— so this has no side effects elsewhere.Verification (ClickHouse 25.7.5)
dbt ls --select tag:staging,tag:jira: before = 3 models (no promote); after = includesjira__bronze_promoted. Select-by-name (bootstrap-db) still works.bronze_jira.jira_issueas plainMergeTree, ran the exact enrich query →Code: 181 ILLEGAL_FINAL. Randbt run --select jira__bronze_promoted→ migrated toReplacingMergeTree. Re-ran the FINAL query → succeeds and dedups (3 rows → 2 issues, latest version kept). Idempotent on re-run.Regression test
Added a manifest-level meta test asserting the prod staging selector
tag:staging,tag:jiraselectsjira__bronze_promoted. A metric e2e test can't cover this (the rig bypasses enrich and uses a masking selector), so a manifest-level guard is the correct layer.Follow-up (out of scope)
render_cronworkflow.py/render_sync_trigger.pyhardcode the staging selector as"tag:staging,tag:jira" if connector == "jira" else "". A second enrich connector would silently get""(no staging step). Deriving the staging selector from the connector descriptor would prevent a future recurrence — worth a separate issue.🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Tests