diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 4c49c220c..d44b81aa1 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -8,4 +8,4 @@ * @bitwarden/dept-development-mobile # DevOps for Actions and other workflow changes -.github/workflows @bitwarden/dept-devops +# .github/workflows @bitwarden/dept-devops diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..e85b7bb1c --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,36 @@ +--- +name: Build + +on: + workflow_dispatch: + inputs: + build-variant: + description: 'Which variant of the app to build' + required: true + type: choice + options: + - Production + build-version: + description: 'Optional. Version string to use, in X.Y.Z format. Overrides default in the project.' + required: false + type: string + build-number: + description: 'Optional. Build number to use. Overrides default of GitHub run number.' + required: false + type: number + +env: + build-variant: ${{ inputs.build-variant || 'Production' }} + +jobs: + build: + name: Build iOS app + runs-on: macos-13 + env: + MINT_PATH: .mint/lib + MINT_LINK_PATH: .mint/bin + steps: + - name: Print Environment + run: | + echo "GitHub ref: $GITHUB_REF" + echo "GitHub event: $GITHUB_EVENT" diff --git a/.github/workflows/enforce-labels.yml b/.github/workflows/enforce-labels.yml new file mode 100644 index 000000000..3b0cf4967 --- /dev/null +++ b/.github/workflows/enforce-labels.yml @@ -0,0 +1,17 @@ +--- +name: Enforce PR labels + +on: + workflow_call: + pull_request: + types: [labeled, unlabeled, opened, edited, synchronize] +jobs: + enforce-label: + name: Enforce Label + runs-on: ubuntu-22.04 + steps: + - name: Enforce Label + uses: yogevbd/enforce-label-action@a3c219da6b8fa73f6ba62b68ff09c469b3a1c024 # 2.2.2 + with: + BANNED_LABELS: "hold,needs-qa" + BANNED_LABELS_DESCRIPTION: "PRs with the hold or needs-qa labels cannot be merged" diff --git a/.github/workflows/workflow-linter.yml b/.github/workflows/workflow-linter.yml new file mode 100644 index 000000000..fc1db4d39 --- /dev/null +++ b/.github/workflows/workflow-linter.yml @@ -0,0 +1,11 @@ +--- +name: Workflow Linter + +on: + pull_request: + paths: + - .github/workflows/** + +jobs: + call-workflow: + uses: bitwarden/gh-actions/.github/workflows/workflow-linter.yml@main diff --git a/AuthenticatorShared/Core/Platform/Services/Stores/AppSettingsStore.swift b/AuthenticatorShared/Core/Platform/Services/Stores/AppSettingsStore.swift index 3c89a78a7..14653e133 100644 --- a/AuthenticatorShared/Core/Platform/Services/Stores/AppSettingsStore.swift +++ b/AuthenticatorShared/Core/Platform/Services/Stores/AppSettingsStore.swift @@ -234,6 +234,11 @@ extension DefaultAppSettingsStore: AppSettingsStore { set { store(newValue, for: .hasSeenWelcomeTutorial) } } + var migrationVersion: Int { + get { fetch(for: .migrationVersion) } + set { store(newValue, for: .migrationVersion) } + } + func clearClipboardValue(userId: String) -> ClearClipboardValue { if let rawValue: Int = fetch(for: .clearClipboardValue(userId: userId)), let value = ClearClipboardValue(rawValue: rawValue) { @@ -243,12 +248,7 @@ extension DefaultAppSettingsStore: AppSettingsStore { } func secretKey(userId: String) -> String? { - return fetch(for: .secretKey(userId: userId)) - } - - var migrationVersion: Int { - get { fetch(for: .migrationVersion) } - set { store(newValue, for: .migrationVersion) } + fetch(for: .secretKey(userId: userId)) } func setClearClipboardValue(_ clearClipboardValue: ClearClipboardValue?, userId: String) { diff --git a/AuthenticatorShared/Core/Vault/Repositories/AuthenticatorItemRepositoryTests.swift b/AuthenticatorShared/Core/Vault/Repositories/AuthenticatorItemRepositoryTests.swift index 7b27a1549..bc962d34d 100644 --- a/AuthenticatorShared/Core/Vault/Repositories/AuthenticatorItemRepositoryTests.swift +++ b/AuthenticatorShared/Core/Vault/Repositories/AuthenticatorItemRepositoryTests.swift @@ -54,6 +54,4 @@ class AuthenticatorItemRepositoryTests: AuthenticatorTestCase { try await subject.addAuthenticatorItem(.fixture()) } } - - // TODO: Backfill tests } diff --git a/AuthenticatorShared/Core/Vault/Services/AuthenticatorItemService.swift b/AuthenticatorShared/Core/Vault/Services/AuthenticatorItemService.swift index 11c220f72..bd2958404 100644 --- a/AuthenticatorShared/Core/Vault/Services/AuthenticatorItemService.swift +++ b/AuthenticatorShared/Core/Vault/Services/AuthenticatorItemService.swift @@ -56,7 +56,6 @@ protocol AuthenticatorItemService { class DefaultAuthenticatorItemService { // MARK: Properties - // TODO: Generate this user ID and store it in the keychain? private let defaultUserId = "local" /// The data store for persisted items diff --git a/AuthenticatorShared/UI/Platform/Settings/Settings/About/__Snapshots__/AboutViewTests/test_snapshot_default.1.png b/AuthenticatorShared/UI/Platform/Settings/Settings/About/__Snapshots__/AboutViewTests/test_snapshot_default.1.png index e808e5ac2..f48bb0077 100644 Binary files a/AuthenticatorShared/UI/Platform/Settings/Settings/About/__Snapshots__/AboutViewTests/test_snapshot_default.1.png and b/AuthenticatorShared/UI/Platform/Settings/Settings/About/__Snapshots__/AboutViewTests/test_snapshot_default.1.png differ diff --git a/AuthenticatorShared/UI/Platform/Settings/Settings/About/__Snapshots__/AboutViewTests/test_snapshot_default.2.png b/AuthenticatorShared/UI/Platform/Settings/Settings/About/__Snapshots__/AboutViewTests/test_snapshot_default.2.png index 0a08bdda6..a14a45d96 100644 Binary files a/AuthenticatorShared/UI/Platform/Settings/Settings/About/__Snapshots__/AboutViewTests/test_snapshot_default.2.png and b/AuthenticatorShared/UI/Platform/Settings/Settings/About/__Snapshots__/AboutViewTests/test_snapshot_default.2.png differ diff --git a/AuthenticatorShared/UI/Platform/Settings/Settings/About/__Snapshots__/AboutViewTests/test_snapshot_default.3.png b/AuthenticatorShared/UI/Platform/Settings/Settings/About/__Snapshots__/AboutViewTests/test_snapshot_default.3.png index cceec609f..7be65613d 100644 Binary files a/AuthenticatorShared/UI/Platform/Settings/Settings/About/__Snapshots__/AboutViewTests/test_snapshot_default.3.png and b/AuthenticatorShared/UI/Platform/Settings/Settings/About/__Snapshots__/AboutViewTests/test_snapshot_default.3.png differ diff --git a/AuthenticatorShared/UI/Platform/Settings/Settings/Appearance/SelectLanguage/__Snapshots__/SelectLanguageViewTests/test_snapshot_default.1.png b/AuthenticatorShared/UI/Platform/Settings/Settings/Appearance/SelectLanguage/__Snapshots__/SelectLanguageViewTests/test_snapshot_default.1.png index b50904869..968513161 100644 Binary files a/AuthenticatorShared/UI/Platform/Settings/Settings/Appearance/SelectLanguage/__Snapshots__/SelectLanguageViewTests/test_snapshot_default.1.png and b/AuthenticatorShared/UI/Platform/Settings/Settings/Appearance/SelectLanguage/__Snapshots__/SelectLanguageViewTests/test_snapshot_default.1.png differ diff --git a/AuthenticatorShared/UI/Platform/Settings/Settings/Appearance/SelectLanguage/__Snapshots__/SelectLanguageViewTests/test_snapshot_default_dark.1.png b/AuthenticatorShared/UI/Platform/Settings/Settings/Appearance/SelectLanguage/__Snapshots__/SelectLanguageViewTests/test_snapshot_default_dark.1.png index ccbd007dc..b2545d4fb 100644 Binary files a/AuthenticatorShared/UI/Platform/Settings/Settings/Appearance/SelectLanguage/__Snapshots__/SelectLanguageViewTests/test_snapshot_default_dark.1.png and b/AuthenticatorShared/UI/Platform/Settings/Settings/Appearance/SelectLanguage/__Snapshots__/SelectLanguageViewTests/test_snapshot_default_dark.1.png differ diff --git a/AuthenticatorShared/UI/Platform/Settings/Settings/Appearance/SelectLanguage/__Snapshots__/SelectLanguageViewTests/test_snapshot_default_large.1.png b/AuthenticatorShared/UI/Platform/Settings/Settings/Appearance/SelectLanguage/__Snapshots__/SelectLanguageViewTests/test_snapshot_default_large.1.png index fc8e8fd55..db3f14f0e 100644 Binary files a/AuthenticatorShared/UI/Platform/Settings/Settings/Appearance/SelectLanguage/__Snapshots__/SelectLanguageViewTests/test_snapshot_default_large.1.png and b/AuthenticatorShared/UI/Platform/Settings/Settings/Appearance/SelectLanguage/__Snapshots__/SelectLanguageViewTests/test_snapshot_default_large.1.png differ diff --git a/AuthenticatorShared/UI/Platform/Settings/Settings/Appearance/__Snapshots__/AppearanceViewTests/test_viewRender.1.png b/AuthenticatorShared/UI/Platform/Settings/Settings/Appearance/__Snapshots__/AppearanceViewTests/test_viewRender.1.png index 9d466f40a..22e4397bd 100644 Binary files a/AuthenticatorShared/UI/Platform/Settings/Settings/Appearance/__Snapshots__/AppearanceViewTests/test_viewRender.1.png and b/AuthenticatorShared/UI/Platform/Settings/Settings/Appearance/__Snapshots__/AppearanceViewTests/test_viewRender.1.png differ diff --git a/AuthenticatorShared/UI/Platform/Settings/Settings/Appearance/__Snapshots__/AppearanceViewTests/test_viewRender.2.png b/AuthenticatorShared/UI/Platform/Settings/Settings/Appearance/__Snapshots__/AppearanceViewTests/test_viewRender.2.png index 3e348da3b..819fb6374 100644 Binary files a/AuthenticatorShared/UI/Platform/Settings/Settings/Appearance/__Snapshots__/AppearanceViewTests/test_viewRender.2.png and b/AuthenticatorShared/UI/Platform/Settings/Settings/Appearance/__Snapshots__/AppearanceViewTests/test_viewRender.2.png differ diff --git a/AuthenticatorShared/UI/Platform/Settings/Settings/__Snapshots__/SettingsViewTests/test_viewRender.1.png b/AuthenticatorShared/UI/Platform/Settings/Settings/__Snapshots__/SettingsViewTests/test_viewRender.1.png index 71afbe141..cec9b2ccb 100644 Binary files a/AuthenticatorShared/UI/Platform/Settings/Settings/__Snapshots__/SettingsViewTests/test_viewRender.1.png and b/AuthenticatorShared/UI/Platform/Settings/Settings/__Snapshots__/SettingsViewTests/test_viewRender.1.png differ diff --git a/AuthenticatorShared/UI/Vault/AuthenticatorItem/AuthenticatorItemCoordinator.swift b/AuthenticatorShared/UI/Vault/AuthenticatorItem/AuthenticatorItemCoordinator.swift index 77625a977..c707c833a 100644 --- a/AuthenticatorShared/UI/Vault/AuthenticatorItem/AuthenticatorItemCoordinator.swift +++ b/AuthenticatorShared/UI/Vault/AuthenticatorItem/AuthenticatorItemCoordinator.swift @@ -60,7 +60,10 @@ class AuthenticatorItemCoordinator: NSObject, Coordinator, HasStackNavigator { }) case let .editAuthenticatorItem(authenticatorItemView): Logger.application.log("Edit item \(authenticatorItemView.id)") - showEditAuthenticatorItem(for: authenticatorItemView, delegate: context as? AuthenticatorItemOperationDelegate) + showEditAuthenticatorItem( + for: authenticatorItemView, + delegate: context as? AuthenticatorItemOperationDelegate + ) } } diff --git a/AuthenticatorShared/UI/Vault/VaultItem/AuthenticatorKeyCapture/ManualEntryProcessorTests.swift b/AuthenticatorShared/UI/Vault/VaultItem/AuthenticatorKeyCapture/ManualEntryProcessorTests.swift index 27e669a2b..c4640dfb5 100644 --- a/AuthenticatorShared/UI/Vault/VaultItem/AuthenticatorKeyCapture/ManualEntryProcessorTests.swift +++ b/AuthenticatorShared/UI/Vault/VaultItem/AuthenticatorKeyCapture/ManualEntryProcessorTests.swift @@ -26,10 +26,12 @@ final class ManualEntryProcessorTests: AuthenticatorTestCase { } /// `receive()` with `.addPressed(:)` navigates to `.addManual(:)`. -// func test_receive_addPressed() async { -// subject.receive(.addPressed(code: "YouNeedUniqueNewYork", name: "NewYork")) -// XCTAssertEqual(coordinator.routes, [.addManual(key: "YouNeedUniqueNewYork", name: "NewYork")]) -// } + func test_receive_addPressed() async { + subject.state.authenticatorKey = "YouNeedUniqueNewYork" + subject.state.name = "NewYork" + subject.receive(.addPressed(code: "YouNeedUniqueNewYork", name: "NewYork")) + XCTAssertEqual(coordinator.routes, [.addManual(key: "YouNeedUniqueNewYork", name: "NewYork")]) + } /// `receive()` with `.authenticatorKeyChanged(:)` updates the state. func test_receive_authenticatorKeyChanged() async { diff --git a/Dangerfile b/Dangerfile index 167c46d12..67663fbe1 100644 --- a/Dangerfile +++ b/Dangerfile @@ -1,15 +1,12 @@ xcode_summary.ignored_files = '**/SourcePackages/*' -xcode_summary.report 'build/BitwardenTests.xcresult' +xcode_summary.report 'build/SuthenticatorTests.xcresult' slather.configure( - 'Bitwarden.xcodeproj', 'Bitwarden', + 'Authenticator.xcodeproj', 'Authenticator', options: { binary_basename: [ - 'Bitwarden', - #'BitwardenActionExtension', -- Can't add this until the target has some lines of code or slather throws an error. - 'BitwardenAutoFillExtension', - 'BitwardenShareExtension', - 'BitwardenShared', + 'Authenticator', + 'BitwardenAuthenticatorShared', 'Networking', ], build_directory: 'build/DerivedData',