Manage resource types via OCI (create/get/list/publish/pull/delete/convert) - #249
Manage resource types via OCI (create/get/list/publish/pull/delete/convert)#249chrisghill wants to merge 2 commits into
Conversation
|
@claude review |
|
Claude finished @chrisghill's task in 3m 34s —— View job Code ReviewReviewed the OCI plumbing extraction ( Overall the extraction is clean: A few things worth a look: 1. Test coverage regression:
2. Duplicated 3. Possible silent content drop in the publish allowlist Minor/non-blocking:
Nothing here looks blocking; #1 (test coverage) and #3 (allowlist/Build mismatch) are the two I'd actually want addressed before merge. |
The API now supports resource types being managed via OCI push/pull. This wires that up in the CLI, mirroring bundles but without any build/lint machinery, extracts the shared OCI plumbing into its own package so bundles and resource types share one code path, and moves resource-type reads onto the SDK so the local
internal/apiholding-pen package can be deleted entirely.Shared OCI package
internal/ocipackage holds the raw OCI logic:Publisher(Packagewith a caller-supplied artifact-type + per-filekeeppredicate,Publish) andPuller(Pull), plus the file/mime helpers.internal/bundlekeeps only its unique config (ArtifactTypeconst +PackageKeepignore-list predicate);internal/commands/bundle/{publish,pull}andinternal/commands/instance/export.gonow driveoci.Publisher/oci.Puller.application/vnd.massdriver.bundle.v1+json), same.mdignorekeep semantics, same manifest/layers, same pull tag resolution.Resource types → OCI (7 commands)
createresource-typeOCI repository; supports-aattributesgetResourceTypes.Get(returns the resolved JSON schema);-o jsonprints the full object, new--schemaprints only the schema (errors without-o json)listbundle list(columns: Name / Latest / Created At; supports-o json)publish [path].); requiresversioninmassdriver.yaml; meta-schema validation; local duplicate-version check (stable only, no dev releases); packages only allowlisted files; rejects raw JSON schema files, pointing toconvertpull-d/-v/-f),latestresolves to thelatestrelease channel or newest tagdeleteconvertmassdriver.yaml, extracting inlined instruction/export content back out to referenced filesversionfield to the resource typemassdriver.yaml.massdriver.yaml, readme, changelog, icons, plus theinstructions/andexports/directories amassdriver.yamlreferences (soconvert → publish → pullround-trips). Everything else is silently skipped.Removed
internal/apiGet,List) now go through the SDK (ResourceTypes.GetandOciRepos.Iter), so the temporaryinternal/apiholding-pen package is deleted in full — no callers remain.resourcetype.ResourceTypeis now an alias of the SDK'sresourcetypes.ResourceType.Tests & docs
packageKeepallowlist,convertround-trip (incl. duplicate-label collision and no-clobber), and resource-typeget/listmocked viamassdriver.WithGQLClient.create/pull/convert, refreshedpublish, and regenerated the committed CLI docs.Notes
listtable columns changed fromID / Name / Updated AttoName / Latest / Created Atto matchbundle list.ResourceTypesservice).