Skip to content

roachtest: rename clusterImpl to roachprodCluster#169384

Open
golgeek wants to merge 6 commits intocockroachdb:masterfrom
golgeek:ludo/rt-rename-clusterImpl-to-roachprodCluster
Open

roachtest: rename clusterImpl to roachprodCluster#169384
golgeek wants to merge 6 commits intocockroachdb:masterfrom
golgeek:ludo/rt-rename-clusterImpl-to-roachprodCluster

Conversation

@golgeek
Copy link
Copy Markdown
Contributor

@golgeek golgeek commented Apr 29, 2026

Stacked on #169382.

Remove the type alias (roachprodCluster = clusterImpl) introduced in the previous refactoring PR and rename the struct itself.
This gives the roachprod-backed cluster implementation a self-documenting name, making it clear which backend is in use and leaving room for future alternative implementations.

Purely mechanical rename; no behavior changes.

Epic: none
Release note: None

golgeek added 2 commits April 29, 2026 13:59
Introduce `testCluster`, an internal interface that captures the
runner's view of a cluster. The runner currently accesses many
`clusterImpl` fields directly; the interface forces these accesses
through methods so that alternative cluster backends can be plugged
in without touching runner internals.

The interface embeds `cluster.Cluster` (the public test API) and adds
the lifecycle and configuration methods the runner needs: destroy,
save, wipe, cockroach staging, labels, and architecture/encryption
knobs. `clusterImpl` satisfies the new interface; no behavior changes.

Epic: none
Release note: None
Replace `*clusterImpl` with `testCluster` throughout the runner,
cluster registry, github issue reporting, and test monitor. All
direct field accesses (e.g. `c.arch`, `c.encAtRest`,
`c.clusterSettings`) are replaced with the corresponding interface
methods introduced in the previous commit.

A few methods that were missing from the interface surface are added
here: `OS()`, `SetUseDRPC()`, `GetLiveMigrationVMs()`, `Extend()`,
`Saved()`, `status()`, and `SetClusterSetting()`.

In `github.go`, a nil-interface guard (`isNilTestCluster`) is added
because the cluster may be nil when constructing issue info for tests
that failed before cluster creation.

Epic: none
Release note: None
@golgeek golgeek requested a review from a team as a code owner April 29, 2026 21:55
@golgeek golgeek requested review from cpj2195 and srosenberg and removed request for a team April 29, 2026 21:55
@trunk-io
Copy link
Copy Markdown
Contributor

trunk-io Bot commented Apr 29, 2026

Merging to master in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@blathers-crl
Copy link
Copy Markdown

blathers-crl Bot commented Apr 29, 2026

Detected infrastructure failure (matched: self-hosted runner lost communication with the server). Automatically rerunning failed jobs. (run link)

golgeek and others added 4 commits April 29, 2026 18:23
Remove `assertConsistentReplicas` entirely: drop it from the
`testCluster` interface and delete the implementation on `clusterImpl`.
The method's only caller in `postTestAssertions` now uses
`roachtestutil.CheckReplicaDivergenceOnDB` directly, wrapped in a
20-minute timeout. Behavior is unchanged.

Epic: none
Release note: None
Separate the cluster factory's public entry point (`newCluster`) from
the roachprod-specific implementation (`newRoachprodCluster`). This
lets a future managed-service backend provide its own `newCluster`
without modifying the roachprod path.

Introduce the type alias `roachprodCluster = clusterImpl` so that the
roachprod backend can be referenced by a self-documenting name. Rename
the `roachprodCluster` enum constant to `roachprodClusterType` to
avoid the name collision.

Epic: none
Release note: None
Replace a `c.(*clusterImpl).encAtRest` type assertion in the test
helpers with an interface-based accessor
(`c.(interface{ EncryptedAtRest() bool })`). This removes the last
direct reference to `*clusterImpl` outside the cluster package,
allowing tests to work with any `testCluster` implementation.

Epic: none
Release note: None
Remove the type alias (`roachprodCluster = clusterImpl`) introduced in
the previous PR and rename the struct itself. This gives the
roachprod-backed cluster implementation a self-documenting name,
making it clear which backend is in use and leaving room for future
alternative implementations.

Purely mechanical rename; no behavior changes.

Epic: none
Release note: None

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@golgeek golgeek force-pushed the ludo/rt-rename-clusterImpl-to-roachprodCluster branch from ae14db1 to 8467193 Compare April 29, 2026 22:28
@golgeek
Copy link
Copy Markdown
Contributor Author

golgeek commented Apr 30, 2026

TeamCity smoke tests:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants