6.8 KiB
phase, plan, type, wave, depends_on, files_modified, autonomous, requirements, user_setup, must_haves
| phase | plan | type | wave | depends_on | files_modified | autonomous | requirements | user_setup | must_haves | |||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 07-user-plugin-and-authentication | 08 | execute | 7 |
|
|
true |
|
Purpose: make the Phase 7 avatar HTTP path work on the real boot, not only in unit tests that publish a memblob by hand.
Output: serve and Handler publish the bucket; a JPEG upload against app.Handler is 200; go vet / go test stay green in both modules.
<execution_context> @$HOME/.codex/get-shit-done/workflows/execute-plan.md @$HOME/.codex/get-shit-done/templates/summary.md </execution_context>
@.planning/phases/07-user-plugin-and-authentication/07-UAT.md @.planning/debug/avatar-bucket-not-published.md @surf/serve.go @lagoon/attach/bucket.go @../fonoteka.go/app/app.go @../fonoteka.go/plugins/golem15/user/controllers/api_controller.go Publish the uploads bucket on serve and Handler surf/serve.go, ../fonoteka.go/app/app.go, ../fonoteka.go/parity/migrate_test.go, ../fonoteka.go/parity/genre_security_test.go In `surf.ServeCommand`, after `lagoon.Publish` and before `Assemble`, call `attach.OpenBucket(ctx, app.Config)` then `attach.Publish(app, bucket)`. Return the OpenBucket error so an empty `storage.uploads.bucket_url` fails boot (same loud-fail as JWT secret). Do not swallow a missing bucket.In fonoteka.go/app.Handler, do the same after lagoon.Publish and before party.Activate, using the passed ctx and cfg.
In every assembled-test config helper that feeds app.Handler (testConfig in parity/migrate_test.go, testConfigCORS in parity/genre_security_test.go, and any sibling that copies that pattern), set storage.uploads.bucket_url to mem:// and storage.uploads.public_path_prefix to /storage/uploads. Production already has fonoteka.go/config/storage.yaml.
If a plugin-package boot helper (bootConfig, sessionConfig) is used to Assemble avatar HTTP without publishing a bucket, give it the same mem:// key or keep publishing memblob in that test — do not leave a second assembled path that 500s.
go vet the touched packages. A ServeCommand unit test that the command errors when bucket_url is empty is enough for this task; the upload proof is the next task.
cd /media/nvme/dev/golem15/summercms.io/summercms/summercms.go && go vet ./surf/ && go test ./surf/ -count=1 -timeout 60s -run 'TestServe'
ServeCommand and app.Handler publish *blob.Bucket. Assembled test configs use mem://. Empty bucket_url still fails boot.
- Register or insert an activated user, login, POST
/_user/api/v1/avataras multipart fieldavatarwith a sniffed JPEG or PNG. - Assert 200,
has_avatartrue, non-emptyavatar_url. - POST
/_user/api/v1/avatar/removewith the same bearer; asserthas_avatarfalse.
Prefer putting this next to the existing avatar tests if they can reach app.Handler; otherwise add it in parity/ beside newConfiguredTarget so it uses the same boot as replay. Do not satisfy this with controllers.UploadAvatar(app) + a hand-published bucket only — that is the path that already passed and hid the gap.
Keep TestUploadAvatar / TestRemoveAvatar. They stay as handler-unit coverage.
If TestParityCorpus is still green with only the missing-file 422 fixture, leave that fixture alone. Do not invent a ported success-upload fixture unless a recorded PHP body already exists.
cd /media/nvme/dev/golem15/summercms.io/summercms/fonoteka.go && go test ./plugins/golem15/user/ -count=1 -timeout 180s -run 'TestUploadAvatar|TestRemoveAvatar|TestUploadAvatarAssembled' && go test ./parity/ -count=1 -timeout 15m -run 'TestParityCorpus$|TestUserAPINuxtFlows|TestAvatarAssembled'
A JPEG/PNG upload against the assembled handler is 200 with has_avatar and avatar_url; remove clears has_avatar. Existing avatar unit tests and the ported corpus stay green.