Skip to content

Commit 099f995

Browse files
mattdhollowaySamMorrowDrums
authored andcommitted
revert "hold-bac feature flag"
1 parent 7b30c93 commit 099f995

File tree

6 files changed

+4
-88
lines changed

6 files changed

+4
-88
lines changed

pkg/github/projects.go

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,6 @@ const (
3030
// in favor of the consolidated project tools.
3131
const FeatureFlagConsolidatedProjects = "remote_mcp_consolidated_projects"
3232

33-
// FeatureFlagHoldBackLegacyProjects allows users to keep the old individual project tools
34-
// even after FeatureFlagConsolidatedProjects is enabled. This provides a transition period
35-
// for users who need more time to migrate to the consolidated tools.
36-
//
37-
// Deprecated: This flag will be removed in a future release. Users should migrate to
38-
// the consolidated project tools (projects_list, projects_get, projects_write).
39-
const FeatureFlagHoldBackLegacyProjects = "remote_mcp_holdback_legacy_projects"
40-
4133
// Method constants for consolidated project tools
4234
const (
4335
projectsMethodListProjects = "list_projects"
@@ -168,7 +160,6 @@ func ListProjects(t translations.TranslationHelperFunc) inventory.ServerTool {
168160
},
169161
)
170162
tool.FeatureFlagDisable = FeatureFlagConsolidatedProjects
171-
tool.FeatureFlagHoldBack = FeatureFlagHoldBackLegacyProjects
172163
return tool
173164
}
174165

@@ -260,7 +251,6 @@ func GetProject(t translations.TranslationHelperFunc) inventory.ServerTool {
260251
},
261252
)
262253
tool.FeatureFlagDisable = FeatureFlagConsolidatedProjects
263-
tool.FeatureFlagHoldBack = FeatureFlagHoldBackLegacyProjects
264254
return tool
265255
}
266256

@@ -370,7 +360,6 @@ func ListProjectFields(t translations.TranslationHelperFunc) inventory.ServerToo
370360
},
371361
)
372362
tool.FeatureFlagDisable = FeatureFlagConsolidatedProjects
373-
tool.FeatureFlagHoldBack = FeatureFlagHoldBackLegacyProjects
374363
return tool
375364
}
376365

@@ -466,7 +455,6 @@ func GetProjectField(t translations.TranslationHelperFunc) inventory.ServerTool
466455
},
467456
)
468457
tool.FeatureFlagDisable = FeatureFlagConsolidatedProjects
469-
tool.FeatureFlagHoldBack = FeatureFlagHoldBackLegacyProjects
470458
return tool
471459
}
472460

@@ -606,7 +594,6 @@ func ListProjectItems(t translations.TranslationHelperFunc) inventory.ServerTool
606594
},
607595
)
608596
tool.FeatureFlagDisable = FeatureFlagConsolidatedProjects
609-
tool.FeatureFlagHoldBack = FeatureFlagHoldBackLegacyProjects
610597
return tool
611598
}
612599

@@ -716,7 +703,6 @@ func GetProjectItem(t translations.TranslationHelperFunc) inventory.ServerTool {
716703
},
717704
)
718705
tool.FeatureFlagDisable = FeatureFlagConsolidatedProjects
719-
tool.FeatureFlagHoldBack = FeatureFlagHoldBackLegacyProjects
720706
return tool
721707
}
722708

@@ -831,7 +817,6 @@ func AddProjectItem(t translations.TranslationHelperFunc) inventory.ServerTool {
831817
},
832818
)
833819
tool.FeatureFlagDisable = FeatureFlagConsolidatedProjects
834-
tool.FeatureFlagHoldBack = FeatureFlagHoldBackLegacyProjects
835820
return tool
836821
}
837822

@@ -947,7 +932,6 @@ func UpdateProjectItem(t translations.TranslationHelperFunc) inventory.ServerToo
947932
},
948933
)
949934
tool.FeatureFlagDisable = FeatureFlagConsolidatedProjects
950-
tool.FeatureFlagHoldBack = FeatureFlagHoldBackLegacyProjects
951935
return tool
952936
}
953937

@@ -1037,7 +1021,6 @@ func DeleteProjectItem(t translations.TranslationHelperFunc) inventory.ServerToo
10371021
},
10381022
)
10391023
tool.FeatureFlagDisable = FeatureFlagConsolidatedProjects
1040-
tool.FeatureFlagHoldBack = FeatureFlagHoldBackLegacyProjects
10411024
return tool
10421025
}
10431026

pkg/inventory/filters.go

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,13 @@ func (r *Inventory) checkFeatureFlag(ctx context.Context, flagName string) bool
3838
// isFeatureFlagAllowed checks if an item passes feature flag filtering.
3939
// - If FeatureFlagEnable is set, the item is only allowed if the flag is enabled
4040
// - If FeatureFlagDisable is set, the item is excluded if the flag is enabled
41-
// - If FeatureFlagHoldBack is set and enabled, it overrides FeatureFlagDisable (keeps tool available)
42-
func (r *Inventory) isFeatureFlagAllowed(ctx context.Context, enableFlag, disableFlag, holdBackFlag string) bool {
41+
func (r *Inventory) isFeatureFlagAllowed(ctx context.Context, enableFlag, disableFlag string) bool {
4342
// Check enable flag - item requires this flag to be on
4443
if enableFlag != "" && !r.checkFeatureFlag(ctx, enableFlag) {
4544
return false
4645
}
4746
// Check disable flag - item is excluded if this flag is on
4847
if disableFlag != "" && r.checkFeatureFlag(ctx, disableFlag) {
49-
// Check if hold-back flag overrides the disable
50-
if holdBackFlag != "" && r.checkFeatureFlag(ctx, holdBackFlag) {
51-
return true // Hold-back keeps tool enabled during transition
52-
}
5348
return false
5449
}
5550
return true
@@ -75,7 +70,7 @@ func (r *Inventory) isToolEnabled(ctx context.Context, tool *ServerTool) bool {
7570
}
7671
}
7772
// 2. Check feature flags
78-
if !r.isFeatureFlagAllowed(ctx, tool.FeatureFlagEnable, tool.FeatureFlagDisable, tool.FeatureFlagHoldBack) {
73+
if !r.isFeatureFlagAllowed(ctx, tool.FeatureFlagEnable, tool.FeatureFlagDisable) {
7974
return false
8075
}
8176
// 3. Check read-only filter (applies to all tools)
@@ -135,7 +130,7 @@ func (r *Inventory) AvailableResourceTemplates(ctx context.Context) []ServerReso
135130
for i := range r.resourceTemplates {
136131
res := &r.resourceTemplates[i]
137132
// Check feature flags
138-
if !r.isFeatureFlagAllowed(ctx, res.FeatureFlagEnable, res.FeatureFlagDisable, res.FeatureFlagHoldBack) {
133+
if !r.isFeatureFlagAllowed(ctx, res.FeatureFlagEnable, res.FeatureFlagDisable) {
139134
continue
140135
}
141136
if r.isToolsetEnabled(res.Toolset.ID) {
@@ -162,7 +157,7 @@ func (r *Inventory) AvailablePrompts(ctx context.Context) []ServerPrompt {
162157
for i := range r.prompts {
163158
prompt := &r.prompts[i]
164159
// Check feature flags
165-
if !r.isFeatureFlagAllowed(ctx, prompt.FeatureFlagEnable, prompt.FeatureFlagDisable, prompt.FeatureFlagHoldBack) {
160+
if !r.isFeatureFlagAllowed(ctx, prompt.FeatureFlagEnable, prompt.FeatureFlagDisable) {
166161
continue
167162
}
168163
if r.isToolsetEnabled(prompt.Toolset.ID) {

pkg/inventory/prompts.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ type ServerPrompt struct {
1414
// FeatureFlagDisable specifies a feature flag that, when enabled, causes this prompt
1515
// to be omitted. Used to disable prompts when a feature flag is on.
1616
FeatureFlagDisable string
17-
// FeatureFlagHoldBack specifies a feature flag that, when enabled, overrides
18-
// FeatureFlagDisable and keeps the prompt available during a transition period.
19-
FeatureFlagHoldBack string
2017
}
2118

2219
// NewServerPrompt creates a new ServerPrompt with toolset metadata.

pkg/inventory/registry_test.go

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,56 +1077,6 @@ func TestFeatureFlagBoth(t *testing.T) {
10771077
}
10781078
}
10791079

1080-
func TestFeatureFlagHoldBack(t *testing.T) {
1081-
// Tool with disable flag and hold-back flag (simulates legacy tool during consolidation)
1082-
legacyTool := mockToolWithFlags("legacy_tool", "toolset1", true, "", "consolidation_flag")
1083-
legacyTool.FeatureFlagHoldBack = "holdback_flag"
1084-
1085-
tools := []ServerTool{
1086-
mockTool("always_available", "toolset1", true),
1087-
legacyTool,
1088-
}
1089-
1090-
// Consolidation OFF, hold-back OFF -> legacy tool available (normal operation)
1091-
checkerAllOff := func(_ context.Context, _ string) (bool, error) { return false, nil }
1092-
regAllOff := NewBuilder().SetTools(tools).WithToolsets([]string{"all"}).WithFeatureChecker(checkerAllOff).Build()
1093-
availableAllOff := regAllOff.AvailableTools(context.Background())
1094-
if len(availableAllOff) != 2 {
1095-
t.Fatalf("Expected 2 tools when both flags off, got %d", len(availableAllOff))
1096-
}
1097-
1098-
// Consolidation ON, hold-back OFF -> legacy tool excluded (migrated to new tools)
1099-
checkerConsolidationOnly := func(_ context.Context, flag string) (bool, error) {
1100-
return flag == "consolidation_flag", nil
1101-
}
1102-
regConsolidationOnly := NewBuilder().SetTools(tools).WithToolsets([]string{"all"}).WithFeatureChecker(checkerConsolidationOnly).Build()
1103-
availableConsolidationOnly := regConsolidationOnly.AvailableTools(context.Background())
1104-
if len(availableConsolidationOnly) != 1 {
1105-
t.Fatalf("Expected 1 tool when consolidation on but holdback off, got %d", len(availableConsolidationOnly))
1106-
}
1107-
if availableConsolidationOnly[0].Tool.Name != "always_available" {
1108-
t.Errorf("Expected always_available, got %s", availableConsolidationOnly[0].Tool.Name)
1109-
}
1110-
1111-
// Consolidation ON, hold-back ON -> legacy tool available (user opted to hold back)
1112-
checkerBothOn := func(_ context.Context, _ string) (bool, error) { return true, nil }
1113-
regBothOn := NewBuilder().SetTools(tools).WithToolsets([]string{"all"}).WithFeatureChecker(checkerBothOn).Build()
1114-
availableBothOn := regBothOn.AvailableTools(context.Background())
1115-
if len(availableBothOn) != 2 {
1116-
t.Fatalf("Expected 2 tools when both consolidation and holdback on, got %d", len(availableBothOn))
1117-
}
1118-
1119-
// Consolidation OFF, hold-back ON -> legacy tool available (hold-back has no effect when consolidation off)
1120-
checkerHoldbackOnly := func(_ context.Context, flag string) (bool, error) {
1121-
return flag == "holdback_flag", nil
1122-
}
1123-
regHoldbackOnly := NewBuilder().SetTools(tools).WithToolsets([]string{"all"}).WithFeatureChecker(checkerHoldbackOnly).Build()
1124-
availableHoldbackOnly := regHoldbackOnly.AvailableTools(context.Background())
1125-
if len(availableHoldbackOnly) != 2 {
1126-
t.Fatalf("Expected 2 tools when only holdback on, got %d", len(availableHoldbackOnly))
1127-
}
1128-
}
1129-
11301080
func TestFeatureFlagError(t *testing.T) {
11311081
tools := []ServerTool{
11321082
mockToolWithFlags("needs_flag", "toolset1", true, "my_feature", ""),

pkg/inventory/resources.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ type ServerResourceTemplate struct {
2222
// FeatureFlagDisable specifies a feature flag that, when enabled, causes this resource
2323
// to be omitted. Used to disable resources when a feature flag is on.
2424
FeatureFlagDisable string
25-
// FeatureFlagHoldBack specifies a feature flag that, when enabled, overrides
26-
// FeatureFlagDisable and keeps the resource available during a transition period.
27-
FeatureFlagHoldBack string
2825
}
2926

3027
// HasHandler returns true if this resource has a handler function.

pkg/inventory/server_tool.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,6 @@ type ServerTool struct {
6464
// to be omitted. Used to disable tools when a feature flag is on.
6565
FeatureFlagDisable string
6666

67-
// FeatureFlagHoldBack specifies a feature flag that, when enabled, overrides
68-
// FeatureFlagDisable and keeps the tool available. This allows users to "hold back"
69-
// on a deprecation by opting to keep the old tools during a transition period.
70-
// Used during tool consolidation to give users time to migrate.
71-
FeatureFlagHoldBack string
72-
7367
// Enabled is an optional function called at build/filter time to determine
7468
// if this tool should be available. If nil, the tool is considered enabled
7569
// (subject to FeatureFlagEnable/FeatureFlagDisable checks).

0 commit comments

Comments
 (0)