Skip to content

refactor(platform): move nsw-srilanka's workflowadmin and agency into platform - #445

Open
lokewate wants to merge 3 commits into
refactor/move-task-apifrom
refactor/move-workflowadmin
Open

lokewate wants to merge 3 commits into
refactor/move-task-apifrom
refactor/move-workflowadmin

Conversation

@lokewate

@lokewate lokewate commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Moves nsw-srilanka's workflow admin (workflowadmin: engine status, resolve, force-park) and agency mode (agency) into core/platform, unchanged. Phase 4 of OpenNSW/nsw-srilanka#1248, issue OpenNSW/nsw-srilanka#1240.

The code was made generic in nsw-srilanka first (OpenNSW/nsw-srilanka#1341). OpenNSW/nsw-srilanka#1361 then rewrote the handlers' comments to name the path values they read instead of route paths, so this PR copies it from nsw-srilanka's main at OpenNSW/nsw-srilanka#1361's merge commit, d5b188df. The admin audits keep audit.ConsignmentEvent and audit.TargetConsignment, which are already in core/platform/audit. A generic case event is a follow-up, since it changes what the audit log records.

Stacked on #444, which is stacked on #443. Review it after them, or with #444 as the base.

Type of Change

  • Refactoring (no functional changes)

Changes Made

Review commit by commit.

Commit What it does How to check it
166026e Copies internal/workflowadmin and internal/agency into platform/workflowadmin and platform/agency. Byte-for-byte copy (blob check below). It doesn't build by itself: it still imports nsw-srilanka.
02629e2 Rewrites the caseflow and tasks imports to core/platform, adds the SPDX headers (make license and core's pre-commit hook), and runs go mod tidy. Mechanical, commands in the commit message. Each file gains the 3 header lines; only import lines change otherwise. go.mod adds core/pagination v0.1.0, nsw-srilanka's version.
a3f9f7a Lists the two packages in platform/README.md. Only Markdown.

Blob check

Each file in 166026e has the same blob as in nsw-srilanka at d5b188df (git rev-parse <commit>:<path>):

nsw-srilanka path blob
internal/agency/artifacts_test.go 77e36b2f7743
internal/agency/cases.go 2bc1d42566fa
internal/agency/cases_test.go aabe47c753c3
internal/agency/repository.go 299e55cae272
internal/agency/repository_test.go fc5fb5e4709f
internal/workflowadmin/case_service.go da1316e405ce
internal/workflowadmin/case_service_test.go f4196526fe84
internal/workflowadmin/engine_status.go 60e60df4d00d
internal/workflowadmin/engine_status_test.go 58fd562eadd4
internal/workflowadmin/force_park.go 090a0673ad2d
internal/workflowadmin/force_park_test.go 991b4fcdffb8
internal/workflowadmin/handler.go 5b8309be8f1c
internal/workflowadmin/resolve_test.go 982253dc4732
internal/workflowadmin/service.go fc7b86925816
internal/workflowadmin/task_workflow_audit_test.go 38fd65a7d890
internal/workflowadmin/testutil_test.go aef7700ee43d
internal/workflowadmin/workflow_audit_test.go b40f9765b422

The core path is the same with internal/ replaced by platform/.

Testing

  • All existing tests pass

The tests move with the code. go build ./..., go test -race ./... and golangci-lint on the moved packages pass in platform/.

Related Issues

Related to OpenNSW/nsw-srilanka#1240, OpenNSW/nsw-srilanka#1248, OpenNSW/nsw-srilanka#1341, OpenNSW/nsw-srilanka#1342

🤖 Generated with Claude Code

@lokewate lokewate added Type/Improvement Enhancement to existing functionality nsw-sl cleanup Moving generic code from nsw-srilanka into core (OpenNSW/nsw-srilanka#1248) labels Nov 30, 2026
@coderabbitai

coderabbitai Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f5d60f42-acab-4b34-ae13-43531497ed01
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@lokewate
lokewate added this pull request to stack #448 November 30, 2026 06:15
@lokewate
lokewate force-pushed the refactor/move-workflowadmin branch from 181ee45 to 72da173 Compare November 30, 2026 06:20
lokewate added a commit to OpenNSW/nsw-srilanka that referenced this pull request Nov 30, 2026
OpenNSW/core#445 adds the workflowadmin and agency packages to
core/platform. Pinning to that PR's head lets the next commit switch
over to them; the pin moves to the merge commit once #445 merges.

The pin changes no other module version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lokewate added a commit to OpenNSW/nsw-srilanka that referenced this pull request Nov 30, 2026
…re/platform

OpenNSW/core#445 moved the workflowadmin and agency packages into
core/platform unchanged. Import them from there, delete
internal/workflowadmin and internal/agency, and point the comments and
docs/agency.md at the core packages. Behaviour is unchanged.

Closes #1240

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lokewate
lokewate force-pushed the refactor/move-workflowadmin branch from 72da173 to f8242ba Compare November 30, 2026 07:12
lokewate added a commit to OpenNSW/nsw-srilanka that referenced this pull request Nov 30, 2026
OpenNSW/core#445 adds the workflowadmin and agency packages to
core/platform. Pinning to that PR's head lets the next commit switch
over to them; the pin moves to the merge commit once #445 merges.

The pin changes no other module version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lokewate added a commit to OpenNSW/nsw-srilanka that referenced this pull request Nov 30, 2026
…re/platform

OpenNSW/core#445 moved the workflowadmin and agency packages into
core/platform unchanged. Import them from there, delete
internal/workflowadmin and internal/agency, and point the comments and
docs/agency.md at the core packages. Behaviour is unchanged.

Closes #1240

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lokewate
lokewate force-pushed the refactor/move-workflowadmin branch from f8242ba to 81fc9b9 Compare November 30, 2026 09:42
lokewate added a commit to OpenNSW/nsw-srilanka that referenced this pull request Nov 30, 2026
OpenNSW/core#445 adds the workflowadmin and agency packages to
core/platform. Pinning to that PR's head lets the next commit switch
over to them; the pin moves to the merge commit once #445 merges.

The pin changes no other module version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lokewate added a commit to OpenNSW/nsw-srilanka that referenced this pull request Nov 30, 2026
…re/platform

OpenNSW/core#445 moved the workflowadmin and agency packages into
core/platform unchanged. Import them from there, delete
internal/workflowadmin and internal/agency, and point the comments and
docs/agency.md at the core packages. Behaviour is unchanged.

Closes #1240

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lokewate added a commit to OpenNSW/nsw-srilanka that referenced this pull request Dec 1, 2026
OpenNSW/core#445 adds the workflowadmin and agency packages to
core/platform. Pinning to that PR's head lets the next commit switch
over to them; the pin moves to the merge commit once #445 merges.

The pin changes no other module version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lokewate added a commit to OpenNSW/nsw-srilanka that referenced this pull request Dec 1, 2026
…re/platform

OpenNSW/core#445 moved the workflowadmin and agency packages into
core/platform unchanged. Import them from there, delete
internal/workflowadmin and internal/agency, and point the comments and
docs/agency.md at the core packages. Behaviour is unchanged.

Closes #1240

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lokewate
lokewate force-pushed the refactor/move-workflowadmin branch from 81fc9b9 to 3e9921c Compare December 1, 2026 06:37
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

lokewate added a commit to OpenNSW/nsw-srilanka that referenced this pull request Dec 1, 2026
OpenNSW/core#445 adds the workflowadmin and agency packages to
core/platform. Pinning to that PR's head lets the next commit switch
over to them; the pin moves to the merge commit once #445 merges.

The pin changes no other module version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lokewate added a commit to OpenNSW/nsw-srilanka that referenced this pull request Dec 1, 2026
…re/platform

OpenNSW/core#445 moved the workflowadmin and agency packages into
core/platform unchanged. Import them from there, delete
internal/workflowadmin and internal/agency, and point the comments and
docs/agency.md at the core packages. Behaviour is unchanged.

Closes #1240

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lokewate added a commit to OpenNSW/nsw-srilanka that referenced this pull request Dec 1, 2026
OpenNSW/core#445 adds the workflowadmin and agency packages to
core/platform. Pinning to that PR's head lets the next commit switch
over to them; the pin moves to the merge commit once #445 merges.

The pin changes no other module version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lokewate added a commit to OpenNSW/nsw-srilanka that referenced this pull request Dec 1, 2026
…re/platform

OpenNSW/core#445 moved the workflowadmin and agency packages into
core/platform unchanged. Import them from there, delete
internal/workflowadmin and internal/agency, and point the comments and
docs/agency.md at the core packages. Behaviour is unchanged.

Closes #1240

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lokewate
lokewate force-pushed the refactor/move-workflowadmin branch from 3e9921c to e289fa1 Compare December 1, 2026 07:14
lokewate added a commit to OpenNSW/nsw-srilanka that referenced this pull request Dec 1, 2026
OpenNSW/core#445 adds the workflowadmin and agency packages to
core/platform. Pinning to that PR's head lets the next commit switch
over to them; the pin moves to the merge commit once #445 merges.

The pin changes no other module version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lokewate added a commit to OpenNSW/nsw-srilanka that referenced this pull request Dec 1, 2026
…re/platform

OpenNSW/core#445 moved the workflowadmin and agency packages into
core/platform unchanged. Import them from there, delete
internal/workflowadmin and internal/agency, and point the comments and
docs/agency.md at the core packages. Behaviour is unchanged.

Closes #1240

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lokewate added a commit to OpenNSW/nsw-srilanka that referenced this pull request Dec 1, 2026
OpenNSW/core#445 adds the workflowadmin and agency packages to
core/platform. Pinning to that PR's head lets the next commit switch
over to them; the pin moves to the merge commit once #445 merges.

The pin changes no other module version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lokewate added a commit to OpenNSW/nsw-srilanka that referenced this pull request Dec 1, 2026
…re/platform

OpenNSW/core#445 moved the workflowadmin and agency packages into
core/platform unchanged. Import them from there, delete
internal/workflowadmin and internal/agency, and point the comments and
docs/agency.md at the core packages. Behaviour is unchanged.

Closes #1240

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lokewate
lokewate force-pushed the refactor/move-workflowadmin branch from e289fa1 to 9f0d8d9 Compare December 1, 2026 10:08
lokewate added a commit to OpenNSW/nsw-srilanka that referenced this pull request Dec 1, 2026
OpenNSW/core#445 adds the workflowadmin and agency packages to
core/platform. Pinning to that PR's head lets the next commit switch
over to them; the pin moves to the merge commit once #445 merges.

The pin changes no other module version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lokewate added a commit to OpenNSW/nsw-srilanka that referenced this pull request Dec 1, 2026
…re/platform

OpenNSW/core#445 moved the workflowadmin and agency packages into
core/platform unchanged. Import them from there, delete
internal/workflowadmin and internal/agency, and point the comments and
docs/agency.md at the core packages. Behaviour is unchanged.

Closes #1240

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lokewate and others added 3 commits December 2, 2026 07:25
…anged

Byte-for-byte copies of nsw-srilanka's internal/workflowadmin and
internal/agency at 18f3ae1d4dc699b7308164c416a869e34e29f9fc (branch
refactor/1245-generic-workflowadmin-wording, OpenNSW/nsw-srilanka#1341)
into platform/, tests included. No other changes. They do not build until
the import rewrite in the next commit.

Part of OpenNSW/nsw-srilanka#1248

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e/platform and require their dependencies

Mechanical, no other changes:

  find platform/workflowadmin platform/agency -name '*.go' -print0 \
    | xargs -0 perl -pi -e 's#"github.com/OpenNSW/nsw-srilanka/internal/(caseflow|tasks)"#"github.com/OpenNSW/core/platform/$1"#'
  make license
  cd platform && GOWORK=off go mod tidy

make license and core's pre-commit hook add the SPDX headers to the copied
files. go.mod changes in this commit because the hook lints and builds the
module. go mod tidy adds core/pagination v0.1.0, the version nsw-srilanka
requires.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lokewate
lokewate force-pushed the refactor/move-workflowadmin branch from 9f0d8d9 to a3f9f7a Compare December 2, 2026 02:16
lokewate added a commit to OpenNSW/nsw-srilanka that referenced this pull request Dec 2, 2026
OpenNSW/core#445 adds the workflowadmin and agency packages to
core/platform. Pinning to that PR's head lets the next commit switch
over to them; the pin moves to the merge commit once #445 merges.

The pin changes no other module version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lokewate added a commit to OpenNSW/nsw-srilanka that referenced this pull request Dec 2, 2026
…re/platform

OpenNSW/core#445 moved the workflowadmin and agency packages into
core/platform unchanged. Import them from there, delete
internal/workflowadmin and internal/agency, and point the comments and
docs/agency.md at the core packages. Behaviour is unchanged.

Closes #1240

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lokewate added a commit to OpenNSW/nsw-srilanka that referenced this pull request Dec 2, 2026
OpenNSW/core#445 adds the workflowadmin and agency packages to
core/platform. Pinning to that PR's head lets the next commit switch
over to them; the pin moves to the merge commit once #445 merges.

The pin changes no other module version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lokewate added a commit to OpenNSW/nsw-srilanka that referenced this pull request Dec 2, 2026
…re/platform

OpenNSW/core#445 moved the workflowadmin and agency packages into
core/platform unchanged. Import them from there, delete
internal/workflowadmin and internal/agency, and point the comments and
docs/agency.md at the core packages. Behaviour is unchanged.

Closes #1240

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lokewate
lokewate marked this pull request as ready for review December 2, 2026 04:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

nsw-sl cleanup Moving generic code from nsw-srilanka into core (OpenNSW/nsw-srilanka#1248) Type/Improvement Enhancement to existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants