Skip to content

Send more metadata with a run - #5062

Closed
josephjclark wants to merge 4 commits into
mainfrom
run-metadata
Closed

Send more metadata with a run#5062
josephjclark wants to merge 4 commits into
mainfrom
run-metadata

Conversation

@josephjclark

Copy link
Copy Markdown
Contributor

Description

This PR extends the Run object with more metadata about the run.

The metadata will appear in the run under the meta key. See the supporting Worker PR: OpenFn/kit#1500

Validation steps

  1. Run a workflow from the bundled worker. I recommend log(meta) with common. It should be just fine against worker 1.29.0. but the meta object does not include workOrderId
  2. Against the worker PR, or worker 1.29.1, the same job code should include workOrderId. And some other stuff.

AI Usage

Please disclose whether you've used AI anywhere in this PR (it's cool, we just
want to know!):

  • I have used Claude Code
  • I have used another model
  • I have not used AI

You can read more details in our
Responsible AI Policy

@github-project-automation github-project-automation Bot moved this to New Issues in Core Aug 13, 2026
@josephjclark
josephjclark marked this pull request as ready for review August 13, 2026 11:21
@github-actions

Copy link
Copy Markdown

I have enough context. This is a small, focused change: it adds work_order_id, workflow_id, and project_id to the run "plan" payload rendered by LightningWeb.RunWithOptions.render/1 and sent to workers. The three data files (S0/S1/S2 assessment):

  • CHANGELOG.md — docs only.
  • lib/lightning_web/channels/run_with_options.ex — production change: adds outbound fields to the worker plan.
  • test/lightning_web/channels/run_channel_test.exs / run_with_options_test.exs — test-only, not under test/lightning/policies/.

The only file in scope for review is run_with_options.ex. It adds no queries and no web-layer entrypoints; it derives the new fields from the same already-loaded run.snapshot.workflow association whose project_id was already being emitted at the top level (run_with_options.ex:24). Workers authenticate via JWT and already receive the enclosing run's project_id and its snapshot; the added identifiers do not expand what a worker learns about other projects. No writes, so no audit surface.

Security Review ✅

  • S0 (project scoping): New render_meta/1 at lib/lightning_web/channels/run_with_options.ex:75 emits IDs from run.snapshot — no new query, and project_id was already exposed on the same authenticated worker payload at run_with_options.ex:24.
  • S1 (authorization): N/A, no new web-layer actions or user-facing handlers; the run channel's existing worker JWT flow is unchanged.
  • S2 (audit trail): N/A, no config-resource writes; render/1 is read-only rendering of an already-loaded run.

The entry described the wire format; what a user needs to know is the
names they can read in job code, and that it needs a newer worker.
@codecov

codecov Bot commented Aug 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.6%. Comparing base (44aeb4a) to head (4692fdd).

Additional details and impacted files
@@           Coverage Diff           @@
##            main   #5062     +/-   ##
=======================================
- Coverage   90.6%   90.6%   -0.1%     
=======================================
  Files        421     421             
  Lines      20012   20016      +4     
=======================================
- Hits       18137   18128      -9     
- Misses      1875    1888     +13     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@elias-ba

elias-ba commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Hey @josephjclark closing this one - your change is already in. Frank flagged that anything going into 2.18.0 needs to land on release-2.18.0 rather than main. This branch had main merged into it, so retargeting it would have dragged a pile of unrelated commits into the release. I cherry-picked your two commits onto a fresh branch off the release instead - that's #5064, now merged.

So the metadata is on the release branch, together with the bundled worker bumped to 1.29.1. It goes out in 2.18.0-pre2 for Megan to QA. Thanks for turning this around so quickly - Aisha's team have been waiting on it.

@elias-ba elias-ba closed this Aug 15, 2026
@github-project-automation github-project-automation Bot moved this from New Issues to Done in Core Aug 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants