Add preliminary job_runs resource#5603
Merged
Merged
Conversation
Collaborator
Integration test reportCommit: 9bfd7e5
8 interesting tests: 4 SKIP, 2 KNOWN, 1 RECOVERED, 1 flaky
Top 5 slowest tests (at least 2 minutes):
|
63df005 to
ff9faea
Compare
a899c09 to
3fb23a7
Compare
d6b00f5 to
f7ec335
Compare
denik
reviewed
Jul 6, 2026
denik
reviewed
Jul 6, 2026
denik
reviewed
Jul 6, 2026
Address review feedback on the job_runs resource:
- DoRead now returns a faithful view of the remote run (job_id, overriding
parameters, and the resolved job_parameters set) instead of only job_id.
Drift is handled by field behavior, not by DoRead: the ignore_remote_changes
root rule suppresses every remote-only diff and recreate_on_changes
re-triggers on a local change.
- Collapse ignore_remote_changes to a single root rule (omitted field), mirroring
recreate_on_changes, instead of listing every input field.
- Stop overwriting the config job_id ${resources.jobs.*.id} reference during
state load, which dropped the plan dependency it creates. Load the resolved
job_id into a new internal ResolvedJobID field used only to build the run URL.
- Shorten job_runs comments.
# Conflicts: # NEXT_CHANGELOG.md
denik
reviewed
Jul 7, 2026
Job runs inherit execution identity from the referenced job, so they belong on the run_as allow list instead of being explicitly rejected.
Keep both JobsSubmit from main and the job_runs run-parameter helpers.
Reframe the comment to state intent (faithfully mirror GetRun's resolved job_parameters) rather than describing it as working around its own output via ignore_remote_changes.
denik
reviewed
Jul 8, 2026
- DoRead: construct state via an exhaustive struct literal so exhaustruct verifies every RunNow field is consciously handled - all_test.go: extract markCovered closure into a package-private helper - redeploy acceptance: filter the JSON plan to the relevant run resource and drop the redundant textual bundle plan calls
Since #5849 the field walk no longer skips the root node, so a root rule (omitted field) records the empty path "" and short-circuits the walk at the root on its own. The separate rootCovered flag and markCovered helper are no longer needed; inline the coverage assignment.
Introduce JobRunRemote as the DoRead return type: it embeds RunNow (so all state paths remain valid remote paths per TestRemoteSuperset) and adds the run's output-only fields, matching the job.go pattern. makeJobRunRemote does the flatten-mapping, RemapState becomes a trivial extraction, and DoCreate returns a nil remote to be read back via DoRead.
DoRead now returns the full GetRun response, adding REMOTE fields (run_id, run_name, run_page_url, run_type, state.*) to the job_runs resource. Regenerate out.fields.txt so validate-generated and the refschema acceptance test pass.
denik
approved these changes
Jul 8, 2026
The root ignore_remote_changes rule covers a mix of output-only fields (run_id, state, run_page_url) and round-tripped input fields (job_id, job_parameters), all of which GetRun returns. input_only means "not returned by GET", which is inaccurate here. The rule exists because the run is immutable/fire-once, so use that resource-level reason.
Sync generated bundle schema with the updated OpenAPI spec from main (the jobs `only` field description gained the +upstream/downstream selection semantics). Fixes the validate-generated CI drift.
Collaborator
Integration test reportCommit: 8713a83
43 interesting tests: 20 FAIL, 18 flaky, 2 RECOVERED, 2 SKIP, 1 KNOWN
Top 50 slowest tests (at least 2 minutes):
|
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.
Changes
Adds a
job_runsbundle resource (direct engine) that triggers oneRunNowduringbundle deploy— the declarative equivalent ofjobs run-now.A run is immutable: there is no update path. It re-triggers (delete + fresh
RunNow) only when its own config changes, not when the targeted job changes elsewhere.recreate_on_changesandignore_remote_changesare both single root rules.DoCreatecallsRunNow;DoReadusesGetRunand returns a faithful remote view (run_id,state,run_page_url, etc.).DoDeletecallsjobs/runs/deleteon destroy and recreate; deleting an active run surfaces the API error.State load keeps the config
job_idreference (${resources.jobs.*.id}) for plan dependencies; the resolved numeric id is stored as internalresolved_job_idfor URL generation.job_runsis on therun_asallow list — execution identity comes from the referenced job.Why
Triggering a job during deploy today requires custom scripts outside the bundle. This lets users declaratively run jobs as part of deployment (migrations, training, data prep, etc.).
Tests
basic,redeploy,job_parametersno_driftinvariant extended forjob_runsdresources,dstate,workspaceurls,run_asallow listjobs/runs/delete;RunNow/GetRunresolve parameters for faithfulDoRead