Repository navigation
feat(taskflow)!: resolve a task's render config from the artifacts, not its row - #366
Merged
Merged
Conversation
…ot its row A task row kept a copy of its render config, taken at start. It now keeps the id of the task template it started from, TaskTemplateID, and every reader resolves the template and its render config through the task's manifest version with renderconfig.Load. Published artifacts never change, so the task still renders the config it started with, and there is one copy of each config instead of one per task. The task template id also lets hosts read the rest of the template (its meta, its workflow) for a task; ActiveTaskTemplateID only names the active step's template. StartTask still loads the config, so a missing one fails the task at start rather than at its first render. BREAKING CHANGE: store.TaskRecord.RenderConfig is replaced by TaskTemplateID, and task_records_v2 needs a task_template_id TEXT NOT NULL DEFAULT '' column in place of render_config. NewZoneViewAssembler takes the artifact set. Rows written before this change have no task template id and cannot be rendered. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
11 of 17 tasks
mushrafmim
pushed a commit
to OpenNSW/nsw-srilanka
that referenced
this pull request
Oct 28, 2026
…its row Core now records a task's task template instead of a copy of its render config (OpenNSW/core#366). Read checks, file bindings, OGA file tokens and task names resolve the render config through the task template in the task's manifest version. Migration 000032 adds task_template_id and drops render_config; rows from before it no longer render. Pins core to its main branch, which also changes the engine's handlers to take the Activity's context (OpenNSW/core#355). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
chathura-de-silva
pushed a commit
to chathura-de-silva/NSW-SriLanka
that referenced
this pull request
Oct 28, 2026
…its row (OpenNSW#946) * feat(tasks)!: resolve a task's render config from the artifacts, not its row Core now records a task's task template instead of a copy of its render config (OpenNSW/core#366). Read checks, file bindings, OGA file tokens and task names resolve the render config through the task template in the task's manifest version. Migration 000032 adds task_template_id and drops render_config; rows from before it no longer render. Pins core to its main branch, which also changes the engine's handlers to take the Activity's context (OpenNSW/core#355). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs(bootstrap): keep stepNamespace's comment on stepNamespace Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(migrations): roll 000032 back to the table's original column order Postgres adds a column only at the end, so the @down rebuilds task_records_v2 to put render_config back in its place. The workflow guide describes the render config's resolution without the old copy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * refactor(agency): name a case's task nodes in one place CaseHandler.title returns a node's name (task_config title, else render config title, else task template id) instead of handing the raw render config through toNode, matching consignment's taskDisplayName. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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
A task row kept a full copy of its render config, taken when the task started (
task_records_v2.render_config). Every other template a task uses is read from the artifacts through the manifest version the task is pinned to, so the render config was the one template with a second copy. It is also the copy a future patch release could not reach: a patched form would no longer match a render config frozen on the row (itsfiles, for one).The row now keeps the id of the task template the task started from, and every reader resolves the template and its render config through the task's manifest version. Published artifacts never change, so a task still renders the config it started with.
It stores the task template id rather than the render config id because the task template is what the task started from: the render config is one thing read from it, and hosts need others (its meta for task names, its workflow). The row had no task template id before;
ActiveTaskTemplateIDnames the active step's template and changes on every step.#365 should merge first: it caches artifact files after their first load, so resolving the render config on every render does not fetch it from the bucket each time. The two do not depend on each other's code.
Type of Change
Changes Made
taskflow/renderconfig: newLoad(ctx, set, record)returns a task's render config: the task templaterecord.TaskTemplateIDand the render config it names, both in manifest versionrecord.ManifestVersion. A record with no task template id fails withErrNoTaskTemplate. It is a function, not aTaskManagermethod, so hosts that hold a task record and the artifact set (file binding, read authz, review plugins) can call it.store.TaskRecord:RenderConfig(the JSON) is replaced byTaskTemplateID. The GORM model maps it totask_template_id.DeepCopyno longer has bytes to copy.StartTaskrecords the task template's id. It still loads the render config, so a missing one fails the task at start rather than at its first render.GetTaskRenderInfoandZoneViewAssembler.Assembleresolve the render config withrenderconfig.Load.NewZoneViewAssemblertakes the artifact set.architecture.md,integration-guide.md,template-reference.md,frontend-guide.md) describe the id on the record instead of the snapshot, and the migration the table needs.Testing
taskflow/renderconfig/renderconfig_test.go:The zone assembler, task manager and GORM model tests now build records with a task template id. The zone assembler refuses a record without one.
go vet ./...andgo test ./...pass.Checklist
Related Issues
Related to OpenNSW/one-trade-artifacts#243
Additional Notes
Upgrading needs this migration on
task_records_v2:There is no backfill: rows written before this change have no task template id and cannot be rendered, so tasks started before the upgrade must be cleared. nsw-srilanka's switch to
renderconfig.Loadand its migration follow in a separate PR.🤖 Generated with Claude Code