Skip to content

Regenerate types with client-gen (14-08-2026) - #630

Open
andrewstillv15 wants to merge 4 commits into
mainfrom
14-08-2026-schema-regen
Open

Regenerate types with client-gen (14-08-2026)#630
andrewstillv15 wants to merge 4 commits into
mainfrom
14-08-2026-schema-regen

Conversation

@andrewstillv15

@andrewstillv15 andrewstillv15 commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Summary

This is one in a series of MR's that attempt to get client-gen back to being the source of truth for our go api schema.

This specific MR does all of the stuff below, but more generally it:

  • gets the Campaign types in line with the graphql schema. That means adding missed types, and modifying client gen to permit campaign to be generated

  • Does the exact same thing with OnCall

  • Adds Package types.

  • Campaign structs (Campaign, CampaignConnection, CampaignCreateInput, etc.) were hand-authored directly into the generated files (PRs Add Campaigns #565, Add campaign CRUD client methods and check management #611) because client-gen unconditionally excluded anything named Campaign from generation, the same way it excludes the genuinely-unimplemented Group.

  • Fixed that exclusion in client-gen (OpsLevel/client-gen@14-08-2026-gen-fixes) and regenerated. This brings in CampaignTeamConnection, CampaignEndInput, CampaignFilterInput, CampaignReminderInput, CampaignSendReminderInput, and refreshed field sets/docs on the existing Campaign types.

  • CampaignUpdateInput.name/.projectBrief and CampaignCreateInput.projectBrief are kept as plain *string (not the generator's Nullable[string] default) — verified against the OpsLevel backend that explicit null is silently dropped on update (.compact) or has nothing to clear on create, so the tri-state wrapper would overpromise.

  • Separately picked up doc-comment wording fixes surfaced by the same regen (grammar, "api"->"API", "url"->"URL", curly apostrophes, trailing periods) — verified programmatically that every changed line differs only in its trailing comment text, no field/type/tag changes.

  • OnCall (PR Add OnCall types and Service.GetOnCalls for incident routing #619) had the same problem as Campaign: hand-authored because OnCallConnection needs edges (which client-gen's generic ConnectionBase[T] can't express), but the whole feature — including the plain OnCall struct, which has no edges dependency — got hand-written along with it. Added OnCallConnection to client-gen's existing "uses edges, not nodes" exclusion list (same mechanism already used for 4 other connections) and let OnCall itself generate normally, removing the duplicate from on_call.go.

  • Added new Package/PackageVersion/PackageConnection types — no conflicts with existing code, no client-gen changes needed.

Test plan

  • go vet ./... passes (build + all tests compile) after each commit
  • Diff scoped to one reviewed change per commit; verified programmatically that the wording commit touches only comment text
  • No other in-flight schema-regen diffs included

🤖 Generated with Claude Code

Campaign was hand-authored outside client-gen (PRs #565, #611) after
the generator started unconditionally excluding "Campaign" from
objects/connections/inputs. Fixing that exclusion (client-gen
14-08-2026-gen-fixes) now lets Campaign* flow through generation
normally, picking up CampaignTeamConnection, CampaignEndInput,
CampaignFilterInput, CampaignReminderInput, CampaignSendReminderInput,
and updated field sets/docs on the existing Campaign types.

CampaignUpdateInput.name/projectBrief and CampaignCreateInput.projectBrief
stay plain *string rather than the generator's default Nullable[string]:
verified against the OpsLevel backend that explicit null is either
silently dropped (update, via .compact) or has nothing to clear (create),
so the tri-state wrapper would overpromise.
Comment/description text only, verified programmatically that every
changed line is identical up to its trailing comment (no field, type,
or tag changes). Grammar fixes, "api"->"API", "url"->"URL", curly
apostrophes normalized, trailing periods removed.
OnCall itself (unlike OnCallConnection/OnCallEdge) has no edges-based
fields, so it can be generated normally now that client-gen properly
excludes only OnCallConnection. Removes the duplicate hand-written
definition from on_call.go; the generated version drops the explicit
graphql tags (unneeded, matches every other generated type) and models
the optional User field as UserId rather than *UserId, consistent with
how every other optional identifiable-object reference is generated.
New types from the schema, no conflicts with existing hand-written
code; generated cleanly with no client-gen changes needed.
@andrewstillv15 andrewstillv15 changed the title Regenerate Campaign types via client-gen Regenerate types with client-gen (14-08-2026) Aug 14, 2026
@andrewstillv15

Copy link
Copy Markdown
Contributor Author

sister code on client-gen https://github.com/OpsLevel/client-gen/pull/22/changes

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.

1 participant