Manage resource types via OCI (create/get/list/publish/pull/delete/convert) - #249
Conversation
|
@claude review |
This comment was marked as outdated.
This comment was marked as outdated.
|
@claude review |
This comment was marked as outdated.
This comment was marked as outdated.
|
@claude review |
|
Claude finished @chrisghill's task in 3m 37s —— View job ReviewOverall this is a clean, well-tested refactor. The A couple of things worth double-checking before merge: 1. PR description vs. actual behavior: raw JSON schema publishing is still supported The description states:
But 2. Bundle
Minor/non-blocking:
I wasn't able to run |
massdriver 2.3.0 Created-by: HarmonybrewBot Commit-by: HarmonybrewBot Merged-by: HarmonybrewBot Description: Created by `brew bump` --- Created with `brew bump-formula-pr`.<details> <summary>release notes</summary> <pre># Resource types are now OCI artifacts Resource types are versioned, immutable OCI artifacts authored as a `massdriver.yaml`, replacing the unversioned raw-JSON-schema format. - **`mass resource-type create <name>`** — create a resource type repository in your organization's catalog. Supports custom attributes via `-a`. - **`mass resource-type publish [path]`** — publish a `massdriver.yaml`. `path` may be a directory or the `massdriver.yaml` itself, and defaults to the current directory. Publishing is immutable: republishing an existing version is rejected before any upload work. - **`mass resource-type pull <name>[@<version>]`** — pull a published resource type to a local directory. Accepts a concrete version, a release channel, or `latest`. Prompts before overwriting unless `-f`. - **`mass resource-type convert <schema-file>`** — convert a raw JSON/YAML schema into an equivalent `massdriver.yaml`, extracting inlined instruction and export content into referenced files. - **`mass resource-type list`** and **`get`** — `get` gains `-o json` and `--schema` for the resolved JSON schema. - **`mass resource-type delete`** — refuses repositories that already have published versions, matching platform immutability. Published artifacts contain only `massdriver.yaml`, readme, changelog, icon files, and the instruction/export templates the `massdriver.yaml` references. A reference that resolves outside the directory or doesn't exist now fails the publish instead of silently shipping an incomplete artifact. ### Deprecated: raw JSON schema resource types Publishing a raw `.json`/`.yaml` schema still works but prints a deprecation warning and points at `mass resource-type convert`. Raw schemas have no version of their own and are stored as the unversioned `0.0.0` document, so they cannot participate in versioning. This path will be removed in a future release. Note: resource types published as raw schemas predate OCI and cannot be pulled — `mass resource-type pull` now says so explicitly instead of surfacing a raw registry error. ### Bundles - `resources` and `dependencies` replace `artifacts` and `connections` as the input terms. The legacy blocks still work and now **warn** instead of failing. The two forms of a slot remain mutually exclusive. - Bundle packaging, publishing, and pulling moved onto the OCI implementation shared with resource types. `.mdignore` handling is unchanged. ### Fixes - **`mass resource-type create` failed outright** with `unknown artifact type "RESOURCE_TYPE"`. The artifact-type resolver now accepts the SDK's enum spelling, so underscores match hyphens. This blocked creating — and therefore publishing — any new resource type. - **Publishing to a repository that doesn't exist** reported a raw GraphQL not-found error. Both `mass resource-type publish` and `mass bundle publish` now name the command that creates it. - **`mass resource-type publish` of a raw schema** printed the resource type's human label rather than its identifier, so the success line couldn't be pasted into `mass resource-type get`. - **Integer values in converted schemas** were corrupted into scientific notation (`1000000` → `1e+06`). Conversion now preserves integers. - Instruction and export template paths are resolved correctly during publish. ## PRs * Manage resource types via OCI (create/get/list/publish/pull/delete/convert) by @chrisghill in massdriver-cloud/mass#249 **Full Changelog**: https://github.com/massdriver-cloud/mass/compare/2.2.1...2.3.0</pre> <p>View the full release notes at <a href="https://github.com/massdriver-cloud/mass/releases/tag/2.3.0">https://github.com/massdriver-cloud/mass/releases/tag/2.3.0</a>.</p> </details> <hr> See merge request: Harmonybrew/homebrew-core!18365
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).