From 87faec573d24c5813142004a3da0536ad0f5aa62 Mon Sep 17 00:00:00 2001 From: "roux g. buciu" Date: Thu, 5 Mar 2026 11:26:31 -0500 Subject: [PATCH 1/2] rename qa to debuggable in nimbus add --- Sources/fxios/Commands/Nimbus/NimbusAdd.swift | 10 +++++----- .../Commands/Nimbus/NimbusFlaggableFeatureEditor.swift | 2 +- Sources/fxios/Commands/Nimbus/NimbusRemove.swift | 2 +- Tests/fxiosTests/NimbusTests.swift | 10 +++++----- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Sources/fxios/Commands/Nimbus/NimbusAdd.swift b/Sources/fxios/Commands/Nimbus/NimbusAdd.swift index 2a9dc49..bee1428 100644 --- a/Sources/fxios/Commands/Nimbus/NimbusAdd.swift +++ b/Sources/fxios/Commands/Nimbus/NimbusAdd.swift @@ -20,8 +20,8 @@ extension Nimbus { @Argument(help: "The feature name in camelCase (without 'Feature' suffix).") var featureName: String - @Flag(name: .long, help: "Add the feature to the QA settings UI.") - var qa = false + @Flag(name: .long, help: "Add the feature to the debuggable settings UI.") + var debuggable = false @Flag(name: .long, help: "Mark the feature as user-toggleable (requires implementing a preference key).") var userToggleable = false @@ -64,7 +64,7 @@ extension Nimbus { Herald.declare("Updating NimbusFlaggableFeature.swift...") try NimbusFlaggableFeatureEditor.addFeature( name: cleanName, - debug: qa, + debug: debuggable, userToggleable: userToggleable, filePath: flaggableFeaturePath ) @@ -74,8 +74,8 @@ extension Nimbus { Herald.declare("Updating NimbusFeatureFlagLayer.swift...") try NimbusFeatureFlagLayerEditor.addFeature(name: cleanName, filePath: flagLayerPath) - // 5. If --qa, update FeatureFlagsDebugViewController.swift - if qa { + // 5. If --debuggable, update FeatureFlagsDebugViewController.swift + if debuggable { let debugVCPath = repo.root.appendingPathComponent(NimbusConstants.featureFlagsDebugViewControllerPath) Herald.declare("Updating FeatureFlagsDebugViewController.swift...") try FeatureFlagsDebugViewControllerEditor.addFeature(name: cleanName, filePath: debugVCPath) diff --git a/Sources/fxios/Commands/Nimbus/NimbusFlaggableFeatureEditor.swift b/Sources/fxios/Commands/Nimbus/NimbusFlaggableFeatureEditor.swift index a3dc8d1..7ac9661 100644 --- a/Sources/fxios/Commands/Nimbus/NimbusFlaggableFeatureEditor.swift +++ b/Sources/fxios/Commands/Nimbus/NimbusFlaggableFeatureEditor.swift @@ -24,7 +24,7 @@ enum NimbusFlaggableFeatureEditor { // 1. Add enum case to NimbusFeatureFlagID content = try addEnumCase(name: name, to: content) - // 2. Add to debugKey if --qa + // 2. Add to debugKey if --debuggable if debug { content = try addToDebugKey(name: name, to: content) } diff --git a/Sources/fxios/Commands/Nimbus/NimbusRemove.swift b/Sources/fxios/Commands/Nimbus/NimbusRemove.swift index d0cc05c..2d368aa 100644 --- a/Sources/fxios/Commands/Nimbus/NimbusRemove.swift +++ b/Sources/fxios/Commands/Nimbus/NimbusRemove.swift @@ -109,7 +109,7 @@ extension Nimbus { ) if !result.wasPresent { - reportSkipped("Feature not in QA settings (not added with --qa)") + reportSkipped("Feature not in debuggable settings (not added with --debuggable)") } else if result.removed { reportSuccess("Removed debug setting") } else { diff --git a/Tests/fxiosTests/NimbusTests.swift b/Tests/fxiosTests/NimbusTests.swift index 7d2a31a..607bdad 100644 --- a/Tests/fxiosTests/NimbusTests.swift +++ b/Tests/fxiosTests/NimbusTests.swift @@ -496,8 +496,8 @@ struct NimbusTests { #expect(content.contains("nimbus.features.beta.value().enabled")) } - @Test("add command with --qa updates QA settings") - func addCommandWithQaUpdatesQaSettings() throws { + @Test("add command with --debuggable updates debuggable settings") + func addCommandWithDebuggableUpdatesdebuggableSettings() throws { let repoDir = try createValidRepo() defer { cleanup(repoDir) } try setupNimbusStructure(in: repoDir) @@ -507,7 +507,7 @@ struct NimbusTests { FileManager.default.changeCurrentDirectoryPath(repoDir.path) defer { FileManager.default.changeCurrentDirectoryPath(originalDir) } - var command = try Nimbus.Add.parse(["beta", "--qa"]) + var command = try Nimbus.Add.parse(["beta", "--debuggable"]) try command.run() // Check NimbusFlaggableFeature.swift for debugKey @@ -698,8 +698,8 @@ struct NimbusTests { FileManager.default.changeCurrentDirectoryPath(repoDir.path) defer { FileManager.default.changeCurrentDirectoryPath(originalDir) } - // First add a feature with --qa - var addCommand = try Nimbus.Add.parse(["beta", "--qa"]) + // First add a feature with --debuggable + var addCommand = try Nimbus.Add.parse(["beta", "--debuggable"]) try addCommand.run() // Verify it was added From d7567d288580fdde00723023426cf47afa4adb29 Mon Sep 17 00:00:00 2001 From: "roux g. buciu" Date: Wed, 15 Apr 2026 10:44:25 -0400 Subject: [PATCH 2/2] fix nimbus breaking changes --- Sources/fxios/Commands/Nimbus/Nimbus.swift | 2 +- Sources/fxios/Commands/Nimbus/NimbusAdd.swift | 2 +- .../Nimbus/NimbusFlaggableFeatureEditor.swift | 2 +- .../fxios/Commands/Nimbus/NimbusRemove.swift | 2 +- Tests/fxiosTests/NimbusTests.swift | 24 +++++++++---------- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Sources/fxios/Commands/Nimbus/Nimbus.swift b/Sources/fxios/Commands/Nimbus/Nimbus.swift index 39b1926..642d844 100644 --- a/Sources/fxios/Commands/Nimbus/Nimbus.swift +++ b/Sources/fxios/Commands/Nimbus/Nimbus.swift @@ -25,7 +25,7 @@ struct Nimbus: ParsableCommand { enum NimbusConstants { static let nimbusFmlPath = "firefox-ios/nimbus.fml.yaml" static let nimbusFeaturesPath = "firefox-ios/nimbus-features" - static let nimbusFlaggableFeaturePath = "firefox-ios/Client/FeatureFlags/NimbusFlaggableFeature.swift" + static let nimbusFlaggableFeaturePath = "firefox-ios/Client/FeatureFlags/FeatureFlagID.swift" static let nimbusFeatureFlagLayerPath = "firefox-ios/Client/Nimbus/NimbusFeatureFlagLayer.swift" // swiftlint:disable:next line_length static let featureFlagsDebugViewControllerPath = "firefox-ios/Client/Frontend/Settings/Main/Debug/FeatureFlags/FeatureFlagsDebugViewController.swift" diff --git a/Sources/fxios/Commands/Nimbus/NimbusAdd.swift b/Sources/fxios/Commands/Nimbus/NimbusAdd.swift index bee1428..7afcfc8 100644 --- a/Sources/fxios/Commands/Nimbus/NimbusAdd.swift +++ b/Sources/fxios/Commands/Nimbus/NimbusAdd.swift @@ -61,7 +61,7 @@ extension Nimbus { // 3. Update NimbusFlaggableFeature.swift let flaggableFeaturePath = repo.root.appendingPathComponent(NimbusConstants.nimbusFlaggableFeaturePath) - Herald.declare("Updating NimbusFlaggableFeature.swift...") + Herald.declare("Updating FeatureFlagID.swift...") try NimbusFlaggableFeatureEditor.addFeature( name: cleanName, debug: debuggable, diff --git a/Sources/fxios/Commands/Nimbus/NimbusFlaggableFeatureEditor.swift b/Sources/fxios/Commands/Nimbus/NimbusFlaggableFeatureEditor.swift index 7ac9661..807b971 100644 --- a/Sources/fxios/Commands/Nimbus/NimbusFlaggableFeatureEditor.swift +++ b/Sources/fxios/Commands/Nimbus/NimbusFlaggableFeatureEditor.swift @@ -103,7 +103,7 @@ enum NimbusFlaggableFeatureEditor { var lastCaseIndex: Int? for (index, line) in lines.enumerated() { - if line.contains("enum NimbusFeatureFlagID") { + if line.contains("enum FeatureFlagID") { inEnum = true continue } diff --git a/Sources/fxios/Commands/Nimbus/NimbusRemove.swift b/Sources/fxios/Commands/Nimbus/NimbusRemove.swift index 2d368aa..c3fa614 100644 --- a/Sources/fxios/Commands/Nimbus/NimbusRemove.swift +++ b/Sources/fxios/Commands/Nimbus/NimbusRemove.swift @@ -138,7 +138,7 @@ extension Nimbus { /// Removes the feature from NimbusFlaggableFeature.swift. Returns true if any failures occurred. private func removeFlaggableFeature(_ name: String, from path: URL) -> Bool { - Herald.declare("Updating NimbusFlaggableFeature.swift...") + Herald.declare("Updating FeatureFlagID.swift...") var hasFailures = false guard FileManager.default.fileExists(atPath: path.path) else { diff --git a/Tests/fxiosTests/NimbusTests.swift b/Tests/fxiosTests/NimbusTests.swift index 607bdad..aae7aef 100644 --- a/Tests/fxiosTests/NimbusTests.swift +++ b/Tests/fxiosTests/NimbusTests.swift @@ -44,9 +44,9 @@ struct NimbusTests { try FileManager.default.createDirectory(at: nimbusDir, withIntermediateDirectories: true) try FileManager.default.createDirectory(at: debugDir, withIntermediateDirectories: true) - // Create NimbusFlaggableFeature.swift + // Create FeatureFlagID.swift let flaggableFeatureContent = """ - enum NimbusFeatureFlagID: String, CaseIterable { + enum FeatureFlagID: String, CaseIterable { case alpha case zeta @@ -75,14 +75,14 @@ struct NimbusTests { } } """ - let flaggableFeaturePath = featureFlagsDir.appendingPathComponent("NimbusFlaggableFeature.swift") + let flaggableFeaturePath = featureFlagsDir.appendingPathComponent("FeatureFlagID.swift") try flaggableFeatureContent.write(to: flaggableFeaturePath, atomically: true, encoding: .utf8) // Create NimbusFeatureFlagLayer.swift let flagLayerContent = """ final class NimbusFeatureFlagLayer { public func checkNimbusConfigFor( - _ featureID: NimbusFeatureFlagID, + _ featureID: FeatureFlagID, from nimbus: FxNimbus = FxNimbus.shared ) -> Bool { switch featureID { @@ -448,7 +448,7 @@ struct NimbusTests { #expect(content.contains("nimbus-features/newFeature.yaml")) } - @Test("add command updates NimbusFlaggableFeature.swift") + @Test("add command updates FeatureFlagID.swift") func addCommandUpdatesFlaggableFeature() throws { let repoDir = try createValidRepo() defer { cleanup(repoDir) } @@ -462,7 +462,7 @@ struct NimbusTests { var command = try Nimbus.Add.parse(["beta"]) try command.run() - let filePath = repoDir.appendingPathComponent("firefox-ios/Client/FeatureFlags/NimbusFlaggableFeature.swift") + let filePath = repoDir.appendingPathComponent("firefox-ios/Client/FeatureFlags/FeatureFlagID.swift") let content = try String(contentsOf: filePath, encoding: .utf8) // Should have added the enum case @@ -510,8 +510,8 @@ struct NimbusTests { var command = try Nimbus.Add.parse(["beta", "--debuggable"]) try command.run() - // Check NimbusFlaggableFeature.swift for debugKey - let flaggablePath = repoDir.appendingPathComponent("firefox-ios/Client/FeatureFlags/NimbusFlaggableFeature.swift") + // Check FeatureFlagID.swift for debugKey + let flaggablePath = repoDir.appendingPathComponent("firefox-ios/Client/FeatureFlags/FeatureFlagID.swift") let flaggableContent = try String(contentsOf: flaggablePath, encoding: .utf8) #expect(flaggableContent.contains(".beta")) @@ -537,7 +537,7 @@ struct NimbusTests { var command = try Nimbus.Add.parse(["beta", "--user-toggleable"]) try command.run() - let filePath = repoDir.appendingPathComponent("firefox-ios/Client/FeatureFlags/NimbusFlaggableFeature.swift") + let filePath = repoDir.appendingPathComponent("firefox-ios/Client/FeatureFlags/FeatureFlagID.swift") let content = try String(contentsOf: filePath, encoding: .utf8) #expect(content.contains("case .beta:")) @@ -703,7 +703,7 @@ struct NimbusTests { try addCommand.run() // Verify it was added - let flaggablePath = repoDir.appendingPathComponent("firefox-ios/Client/FeatureFlags/NimbusFlaggableFeature.swift") + let flaggablePath = repoDir.appendingPathComponent("firefox-ios/Client/FeatureFlags/FeatureFlagID.swift") var content = try String(contentsOf: flaggablePath, encoding: .utf8) #expect(content.contains("case beta")) @@ -711,7 +711,7 @@ struct NimbusTests { var removeCommand = try Nimbus.Remove.parse(["beta"]) try removeCommand.run() - // Check NimbusFlaggableFeature.swift + // Check FeatureFlagID.swift content = try String(contentsOf: flaggablePath, encoding: .utf8) #expect(!content.contains("case beta")) @@ -746,7 +746,7 @@ struct NimbusTests { try command.run() // Verify the Swift files weren't modified (feature didn't exist) - let flaggablePath = repoDir.appendingPathComponent("firefox-ios/Client/FeatureFlags/NimbusFlaggableFeature.swift") + let flaggablePath = repoDir.appendingPathComponent("firefox-ios/Client/FeatureFlags/FeatureFlagID.swift") let flaggableContent = try String(contentsOf: flaggablePath, encoding: .utf8) #expect(!flaggableContent.contains("nonexistent")) }