Skip to content

feat!: sync the OpenAPI spec with the production spec (EMSR-2795) - #1031

Merged
katc1004 merged 2 commits into
mainfrom
kchern/EMSR-2795/sync-openapi-flag-release-plans
Nov 17, 2026
Merged

katc1004 merged 2 commits into
mainfrom
kchern/EMSR-2795/sync-openapi-flag-release-plans

Conversation

@katc1004

@katc1004 katc1004 commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The flag release plans API went public on 2026-11-13 (launchdarkly/gonfalon#78896, EMSR-2718). The vendored ld-openapi.json is from the 2026-11-02 sync (#963), so ldcli has no commands for it and the daily Check OpenAPI updates job fails. Ticket: EMSR-2795.

Changes

I ran make openapi-spec-download and the resource generator (go run resources/gen_resources.go from cmd/). I did not commit the dev server regen from make generate. That output does not compile, and #969 fixes it separately. Its input is the dev server's own api.yaml, so it is not related to this sync.

New command groups:

  • flag-release-plans-beta: list, get, create, update, delete
  • environment-release-plans-beta: list, get, create, replace, delete, get-default, set-default, clear-default

The segments group gets list-scheduled-changes, get-scheduled-change, create-scheduled-change, update-scheduled-change, and delete-scheduled-change.

Other changes from the same spec download: agent-control list-agent-skills gets a --sort flag, and audit-log create-entries gets a --rollup flag. Nine other generated blocks change only their description text: agent-control list-agent-optimizations, experiments update, feature-flags update, the four integrations-beta commands, and the environment-releases-beta and segments group descriptions.

Both new groups send the LD-API-Version: beta header on every request.

One hand-written change: two entries in mapOperationIdToCmdUse name the default release plan commands set-default and clear-default. The generated names were replace-default and delete-default, which describe a PUT and a DELETE on a plan. These operations set or clear which plan is the environment's default, so the names follow the operation summaries.

One naming note: the flag release plan PUT becomes update, and the environment release plan PUT becomes replace. The generator maps the operation ids updateFlagReleasePlan and PutEnvironmentReleasePlan by their verb. A rename of the operation id is a breaking change for every generated API client, so I left it as is.

Breaking changes

The production spec removed the "Release policies (beta)" tag, so this command group goes away:

Before After
release-policies-beta (list, get-release-policy, create-release-policy, replace-release-policy, delete-release-policy, create-order) Removed

No hand-written code in this repository refers to the removed commands. The commit carries a BREAKING CHANGE footer for release-please.

Testing

Automated Tests

go build ./..., go test ./... (64 packages), and golangci-lint run pass. A second run of the generator on the committed tree leaves no diff, so scripts/check-openapi-changed.sh reports "The OpenAPI has not changed."

Manual Tests

I ran every flag-release-plans-beta command against the catamorphic instance, project kathytest, with a throwaway plan that I deleted at the end:

$ ./ldcli flag-release-plans-beta create --project kathytest -d '{"key":"ldcli-smoke","name":"ldcli smoke","environments":[{"environmentKey":"test","triggerType":"manual","isImmediate":true},{"environmentKey":"production","triggerType":"promotion","isImmediate":true}]}'
{"_id":"df148424-...","default":false,"environments":[...],"executionMode":"sequential","key":"ldcli-smoke","name":"ldcli smoke","version":1}

$ ./ldcli flag-release-plans-beta get --project kathytest --plan ldcli-smoke --fields key,name,version
{"key": "ldcli-smoke", "name": "ldcli smoke", "version": 1}

$ ./ldcli flag-release-plans-beta update --project kathytest --plan ldcli-smoke -d '{"name":"ldcli smoke renamed","environments":[{"environmentKey":"test","triggerType":"manual","isImmediate":true}]}' --fields key,name,version
{"key": "ldcli-smoke", "name": "ldcli smoke renamed", "version": 2}

$ ./ldcli flag-release-plans-beta list --project kathytest
{"_links":{...},"items":[{"key":"ldcli-smoke",...}],"totalCount":1}

$ ./ldcli flag-release-plans-beta delete --project kathytest --plan ldcli-smoke
{"key": "ldcli-smoke"}

$ ./ldcli flag-release-plans-beta get --project kathytest --plan ldcli-smoke
{"code":"not_found","message":"Releases: flag release plan \"ldcli-smoke\" not found in project \"kathytest\"","statusCode":404,...}

environment-release-plans-beta list --project kathytest --environment production also returns 200.

To test it yourself, build with make build and run the commands above against a project in an account that has the enable-flag-release-plans flag. Without the flag, every call returns 404.

Rollout

This is a generated-code change with no hand-written logic. The risk is the removal of the release-policies-beta group. The public spec no longer documents the release policies API, but the API is deprecated, not removed. If you still call it with ldcli, pin ldcli 3.16.0 or call the API directly.

Release-please PR #1002 (4.0.0) is open and is already a major bump from #963. If this PR merges before 4.0.0 is cut, both breaking changes ship in one major version. If the team prefers to release 4.0.0 first, this PR can wait and ship as 5.0.0.

No feature flags in ldcli. To roll back, revert the commit and the generated commands return to the 2026-11-02 spec.

🤖 Generated with Claude Code


Note

Overview
Regenerates CLI resources from the latest production OpenAPI spec, exposing beta command groups for flag release plans and environment release plans (including default-plan get/set/clear), and adds segment scheduled change list/get/create/update/delete commands.

The deprecated release-policies-beta command group is removed to match the spec. Existing environment-releases-beta behavior is unchanged aside from doc tweaks; agent-control list-agent-skills gains --sort, audit-log create-entries gains --rollup, and several operation help texts are refreshed (experiments assignment sources, flag lifecycle deprecate/restore rules, integrations scope notes, segment docs). resource_utils.go maps default environment release plan operations to set-default and clear-default subcommands.

Reviewed by Cursor Bugbot for commit 178d587. Bugbot is set up for automated code reviews on this repo. Configure here.


Related Jira issue: EMSR-2795: Release ldcli version with flag-release-plans-beta commands (generated from openapi)

Download the production OpenAPI spec and regenerate the resource
commands. The last sync was on 2026-11-02.

The sync adds the flag-release-plans-beta and
environment-release-plans-beta command groups, and the scheduled-change
commands in the segments group. Ticket: EMSR-2795.

BREAKING CHANGE: The production spec removed the "Release policies (beta)"
tag. The release-policies-beta command group no longer exists.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@launchdarkly-upra launchdarkly-upra Bot changed the title feat!: sync the OpenAPI spec with the production spec [EMSR-2795] feat!: sync the OpenAPI spec with the production spec Nov 16, 2026
@katc1004 katc1004 changed the title [EMSR-2795] feat!: sync the OpenAPI spec with the production spec feat!: sync the OpenAPI spec with the production spec Nov 16, 2026
@launchdarkly-upra launchdarkly-upra Bot changed the title feat!: sync the OpenAPI spec with the production spec [EMSR-2795] feat!: sync the OpenAPI spec with the production spec Nov 16, 2026
@katc1004 katc1004 changed the title [EMSR-2795] feat!: sync the OpenAPI spec with the production spec feat!: sync the OpenAPI spec with the production spec (EMSR-2795) Nov 16, 2026
@katc1004
katc1004 marked this pull request as ready for review November 16, 2026 19:59
@katc1004
katc1004 requested a review from a team as a code owner November 16, 2026 19:59
@katc1004
katc1004 requested review from a team and nieblara and removed request for a team November 16, 2026 20:00

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 50aeaae. Configure here.

Comment thread cmd/resources/resource_cmds.go Resolved
Comment thread cmd/resources/resource_cmds.go Resolved
Comment thread cmd/resources/resource_cmds.go Resolved
Comment thread cmd/resources/resource_cmds.go Resolved
…ault

The generated names replace-default and delete-default describe a PUT
and a DELETE on a plan. These operations set or clear which plan is the
environment's default, so the names follow the operation summaries.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@katc1004
katc1004 merged commit 85f30b2 into main Nov 17, 2026
12 checks passed
@katc1004
katc1004 deleted the kchern/EMSR-2795/sync-openapi-flag-release-plans branch November 17, 2026 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants