Skip to content

Commit 5487696

Browse files
authored
fix(shard-distributor): remove trimming of prefixes (#7490)
<!-- Describe what has changed in this PR --> **What changed?** Reverting the trimprefix since we are using constants to compare the values that include that <!-- Tell your future self why have you made these changes --> **Why?** Constants that include the prefix are used to <!-- How have you verified this change? Tested locally? Added a unit test? Checked in staging env? --> **How did you test it?** Deployed in staging <!-- Assuming the worst case, what can be broken when deploying this change to production? --> **Potential risks** Corruption of db, which is already the case. <!-- Is it notable for release? e.g. schema updates, configuration or data migration required? If so, please mention it, and also update CHANGELOG.md --> **Release notes** <!-- Is there any documentation updates should be made for config, https://cadenceworkflow.io/docs/operation-guide/setup/ ? If so, please open an PR in https://github.com/cadence-workflow/cadence-docs --> **Documentation Changes** --------- Signed-off-by: edigregorio <[email protected]>
1 parent 4cf0d4f commit 5487696

File tree

3 files changed

+57
-57
lines changed

3 files changed

+57
-57
lines changed

common/types/sharddistributor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ package types
2424

2525
import "fmt"
2626

27-
//go:generate enumer -type=ExecutorStatus,ShardStatus,AssignmentStatus,MigrationMode -trimprefix=ExecutorStatus,ShardStatus,AssignmentStatus,MigrationMode -json -output sharddistributor_statuses_enumer_generated.go
27+
//go:generate enumer -type=ExecutorStatus,ShardStatus,AssignmentStatus,MigrationMode -json -output sharddistributor_statuses_enumer_generated.go
2828

2929
type GetShardOwnerRequest struct {
3030
ShardKey string

common/types/sharddistributor_statuses_enumer_generated.go

Lines changed: 55 additions & 55 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

service/sharddistributor/store/etcd/etcdtypes/state_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ func TestAssignedState_FromAssignedState(t *testing.T) {
112112
}
113113

114114
func TestAssignedState_JSONMarshalling(t *testing.T) {
115-
const jsonStr = `{"assigned_shards":{"1":{"status":"READY"}},"last_updated":"2025-11-18T12:00:00.123456789Z","mod_revision":42}`
115+
const jsonStr = `{"assigned_shards":{"1":{"status":"AssignmentStatusREADY"}},"last_updated":"2025-11-18T12:00:00.123456789Z","mod_revision":42}`
116116

117117
state := &AssignedState{
118118
AssignedShards: map[string]*types.ShardAssignment{

0 commit comments

Comments
 (0)