Skip to content

Commit

Permalink
Merge branch 'trunk' into issue/13852-PushNotificationBackgroundSynch…
Browse files Browse the repository at this point in the history
…ronizer-tweaks
  • Loading branch information
bozidarsevo committed Sep 12, 2024
2 parents fdca1f3 + fa7950d commit 137a2a0
Show file tree
Hide file tree
Showing 56 changed files with 8,610 additions and 5,151 deletions.
66 changes: 36 additions & 30 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
---

agents:
queue: "mac"
queue: mac

env:
IMAGE_ID: $IMAGE_ID
Expand All @@ -13,94 +13,100 @@ steps:
# Build the app
#################
- label: ":pipeline: Build"
key: "build"
command: ".buildkite/commands/build-for-testing.sh"
key: build
command: .buildkite/commands/build-for-testing.sh
plugins: [$CI_TOOLKIT]
notify:
- github_commit_status:
context: "Build"
context: Build

#################
# Create Prototype Build
#################
- label: "🛠 Prototype Build"
command: ".buildkite/commands/prototype-build.sh"
- label: ":hammer_and_wrench: Prototype Build"
command: .buildkite/commands/prototype-build.sh
plugins: [$CI_TOOLKIT]
if: build.pull_request.id != null
notify:
- github_commit_status:
context: "Prototype Build"
context: Prototype Build

