Scaffold the Go project, CLI skeleton, and cloud authentication#7
Merged
Conversation
Establish the module path github.com/B42Labs/openstack-tester (rooted at the repository root) and ignore the built binary and common Go/editor artifacts. This settles the module-path open decision from the README. Assisted-by: Claude:claude-opus-4-8 Signed-off-by: Christian Berendt <berendt@b42labs.com>
Add internal/config.NewNetworkClient, which parses clouds.yaml via gophercloud v2 (honoring OS_CLOUD, overridable with an explicit cloud name) and returns an authenticated NetworkV2 service client. Error paths are covered by a hermetic unit test; the happy path runs against a real cloud behind the 'integration' build tag, since this package is a ports-and-adapters seam to OpenStack. Assisted-by: Claude:claude-opus-4-8 Signed-off-by: Christian Berendt <berendt@b42labs.com>
Add the openstack-tester binary: a cobra root command with the five global flags (--os-cloud, --concurrency, --timeout, --seed, --log-level), slog structured logging configured from --log-level, and the neutron command namespace. The six documented subcommands (generate, apply, status, report, cleanup, verify) are stubs; the working list-networks subcommand authenticates and issues one trivial NetworkV2 call as an end-to-end smoke test. This settles the CLI-framework open decision (cobra). Assisted-by: Claude:claude-opus-4-8 Signed-off-by: Christian Berendt <berendt@b42labs.com>
Run go build, go vet, go test, and golangci-lint on every push to main and on pull requests. Third-party actions are pinned by commit SHA with a version comment per supply-chain hygiene, and the Go version is read from go.mod so CI and the module stay in sync. Assisted-by: Claude:claude-opus-4-8 Signed-off-by: Christian Berendt <berendt@b42labs.com>
Update the status blurb to reflect the scaffold, CLI skeleton, and clouds.yaml authentication now existing, and mark the CLI-framework (cobra) and module-path (github.com/B42Labs/openstack-tester) open decisions as resolved. Assisted-by: Claude:claude-opus-4-8 Signed-off-by: Christian Berendt <berendt@b42labs.com>
Assisted-by: Claude:claude-opus-4-8 Signed-off-by: Christian Berendt <berendt@b42labs.com>
berendt
marked this pull request as ready for review
June 24, 2026 07:45
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 #2
Summary
Lays down the repository foundation that every other package will build on: a Go module, the
cmd/internalpackage layout, acobra-based CLI exposing theneutroncommand namespace, andclouds.yaml-based authentication that yields a working gophercloud v2 NetworkV2 client. Global flags, structured logging, and CI (build, vet, lint, test) are wired here, and the previously-open module-path and CLI-framework decisions are settled.Demoable on its own:
neutron --helplists the subcommands, andneutron list-networksauthenticates against the configured cloud and issues one trivial NetworkV2 call as an end-to-end auth/connectivity smoke test.Change set (in commit order)
5b653dcInitialize Go module and add .gitignore — Addsgo.mod(module github.com/B42Labs/openstack-tester,go 1.26.1) with thegophercloud/gophercloud/v2andspf13/cobradirect dependencies plus the resolvedgo.sum, and a.gitignorecovering the built binary, Go test/coverage artifacts, and editor/OS files.bce2f01Add config package for clouds.yaml NetworkV2 auth — Introducesinternal/configwithNewNetworkClient(ctx, cloudName). It parsesclouds.yaml(selecting the cloud fromOS_CLOUDwhencloudNameis empty), builds an authenticated provider client with TLS config, and returns a NetworkV2 service client, wrapping every failure path with context. Ships a unit test (config_test.go) covering the no-cloud and missing-file error paths, and anintegration-tagged test (config_integration_test.go) that exercises a real cloud, skipped unlessOS_CLOUDis set.8e6e2a2Add cobra CLI skeleton with neutron stub subcommands — Adds thecmd/openstack-testerbinary:main.go(root command execution with acontext.Background()),root.go(root command, the--os-cloud/--concurrency/--timeout/--seed/--log-levelpersistent flags, and slog-based structured logging configured inPersistentPreRunE),neutron.go(theneutronnamespace withgenerate,apply,status,report,cleanup, andverifystubs that return a not-implemented error), andlist_networks.go(a workinglist-networkssubcommand wired tointernal/config).root_test.goasserts subcommand/flag registration, log-level parsing, thatneutron --helpruns, and that the stubs return errors.25cf16eAdd CI workflow for build, vet, lint, and test — Adds.github/workflows/ci.yml(abuildjob runninggo build/go vet/go testand alintjob runninggolangci-lint, both pinned by commit SHA and reading the Go version fromgo.mod) plus a minimal v2-schema.golangci.yml.9d11432Record resolved module-path and CLI decisions in README — Updates the README status to "Phase 1 in progress" and marks the two open decisions as resolved: CLI framework iscobra, and the module path isgithub.com/B42Labs/openstack-testerat the repository root.Notes / divergences from the issue
github.com/osism/testbed/contrib/openstack-testerunder acontrib/directory as a candidate. This branch resolves the open decision togithub.com/B42Labs/openstack-testerwith the module at the repository root (nocontrib/), and records that in the README.go test ./.... That is a superset of what was requested and keeps the unit tests gated in CI.list-networks— Beyond the six stub subcommands,neutron list-networksis implemented as a real read-only NetworkV2 call. This is the "trivial API call such as listing networks" the issue names as the demo criterion, rather than an extra feature.Implemented by planwerk-review a24f4d9 with Claude:claude-opus-4-8