feat-auto-attributes
New Features
Auto-attributes (Tower consumer — Phase 1)
Tower deposits structured metadata to neo-backend as autoAttributes on each protected document (POST /v2/documents), replacing legacy tags from bcyip-toolkit.
Reference documentation: docs/auto-attributes.md — codes deposited, deposit-fields module, neo headers, storage tags. Update this doc when Tower behaviour changes.
Attributes sent by Tower (iptower):
| Code | Git | FTP |
|---|---|---|
source-type | gitlab, github, bitbucket, gitea | ftp |
source-name | workflow source name (config.name) | workflow source name |
git_repo | remote repo (projectName) | — |
git_commit | commit SHA | — |
git_branch | branch (push only) | — |
git_tag | tag (tag event only) | — |
ftp_source-path | — | folder path |
bcyip:agent and bcyip:agent-version are injected by neo-backend (Bcyip-Agent, Bcyip-Version headers).
Implementation:
src/protocol/utils/deposit-fields.ts— single projection fromProtectTaskto auto-attributes and storage path tagssrc/app.service.ts—buildAutoAttributes(task)on git/FTP protectsrc/protocol/bcyip/api.ts—createDocument(),Bcyip-Versionheadersrc/protocol/storage/storage.service.ts—resolveStoragePath()/ metadata from same deposit fields
Platform contract (catalogue, smart lists, folder filters): neo-backend docs/auto-attributes.md.
Breaking Changes
Removed dependency on bcyip-toolkit
Required enabler for auto-attributes: Tower calls neo-backend directly for document creation and proof download. Docker base image is now node:20-alpine instead of bcyip-toolkit:0.4.1.
hashFile(),createDocument(),downloadProof()insrc/protocol/bcyip/api.tsprocessHook,processFtp,processProofno longer shell out to the toolkittest/helpers/neo-backend-mock.tsreplaces bash mocktest/mocks/bcyip-toolkit(nock HTTP mock forPOST /documents, proof status, zip)
Technical Changes
- Proof status:
GET /documents/:id/proofs/statuseson neo (was legacy backend) - Integration tests:
neo-backend-mock.tsmocks neo HTTP (documents, proof status, zip, tower heartbeat/activate) and allows DinD service host (docker,SERVICE_HOST) for Gitea/MinIO