Repository navigation
refactor: remove the Betty naming (#549) - #550
Merged
Merged
Conversation
The name referred to an unrelated project and said nothing about what the code does, so no reader could learn its meaning from this repository — while it appeared in the public documentation of all 65 plugins, since docs/services.md advertised a "Betty CFN resource types" section per service. Thirty-five emulator/betty*.go files are renamed for what they contain (betty.go -> client.go, betty_cfn.go -> cfn_deployer.go, betty_report.go -> validation_report.go, betty_debug.go -> debug_session.go), as is examples/betty_workflow/. Every rename is a git mv, so --follow and blame still reach each file's history. Only two exported identifiers carried the name. BettyClient is now a type alias for Client, not a defined type, so a consumer holding both spellings keeps compiling; NewBettyClient is a one-line wrapper. Both are marked Deprecated and go at v1.0.0, the only point a Go module can drop an exported symbol without breaking the import path. Pure rename: no behaviour change, so a bisect over it cannot land on a mixed commit. Closes #549
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Closes #549
Per the user's request: the name refers to an unrelated project, so remove it — internally outright, and behind a deprecation schedule where it is externally facing.
Why it mattered
Nobody reading this repository could learn what "Betty" designated, and it was not confined to internals:
docs/services.mdadvertised a Betty CFN resource types section for every one of 65 plugins, so the name was in the public documentation of the whole service surface. A reader grepping for CloudFormation deployment did not findbetty_cfn.go.What was externally facing
Measured rather than assumed. Two exported identifiers carried the name:
emulator.BettyClientandemulator.NewBettyClient.Intent,DeployResult,DeployedResource,ValidationReport,DebugSession,StackDeployerand every method were already neutrally named. So the deprecation surface is two symbols and everything else renames outright.The deprecation
BettyClientis now a type alias forClient, not a defined type:That distinction is the whole point. An alias means a consumer holding both a
*BettyClientand a*Client, or passing one where the other is expected, keeps compiling for the entire deprecation window; a defined type would have made the rename a breaking change wearing a deprecation's clothes. Since both spellings compile in isolation, nothing but a test catches the difference —TestClient_DeprecatedBettyAliasesStillWorkpasses the deprecated type through a function declared to take the new one and back, so re-declaring it astype BettyClient Clientstops the build. It also deploys through the deprecated constructor, so the old path is exercised rather than merely compiled.Both are marked
// Deprecated:naming the replacement and the removal release, sostaticcheckflags a consumer's use without breaking their build. Removal is at v1.0.0 — the only point a Go module can drop an exported symbol without breaking the import path for every consumer, which is why removal is tied to that rather than to a date.The renames
betty.goclient.gobetty_cfn.gocfn_deployer.gobetty_report.govalidation_report.gobetty_debug.godebug_session.gobetty_cfn_{delete,rollback,yaml,…}*.gocfn_*betty_cfn_vNN_plugins.gocfn_resources_vNN.goexamples/betty_workflow/examples/validation_workflow/All 35 files moved with
git mv, sogit log --followandgit blamestill reach each file's history — worth checking in the "Files changed" view, which shows them as renames rather than delete/add pairs.On the
vNNsuffix, which the issue left open: it stays. Those files are named for the substrate release that added them, and several releases touched overlapping services — RDS appears in two files, EC2 in two — so renaming by service would mean merging file contents. That is a refactor, not a rename, and putting it in this diff would make the diff unreviewable. Instead each file now opens with a header naming the services it holds, which is what the file name could not:Also renamed: the generated-docs heading is now CloudFormation resource types (32 occurrences — hand-written outside the generator's markers, so
docs/services.mdis edited directly andmake docs-reference-checkstays clean), plusREADME.md,docs/fidelity.md,examples/README.md,emulator/doc.go's Quick Start, and every stale filename reference in a comment.The
area: bettyGitHub label was renamed in place toarea: cloudformationwithgh label edit, which preserves it on the issues already carrying it — deleting and recreating would not.Deliberately left alone
CHANGELOG.mdand the"v0.6.0 — Betty integration"option in.github/ISSUE_TEMPLATE/feature_request.yml. Both are historical records; rewriting a release label in a dropdown would make past issues unmatchable.grep -ril bettyover the repository now returns only those two and the deprecation aliases themselves.This is a pure rename
No behaviour change rides along, so the diff reads as a rename and a bisect across it cannot land on a mixed commit. #371 (flat-package growth) touches the same files and should be sequenced after this, not merged with it.
Verification
gofmt -l .,go build ./...,go vet ./...,golangci-lint run ./...→ 0 issues,make test(race),make docs-reference docs-reference-check docs-versions,npm --prefix docs run build,go vet -C test/e2e ./...,go test -C test/e2e ./.... The renamed example was also run end to end (go run examples/validation_workflow/main.go) and prints its validation report.Compatibility
Nothing breaks for a consumer.
emulator.BettyClientandemulator.NewBettyClientstill compile and still work; they emit a deprecation notice and go at v1.0.0. Anyone parsingdocs/services.mdby its### Betty CFN resource typesheading needs the new text.