Skip to content

Add missing fields to DbtInvocationSchema - #2327

Open
vyagubov wants to merge 2 commits into
elementary-data:masterfrom
vyagubov:add_invocation_fields_v
Open

Add missing fields to DbtInvocationSchema #2327
vyagubov wants to merge 2 commits into
elementary-data:masterfrom
vyagubov:add_invocation_fields_v

Conversation

@vyagubov

@vyagubov vyagubov commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Documentation says

**Elementary collects the following job details:**

- Orchestrator name: `orchestrator`
- Job name: `job_name`
- Job ID: `job_id`
- Job results URL: `job_url`
- The ID of a specific run execution: `job_run_id`
- Job run results URL: `job_run_url`

Elementary reads those variables from dbt --vars. Also, there is a UI code to show the values.
But DbtInvocationSchema doesn't carry those values, because fields are missing.

Aim is to get values to this UI form:
Screenshot 2026-08-18 at 10 48 35

P.S. previous PR didn't get enough attention. That is why I made a fresh branch and rewrote the description.

Summary by CodeRabbit

  • New Features

    • Invocation data now includes optional job run identifiers and URLs when available.
    • Test and model invocation results can display job names, IDs, run IDs, and run URLs.
  • Bug Fixes

    • Improved compatibility with environments where job-related columns are unavailable.
    • Invocation queries now return consistent results without failing when optional metadata is missing.

@github-actions

Copy link
Copy Markdown
Contributor

👋 @vyagubov
Thank you for raising your pull request.
Please make sure to add tests and document all user-facing changes.
You can do this by editing the docs files in this pull request.

@vyagubov
vyagubov requested a deployment to elementary_test_env August 18, 2026 08:57 — with GitHub Actions Waiting
@coderabbitai

coderabbitai Bot commented Aug 18, 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 Plus

Run ID: fbc5393e-25c1-4eb6-a0a7-a2849b9e9578

📥 Commits

Reviewing files that changed from the base of the PR and between a73b355 and e466876.

📒 Files selected for processing (3)
  • elementary/monitor/dbt_project/macros/get_models_latest_invocations_data.sql
  • elementary/monitor/dbt_project/macros/get_test_last_invocation.sql
  • elementary/monitor/fetchers/invocations/schema.py

Included review availability: Your plan includes up to 8 reviews per rolling hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The changes add optional job_run_id and job_run_url fields to invocation data. Both invocation macros now detect each optional column independently and return values or NULL when columns are unavailable.

Changes

Invocation compatibility

Layer / File(s) Summary
Conditional invocation fields
elementary/monitor/fetchers/invocations/schema.py, elementary/monitor/dbt_project/macros/get_test_last_invocation.sql, elementary/monitor/dbt_project/macros/get_models_latest_invocations_data.sql
The schema defines optional job run fields. The macros independently check optional job metadata columns and return values or NULL aliases as applicable.

Estimated code review effort: 3 (Moderate) | ~15 minutes

Merge Risk: ⚪ Minimal · up to e4668

This change adds invocation metadata needed by the UI, and no actionable merge-blocking risk remains beyond normal checks and review.

🚥 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 identifies the main change: adding missing fields to DbtInvocationSchema.
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

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.

@vyagubov
vyagubov marked this pull request as ready for review August 18, 2026 09:19
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.

1 participant