Skip to content

refactor(platform): move nsw-srilanka's task API and its authorization into platform - #444

Open
lokewate wants to merge 3 commits into
refactor/move-caseflowfrom
refactor/move-task-api
Open

lokewate wants to merge 3 commits into
refactor/move-caseflowfrom
refactor/move-task-api

Conversation

@lokewate

@lokewate lokewate commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Moves nsw-srilanka's task HTTP API and its authorization into core/platform, unchanged. Phase 4 of OpenNSW/nsw-srilanka#1248, issue OpenNSW/nsw-srilanka#1239.

The code was made generic in nsw-srilanka first (OpenNSW/nsw-srilanka#1340). 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 scope names stay in nsw-srilanka, which keeps wiring the routes, so the OpenAPI specs stay there too.

Stacked on #443. Review it after #443, or with #443 as the base.

Type of Change

  • Refactoring (no functional changes)

Changes Made

nsw-srilanka core
internal/tasks (its own files, not plugins or renderer) platform/tasks
internal/tasks/readauthz platform/tasks/readauthz
internal/tasks/authzgate platform/tasks/authzgate
internal/tasks/extensions/authz platform/tasks/extensions/authz
internal/tasks/extensions/notify platform/tasks/extensions/notify
internal/tasks/systemcaller platform/tasks/systemcaller

Review commit by commit.

Commit What it does How to check it
9670777 Copies the packages above. Byte-for-byte copy (blob check below). It doesn't build by itself: it still imports nsw-srilanka.
b688980 Rewrites the caseparty, tasks/readauthz and tasks/extensions/authz 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: core/httputil goes from v0.2.0 to v0.3.0, nsw-srilanka's version, since tasks uses httputil.ErrTrailingData.
ef718e7 Lists the packages in platform/README.md. Only Markdown.

Blob check

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

nsw-srilanka path blob
internal/tasks/claim_handler.go 405b16520cd5
internal/tasks/claim_handler_test.go 497c9f6edfe6
internal/tasks/draft_validation_test.go fadc8e515aa7
internal/tasks/file_binding.go 054b3cfb77d5
internal/tasks/file_binding_test.go 8fc700d4c828
internal/tasks/http_handler.go 6bfa12ecbc66
internal/tasks/http_handler_test.go 24266c60f9e0
internal/tasks/task_template.go 1fa0c16b9fe0
internal/tasks/task_template_test.go 1160cee7b753
internal/tasks/title.go b0a1339f0763
internal/tasks/title_test.go b3f2dff38876
internal/tasks/authzgate/middleware.go cf4033e389ec
internal/tasks/authzgate/middleware_test.go efec39ad9ae8
internal/tasks/extensions/authz/README.md 3056090d1b50
internal/tasks/extensions/authz/authz.go aafa8a09e4eb
internal/tasks/extensions/authz/authz_test.go 5a5af86de614
internal/tasks/extensions/authz/wiring.go 3c2ff6e614e7
internal/tasks/extensions/authz/wiring_test.go afb240c55a7c
internal/tasks/extensions/notify/README.md 54cdd8dbe0d1
internal/tasks/extensions/notify/notify.go 923ae8d9aa33
internal/tasks/extensions/notify/notify_test.go 0dfc0bc7d88f
internal/tasks/extensions/notify/wiring.go ff682ee00309
internal/tasks/readauthz/readauthz.go 52314ff3acf6
internal/tasks/readauthz/readauthz_test.go db0a81cc2cca
internal/tasks/systemcaller/systemcaller.go 055e5f9c7be5
internal/tasks/systemcaller/systemcaller_test.go b8f1dc8acdc2

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#1239, OpenNSW/nsw-srilanka#1248, OpenNSW/nsw-srilanka#1340

🤖 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: 28cb67da-ce9c-423d-8dfa-aae0c680b5bc
  • 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-task-api branch from 54db3e0 to 7fb0c73 Compare November 30, 2026 06:20
lokewate added a commit to OpenNSW/nsw-srilanka that referenced this pull request Nov 30, 2026
OpenNSW/core#444 adds the task API 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 #444 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
OpenNSW/core#444 moved the task API packages into core/platform
unchanged: tasks, tasks/readauthz, tasks/authzgate,
tasks/extensions/authz, tasks/extensions/notify and tasks/systemcaller.
Import them from there and delete nsw-srilanka's copies.
internal/tasks/plugins and internal/tasks/renderer stay here.

The docs link the authz extension's README and the task gate in core.
Behaviour is unchanged.

Closes #1239

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lokewate
lokewate force-pushed the refactor/move-task-api branch from 7fb0c73 to 0ee8df7 Compare November 30, 2026 07:12
lokewate added a commit to OpenNSW/nsw-srilanka that referenced this pull request Nov 30, 2026
OpenNSW/core#444 adds the task API 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 #444 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
OpenNSW/core#444 moved the task API packages into core/platform
unchanged: tasks, tasks/readauthz, tasks/authzgate,
tasks/extensions/authz, tasks/extensions/notify and tasks/systemcaller.
Import them from there and delete nsw-srilanka's copies.
internal/tasks/plugins and internal/tasks/renderer stay here.

The docs link the authz extension's README and the task gate in core.
Behaviour is unchanged.

Closes #1239

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lokewate
lokewate force-pushed the refactor/move-task-api branch from 0ee8df7 to c4b5f24 Compare November 30, 2026 09:42
lokewate added a commit to OpenNSW/nsw-srilanka that referenced this pull request Nov 30, 2026
OpenNSW/core#444 adds the task API 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 #444 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
OpenNSW/core#444 moved the task API packages into core/platform
unchanged: tasks, tasks/readauthz, tasks/authzgate,
tasks/extensions/authz, tasks/extensions/notify and tasks/systemcaller.
Import them from there and delete nsw-srilanka's copies.
internal/tasks/plugins and internal/tasks/renderer stay here.

The docs link the authz extension's README and the task gate in core.
Behaviour is unchanged.

Closes #1239

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lokewate
lokewate force-pushed the refactor/move-task-api branch from c4b5f24 to 4c544a4 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
lokewate force-pushed the refactor/move-task-api branch from 4c544a4 to 4378597 Compare December 1, 2026 10:08
@lokewate
lokewate marked this pull request as ready for review December 1, 2026 10:08
lokewate and others added 3 commits December 2, 2026 07:25
Byte-for-byte copies of nsw-srilanka's internal/tasks (its top-level
files only), internal/tasks/readauthz, internal/tasks/authzgate,
internal/tasks/extensions/authz, internal/tasks/extensions/notify and
internal/tasks/systemcaller at b93ac9204c870f3e8154a6f4062a5f44fc2effe0
(branch refactor/1245-generic-task-api-wording, OpenNSW/nsw-srilanka#1340)
into platform/, tests and READMEs 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>
… require its dependencies

Mechanical, no other changes:

  find platform/tasks -name '*.go' -print0 \
    | xargs -0 perl -pi -e 's#"github.com/OpenNSW/nsw-srilanka/internal/(caseparty|tasks/readauthz|tasks/extensions/authz)"#"github.com/OpenNSW/core/platform/$1"#'
  make license
  cd platform && GOWORK=off go get github.com/OpenNSW/core/httputil@v0.3.0 && 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. tasks needs httputil.ErrTrailingData, so core/httputil goes from
v0.2.0 to v0.3.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-task-api branch from 4378597 to ef718e7 Compare December 2, 2026 02:16
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