#################
# Run Unit Tests
#################
- label: "🔬 Unit Tests"
command: ".buildkite/commands/run-unit-tests.sh"
depends_on: "build"
- label: ":microscope: Unit Tests"
command: .buildkite/commands/run-unit-tests.sh
depends_on: build
plugins: [$CI_TOOLKIT]
artifact_paths:
- "fastlane/test_output/*"
- fastlane/test_output/*
notify:
- github_commit_status:
context: "Unit Tests"
context: Unit Tests

#################
# Linters
#################
- group: Linters
steps:
- label: "☢️ Danger - PR Check"
- label: ":radioactive_sign: Danger - PR Check"
command: danger
key: danger
if: "build.pull_request.id != null"
if: build.pull_request.id != null
retry:
manual:
permit_on_passed: true
agents:
queue: "linter"
queue: linter
notify:
- github_commit_status:
context: Danger - PR Check

- label: ":swift: SwiftLint"
command: swiftlint
notify:
- github_commit_status:
context: "SwiftLint"
context: SwiftLint
agents:
queue: "linter"
queue: linter

- label: "🧹 Lint Translations"
command: "gplint /workdir/WooCommerce/Resources/AppStoreStrings.pot"
- label: 🧹 Lint Translations
command: gplint /workdir/WooCommerce/Resources/AppStoreStrings.pot
plugins:
- docker#v3.8.0:
image: "public.ecr.aws/automattic/glotpress-validator:1.0.0"
image: public.ecr.aws/automattic/glotpress-validator:1.0.0
agents:
queue: "default"
queue: default
notify:
- github_commit_status:
context: "Lint Translations"
context: Lint Translations

- label: ":sleuth_or_spy: Lint Localized Strings Format"
command: .buildkite/commands/lint-localized-strings-format.sh
plugins: [$CI_TOOLKIT]
notify:
- github_commit_status:
context: Lint Localized Strings Format

#################
# UI Tests
#################
- label: "🔬 UI Tests (iPhone)"
- label: ":microscope: UI Tests (iPhone)"
command: .buildkite/commands/run-ui-tests.sh UITests 'iPhone 15'
depends_on: "build"
depends_on: build
plugins: [$CI_TOOLKIT]
artifact_paths:
- "fastlane/test_output/*"
- fastlane/test_output/*
notify:
- github_commit_status:
context: "UI Tests (iPhone)"
context: UI Tests (iPhone)

- label: "🔬 UI Tests (iPad)"
- label: ":microscope: UI Tests (iPad)"
command: .buildkite/commands/run-ui-tests.sh UITests "iPad (10th generation)"
depends_on: "build"
depends_on: build
plugins: [$CI_TOOLKIT]
artifact_paths:
- "fastlane/test_output/*"
- fastlane/test_output/*
notify:
- github_commit_status:
context: "UI Tests (iPad)"
context: UI Tests (iPad)
8 changes: 4 additions & 4 deletions .buildkite/release-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
# This pipeline is meant to be run via the Buildkite API, and is only used for release builds

agents:
queue: "mac"
queue: mac

env:
IMAGE_ID: $IMAGE_ID

steps:
- label: "🛠 Release Build (App Store Connect)"
command: ".buildkite/commands/release-build.sh ${BUILDKITE_BETA_RELEASE}"
- label: ":hammer_and_wrench: Release Build (App Store Connect)"
command: .buildkite/commands/release-build.sh ${BUILDKITE_BETA_RELEASE}
priority: 1
plugins: [$CI_TOOLKIT]
notify:
- slack: "#build-and-ship"
- slack: "#build-and-ship"
retry:
manual:
# If those jobs fail, one should always prefer re-triggering a new build from ReleaseV2 rather than retrying the individual job from Buildkite
Expand Down
4 changes: 2 additions & 2 deletions .buildkite/release-pipelines/complete-code-freeze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
---

agents:
queue: "mac"
queue: mac

env:
IMAGE_ID: $IMAGE_ID

steps:
- label: "Complete Code Freeze"
- label: Complete Code Freeze
plugins: [$CI_TOOLKIT]
command: |
.buildkite/commands/configure-environment.sh
Expand Down
4 changes: 2 additions & 2 deletions .buildkite/release-pipelines/finalize-hotfix-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
---

agents:
queue: "mac"
queue: mac

env:
IMAGE_ID: $IMAGE_ID

steps:
- label: "Finalize Hotfix Release"
- label: Finalize Hotfix Release
plugins: [$CI_TOOLKIT]
command: |
.buildkite/commands/configure-environment.sh
Expand Down
4 changes: 2 additions & 2 deletions .buildkite/release-pipelines/finalize-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
---

agents:
queue: "mac"
queue: mac

env:
IMAGE_ID: $IMAGE_ID

steps:
- label: "Finalize Release"
- label: Finalize Release
plugins: [$CI_TOOLKIT]
command: |
.buildkite/commands/configure-environment.sh
Expand Down
4 changes: 2 additions & 2 deletions .buildkite/release-pipelines/new-beta-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
---

agents:
queue: "mac"
queue: mac

env:
IMAGE_ID: $IMAGE_ID

steps:
- label: "New Beta Release"
- label: New Beta Release
plugins: [$CI_TOOLKIT]
command: |
.buildkite/commands/configure-environment.sh
Expand Down
4 changes: 2 additions & 2 deletions .buildkite/release-pipelines/new-hotfix-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
---

agents:
queue: "mac"
queue: mac

env:
IMAGE_ID: $IMAGE_ID

steps:
- label: "New Hotfix Release"
- label: New Hotfix Release
plugins: [$CI_TOOLKIT]
command: |
.buildkite/commands/configure-environment.sh
Expand Down
4 changes: 2 additions & 2 deletions .buildkite/release-pipelines/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
---

agents:
queue: "mac"
queue: mac

env:
IMAGE_ID: $IMAGE_ID

steps:
- label: "Publish Release"
- label: Publish Release
plugins: [$CI_TOOLKIT]
command: |
.buildkite/commands/configure-environment.sh
Expand Down
4 changes: 2 additions & 2 deletions .buildkite/release-pipelines/start-code-freeze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
---

agents:
queue: "mac"
queue: mac

env:
IMAGE_ID: $IMAGE_ID

steps:
- label: "Start Code Freeze"
- label: Start Code Freeze
plugins: [$CI_TOOLKIT]
command: |
.buildkite/commands/configure-environment.sh
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
---

agents:
queue: "mac"
queue: mac

env:
IMAGE_ID: $IMAGE_ID

steps:
- label: "Update Metadata on App Store Connect"
- label: Update Metadata on App Store Connect
plugins: [$CI_TOOLKIT]
command: |
.buildkite/commands/configure-environment.sh
Expand Down
2 changes: 1 addition & 1 deletion Experiments/Experiments/DefaultFeatureFlagService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public struct DefaultFeatureFlagService: FeatureFlagService {
case .revampedShippingLabelCreation:
return buildConfig == .localDeveloper || buildConfig == .alpha
case .blazeCampaignObjective:
return buildConfig == .localDeveloper || buildConfig == .alpha
return true
default:
return true
}
Expand Down
3 changes: 2 additions & 1 deletion Fakes/Fakes/Networking.generated.swift
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,8 @@ extension Networking.CreateBlazeCampaign {
mainImage: .fake(),
targeting: .fake(),
targetUrn: .fake(),
type: .fake()
type: .fake(),
objective: .fake()
)
}
}
Expand Down
8 changes: 7 additions & 1 deletion Networking/Networking/Model/Blaze/CreateBlazeCampaign.swift
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ public struct CreateBlazeCampaign: Encodable, GeneratedFakeable, GeneratedCopiab
///
public let type: String

/// Selected objective ID for the campaign.
///
public let objective: String?

public init(origin: String,
originVersion: String,
paymentMethodID: String,
Expand All @@ -106,7 +110,8 @@ public struct CreateBlazeCampaign: Encodable, GeneratedFakeable, GeneratedCopiab
mainImage: Image,
targeting: BlazeTargetOptions?,
targetUrn: String,
type: String) {
type: String,
objective: String?) {
self.origin = origin
self.originVersion = originVersion
self.paymentMethodID = paymentMethodID
Expand All @@ -123,5 +128,6 @@ public struct CreateBlazeCampaign: Encodable, GeneratedFakeable, GeneratedCopiab
self.targeting = targeting
self.targetUrn = targetUrn
self.type = type
self.objective = objective
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,8 @@ extension Networking.CreateBlazeCampaign {
mainImage: CopiableProp<CreateBlazeCampaign.Image> = .copy,
targeting: NullableCopiableProp<BlazeTargetOptions> = .copy,
targetUrn: CopiableProp<String> = .copy,
type: CopiableProp<String> = .copy
type: CopiableProp<String> = .copy,
objective: NullableCopiableProp<String> = .copy
) -> Networking.CreateBlazeCampaign {
let origin = origin ?? self.origin
let originVersion = originVersion ?? self.originVersion
Expand All @@ -596,6 +597,7 @@ extension Networking.CreateBlazeCampaign {
let targeting = targeting ?? self.targeting
let targetUrn = targetUrn ?? self.targetUrn
let type = type ?? self.type
let objective = objective ?? self.objective

return Networking.CreateBlazeCampaign(
origin: origin,
Expand All @@ -613,7 +615,8 @@ extension Networking.CreateBlazeCampaign {
mainImage: mainImage,
targeting: targeting,
targetUrn: targetUrn,
type: type
type: type,
objective: objective
)
}
}
Expand Down
1 change: 1 addition & 0 deletions Networking/Networking/Model/MetaContainer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ extension MetaContainer {
case comment
case home
case order
case campaignID = "campaign_id"
case post
case reply = "reply_comment"
case site
Expand Down
11 changes: 11 additions & 0 deletions Networking/Networking/Model/Note.swift
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,18 @@ extension Note {
case post
case storeOrder = "store_order"
case user

/// Blaze
case blazePerformedNote = "blaze_performed_note"
case blazeCancelledNote = "blaze_cancelled_note"
case blazeRejectedNote = "blaze_rejected_note"
case blazeApprovedNote = "blaze_approved_note"

case unknown

public var isBlaze: Bool {
self == .blazePerformedNote || self == .blazeCancelledNote || self == .blazeRejectedNote || self == .blazeApprovedNote
}
}

/// Known Notification Subkind(s)
Expand Down
Loading

0 comments on commit 137a2a0

Please sign in to comment.