Conversation
Consumers embed this repository as a git submodule, which works for a repo testing itself but not for a test framework that wants to be distributed: a Go module cannot carry a submodule of another repository, so every suite built on the testbed has to re-do the checkout wiring. Add a root Go module that embeds the compose stack, the Gherkin suites, the flag definitions and the test root certificate, so Go suites can depend on a released testbed through go.mod instead. The module has no dependencies, and leaves the choice of compose runner and Cucumber implementation to the consumer. The CA key is deliberately left out - it is only needed to build the image. The module path carries the /v3 suffix required for major versions >= 2, so the existing release tags double as module versions. Tags cut before this commit have no root go.mod and are therefore not resolvable as /v3 module versions; the first consumable version is the next release. Signed-off-by: Simon Schrottner <simon.schrottner@flagsmith.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: Comment |
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.
This PR
Adds a root Go module,
github.com/open-feature/flagd-testbed/v3, that embeds the testbed assets: the compose stack, the Gherkin suites, the flag definitions and the test root certificate.Why
Consumers embed this repository as a git submodule. That works for an SDK repository testing itself, but it breaks down for a test framework that wants to be distributed — a Go module cannot carry a submodule of another repository, so anything built on the testbed has to re-do the checkout wiring, and the shared step definitions in
go-sdk-contrib/tests/flagdcannot be consumed as an ordinary dependency.With the module, a Go suite depends on a released testbed through
go.mod, and renovate updates it like any other dependency:Materialize(dir)is there for runners that need the stack on disk.Notes for review
/v3suffix, as Go requires at major version 2 and above. The upside is that the existing release tags double as module versions, so release-please needs no changes at all. The cost is a path rename atv4.0.0— which downstream has to react to on a major testbed bump anyway.go.modand therefore cannot be resolved as/v3module versions. The first consumable version is the next release.ssl/custom-ca.keyis not embedded. It is only needed to build the image, and a private key has no business travelling into consumers' module caches. Only the certificate does.launchpadmodule is excluded from the root module automatically, so the launchpad sources are not shipped.${VERSION:-vX.Y.Z}default matchesversion.txt. release-please stamps them independently, and a consumer pinning the module gets the wrong image if they ever disagree.gojob. It also runs the launchpad tests, which were not running anywhere before.Verified against a consumer
go-sdk-contribwas flipped over in open-feature/go-sdk-contrib#962 (draft, blocked on this PR): submodule removed from.gitmodules, the framework reading the stack, suites and certificate from this module, resolved from a pseudo-version through the proxy. The testbed comes up and 310 scenarios execute with no checkout of this repository anywhere. That branch also shows what the version jump from the pinned 3.8.0 to 3.10.1 costs the Go provider — two changed configuration defaults and ~40 steps with no definitions — but that is adoption work, unrelated to this PR.