Regenerate types with client-gen (14-08-2026) - #630
Open
andrewstillv15 wants to merge 4 commits into
Open
Conversation
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.
Contributor
Author
|
sister code on client-gen https://github.com/OpsLevel/client-gen/pull/22/changes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 namedCampaignfrom generation, the same way it excludes the genuinely-unimplementedGroup.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/.projectBriefandCampaignCreateInput.projectBriefare kept as plain*string(not the generator'sNullable[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 becauseOnCallConnectionneedsedges(which client-gen's genericConnectionBase[T]can't express), but the whole feature — including the plainOnCallstruct, which has no edges dependency — got hand-written along with it. AddedOnCallConnectionto client-gen's existing "uses edges, not nodes" exclusion list (same mechanism already used for 4 other connections) and letOnCallitself generate normally, removing the duplicate fromon_call.go.Added new
Package/PackageVersion/PackageConnectiontypes — no conflicts with existing code, no client-gen changes needed.Test plan
go vet ./...passes (build + all tests compile) after each commit🤖 Generated with Claude Code