Conversation
The gate this flag controlled diverted connectors into the retired processing vault. Every reader was removed in chargehive-assemble#1715, so the field is now inert - but nothing said so, leaving it easy to reintroduce a gate on it. It could not be honoured even in principle: the field is a bool tagged omitempty, so "unset" and "explicitly false" serialise identically and there is no merchant opt-out to preserve. Deprecating rather than deleting, because utils.Validate decodes with DisallowUnknownFields. Removing the declaration would fail `chive validate` and `chive apply` with `json: unknown field "enablePCIB"` for every stored config that still sets it - dev alone has 147 connectors. The field goes once those are known clean. Added a test asserting a Connector config carrying enablePCIB still validates. Verified it fails with exactly that unknown-field error when the declaration is taken away, so the reason for keeping it is enforced rather than just documented. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Why
The gate
EnablePCIBcontrolled diverted connectors into the retired processing vault. chargehive-assemble#1715 removed every reader, so the field is now inert — but nothing in the type said so, leaving it easy for someone to reasonably reintroduce a gate on it.It could not be honoured even in principle: it's a
booltaggedomitempty, so "unset" and "explicitly false" serialise identically. There is no merchant opt-out to preserve, which is also why inverting it todisablePCIBwas never an option.Why deprecate rather than delete
utils.Validatedecodes viaobject.FromJsonStrict→DisallowUnknownFields, and bothchive validateandchive apply(chargehive-cli/cmd/validate.go:68,cmd/apply.go:85) go through it. Deleting the declaration would fail every stored config that still carries the key:Dev alone has 147 connectors. The field can be deleted once stored configs are known clean — the doc comment says so explicitly.
Changes
// Deprecated:marker on the field recording that it is ignored, why it cannot be honoured, and why the declaration stays.TestDeprecatedEnablePCIBStillValidates— asserts a Connector config carryingenablePCIBstill validates cleanly.Test plan
go build ./...— clean.go test ./...— entire suite passes, no failures.map[json:json: unknown field "enablePCIB"] does not equal map[]— precisely the breakage this PR exists to prevent. Restored and re-run green.go vet ./...reports two findings, both pre-existing in untouched files (v1/policy/method_verify.go:26struct tag spacing,utils/generate.go:396unkeyed fields).Follow-up
Deleting the field needs a sweep of stored configs first —
chargehive_object.active_objectswherekind='Connector'and the spec still containsenablePCIB. Not attempted here.🤖 Generated with Claude Code