Skip to content

feat(cli): bundle the v0.4.0 base spec and release a minor version - #1090

Merged
SnowboardTechie merged 1 commit into
mainfrom
bryan/1052-cli-v0.4.0-base-spec
Aug 14, 2026
Merged

feat(cli): bundle the v0.4.0 base spec and release a minor version#1090
SnowboardTechie merged 1 commit into
mainfrom
bryan/1052-cli-v0.4.0-base-spec

Conversation

@SnowboardTechie

@SnowboardTechie SnowboardTechie commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

Changes proposed

  • Add a minor changeset for @common-grants/cli (0.3.9 → 0.4.0) announcing that the v0.4.0 base spec is bundled and selectable via cg check spec --protocol-version 0.4.0, and that a bare cg check spec now resolves to it.
  • Parameterize the protocolVersion accept cases over every bundled version. This adds 0.4.0, closes a pre-existing gap where 0.3.0 had no coverage at all, and replaces three copy-pasted blocks with one.
  • Refresh the stale --protocol-version examples in the CLI README (0.1.0) and man page (0.2.0) to 0.4.0.

No source changes. getAvailableBaseVersions() already discovers versions by scanning lib/openapi/ at runtime, so 0.4.0 became selectable the moment the spec file landed.

Context for reviewers

Why this is a release rather than a code change. lib/cli/lib/openapi/openapi.0.4.0.yaml reached main in d4293de, the chore: bump version [skip ci] commit for the core v0.4.0 release — not in a reviewed PR. ci-bump-version.yml runs pnpm --filter @common-grants/cli run build before versioning; the CLI's typespec:clean does rm -rf lib/openapi/* and typespec:openapi regenerates every version core declares, and the workflow then commits with git add ..

Two consequences worth knowing:

  1. The v0.4.0 spec has been shipping since @common-grants/cli@0.3.7 with nothing in the CLI changelog. I confirmed it is in the published 0.3.9 tarball and that cg check spec --protocol-version 0.4.0 works against it today.
  2. Because getBaseSpecPath() takes availableVersions[0], the default base spec silently moved from 0.3.0 to 0.4.0 in that same patch release.

The default flip is benign: every route 0.4.0 adds (Awards, Organizations) is tagged experimental, and the only required-tagged routes remain the two /common-grants/opportunities GETs. I verified a 0.3.0-compliant spec still passes against the 0.4.0 base. The changeset documents both facts so the 0.4.0 changelog entry is accurate.

About the test. The version list is a literal rather than availableVersions, deliberately — iterating the live list would be self-referential, since a dropped spec file would just shrink the loop and pass silently. As written, each version is pinned: deleting openapi.0.1.0.yaml, openapi.0.3.0.yaml, or openapi.0.4.0.yaml fails that version's own named case, and hardcoding the protocolVersion enum away from availableVersions fails too. I confirmed each by mutation. This matters because every CLI build wipes and regenerates lib/openapi/.

Verification. Full ci-lib-cli.yml gate green locally (core build → cli checks → test:coverage (121 passed) → cli build → pnpm audit). Also: after run build, git status lib/cli/lib/openapi/ is clean, so the four committed specs are byte-for-byte what core 0.4.0 emits.

Packed the CLI and installed it into a scratch directory outside the repo, per the DEVELOPMENT.md pre-release checklist. Against the installed package: --protocol-version 0.4.0 validates, no-flag validates (default resolves to 0.4.0), --protocol-version 0.3.0 still validates, and a bad version reports expected one of "0.4.0"|"0.3.0"|"0.2.0"|"0.1.0".

One incidental note: npm pack fails repo-wide right now (must not have multiple workspaces with the same name) because lib/changelog-emitter's build copies its package.json into dist/. pnpm pack works. Not touched here since it is unrelated to this change, but the DEVELOPMENT.md checklist still says npm pack.

Additional information

Post-merge, ci-bump-version.yml bumps 0.3.9 → 0.4.0 and pushes tag @common-grants/cli@0.4.0; cd-deploy-lib-cli.yml then needs a manual trigger with that tag to publish.

@github-actions github-actions Bot added cli Issue or PR related to the @common-grants/cli library typescript Issue or PR related to TypeScript tooling labels Aug 13, 2026
The v0.4.0 base spec reached `lib/cli/lib/openapi/` in the core v0.4.0
version-bump commit (d4293de), because `ci-bump-version.yml` builds the CLI
before versioning and the build regenerates that directory. It has therefore
been shipping since `@common-grants/cli@0.3.7` with no changelog entry, and
`cg check spec` has silently defaulted to it since then.

Add the minor changeset that announces the capability. Parameterize the
protocolVersion accept cases over every bundled version, which closes a
pre-existing gap where 0.3.0 had no coverage and drops three copy-pasted
blocks. Refresh the stale `--protocol-version` examples in the README and man
page.
@SnowboardTechie
SnowboardTechie force-pushed the bryan/1052-cli-v0.4.0-base-spec branch from 750c1d6 to f355be7 Compare August 13, 2026 16:57
@SnowboardTechie
SnowboardTechie marked this pull request as ready for review August 13, 2026 16:58

@widal001 widal001 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making these updates!

@SnowboardTechie
SnowboardTechie merged commit 2152bea into main Aug 14, 2026
5 checks passed
@SnowboardTechie
SnowboardTechie deleted the bryan/1052-cli-v0.4.0-base-spec branch August 14, 2026 15:12
SnowboardTechie added a commit that referenced this pull request Aug 14, 2026
The changeset from #1090 landed on main after this branch removed the
changesets machinery, so the merge from main reintroduced it as an
orphan. Release-please will cut the CLI 0.4.0 release from the
conventional feat(cli) commit instead.
SnowboardTechie added a commit that referenced this pull request Aug 14, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.4.0](https://github.com/HHS/simpler-grants-protocol/compare/@common-grants/cli@0.3.9...@common-grants/cli@0.4.0)
(2026-08-14)


### Features

* **cli:** bundle the v0.4.0 base spec and release a minor version
([#1090](#1090))
([2152bea](2152bea))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Bryan Thompson <bryan@snowboardtechie.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli Issue or PR related to the @common-grants/cli library typescript Issue or PR related to TypeScript tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CLI] Include the v0.4.0 base spec

2 participants