Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merge to Staging for 5.0.1 release #460

Merged
merged 7 commits into from
Apr 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions .github/workflows/upstream-integration-test.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Action to execute upstream integration tests - Edge Network (Konductor)
name: Integration Tests

# Controls when the action will run. Workflow runs when manually triggered using the UI
# or API.
on:
# `*` is a special character in YAML so you have to quote this string
# Avoiding start of hour and other common times to avoid conflicts with peak times
Expand Down Expand Up @@ -46,15 +44,10 @@ on:

run-name: ${{ inputs.id }}

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
test-integration-upstream:
# The type of runner that the job will run on
runs-on: macos-latest

# Steps represent a sequence of tasks that will be executed as part of the job
runs-on: macos-13
steps:

- name: Job run identifier ${{ github.event.inputs.id }}
id: job-run-identifier
run: |
Expand All @@ -70,6 +63,10 @@ jobs:
with:
ref: ${{ github.event.inputs.branch }}

- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.0.1'

- name: Cache Cocoapods
id: cache-cocoapods
uses: actions/cache@v3
Expand All @@ -79,7 +76,6 @@ jobs:
restore-keys: |
${{ runner.os }}-pods-

# Runs a single command using the runners shell
- name: Execute Edge Network integration tests
id: execute-integration-tests
run: make test-integration-upstream EDGE_ENVIRONMENT=${{ github.event.inputs.environment }} EDGE_LOCATION_HINT=${{ github.event.inputs.edge-location-hint }}
Expand Down Expand Up @@ -115,7 +111,6 @@ jobs:

echo "EXIT_CODE=$EXIT_CODE" >> $GITHUB_OUTPUT

#
- name: "{\"exitCode\":${{ steps.on-failure.outputs.EXIT_CODE || 0 }}}"
id: failure-data
if: ${{ failure() }}
Expand Down
2 changes: 1 addition & 1 deletion AEPEdge.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "AEPEdge"
s.version = "5.0.0"
s.version = "5.0.1"
s.summary = "Experience Platform Edge extension for Adobe Experience Platform Mobile SDK. Written and maintained by Adobe."

s.description = <<-DESC
Expand Down
12 changes: 10 additions & 2 deletions AEPEdge.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@
BF947F9E244182B30057A6CC /* StoreResponsePayloadManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF947F9424414E3E0057A6CC /* StoreResponsePayloadManagerTests.swift */; };
BF947FA0244569190057A6CC /* EdgeRequestTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF947F9F244569190057A6CC /* EdgeRequestTests.swift */; };
BF947FA4244613FB0057A6CC /* RequestMetadataTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF947FA3244613FB0057A6CC /* RequestMetadataTests.swift */; };
BFDF25AB2BD02E58002114B6 /* EdgeQueuedEntityFunctionalTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFDF25AA2BD02E58002114B6 /* EdgeQueuedEntityFunctionalTests.swift */; };
BFDF25AD2BDB077E002114B6 /* SharedStateReader.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFDF25AC2BDB077E002114B6 /* SharedStateReader.swift */; };
BFEEB5AB28D4E35D00B668B8 /* EdgePublicAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D45F2E8125EE1987000AC350 /* EdgePublicAPITests.swift */; };
D4000F35245A53FB0052C536 /* EdgeNetworkServiceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4000F34245A53FB0052C536 /* EdgeNetworkServiceTests.swift */; };
D4145F4025D1D3200019EA4C /* EdgeHitTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4145F3F25D1D3200019EA4C /* EdgeHitTests.swift */; };
Expand Down Expand Up @@ -279,6 +281,8 @@
BF947F9424414E3E0057A6CC /* StoreResponsePayloadManagerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StoreResponsePayloadManagerTests.swift; sourceTree = "<group>"; };
BF947F9F244569190057A6CC /* EdgeRequestTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EdgeRequestTests.swift; sourceTree = "<group>"; };
BF947FA3244613FB0057A6CC /* RequestMetadataTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RequestMetadataTests.swift; sourceTree = "<group>"; };
BFDF25AA2BD02E58002114B6 /* EdgeQueuedEntityFunctionalTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EdgeQueuedEntityFunctionalTests.swift; sourceTree = "<group>"; };
BFDF25AC2BDB077E002114B6 /* SharedStateReader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SharedStateReader.swift; sourceTree = "<group>"; };
C6F54D018682F0FF8E74A16F /* Pods-UnitTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-UnitTests.debug.xcconfig"; path = "Target Support Files/Pods-UnitTests/Pods-UnitTests.debug.xcconfig"; sourceTree = "<group>"; };
C71524CA05BF6E5102E01187 /* Pods-E2EFunctionalTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-E2EFunctionalTests.debug.xcconfig"; path = "Target Support Files/Pods-E2EFunctionalTests/Pods-E2EFunctionalTests.debug.xcconfig"; sourceTree = "<group>"; };
C9510E11CC3DB2C62D9D17C0 /* Pods-UpstreamIntegrationTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-UpstreamIntegrationTests.release.xcconfig"; path = "Target Support Files/Pods-UpstreamIntegrationTests/Pods-UpstreamIntegrationTests.release.xcconfig"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -500,6 +504,7 @@
BF947F8E2440F0940057A6CC /* StateMetadata.swift */,
BF947F85243F24570057A6CC /* StoreResponsePayload.swift */,
BF947F92244126D70057A6CC /* StoreResponsePayloadManager.swift */,
BFDF25AC2BDB077E002114B6 /* SharedStateReader.swift */,
);
path = EdgeNetworkHandlers;
sourceTree = "<group>";
Expand Down Expand Up @@ -617,6 +622,7 @@
4CBEE6222A1577E40084BC50 /* NoConfigFunctionalTests.swift */,
4CBEE6242A157CB40084BC50 /* SampleFunctionalTests.swift */,
D4D5B53724325AB700CAB6E4 /* Info.plist */,
BFDF25AA2BD02E58002114B6 /* EdgeQueuedEntityFunctionalTests.swift */,
);
name = FunctionalTests;
path = Tests/FunctionalTests;
Expand Down Expand Up @@ -1264,6 +1270,7 @@
buildActionMask = 2147483647;
files = (
D4EC0DBB25E73FF10026EBAA /* EdgeState.swift in Sources */,
BFDF25AD2BDB077E002114B6 /* SharedStateReader.swift in Sources */,
BF0F924F27476E6C00378913 /* ImplementationDetails.swift in Sources */,
D4C6B437251A76CB0038F4F9 /* XDMProtocols.swift in Sources */,
D4C6B438251A76CB0038F4F9 /* Edge+PublicAPI.swift in Sources */,
Expand Down Expand Up @@ -1351,6 +1358,7 @@
4CBEE61B2A1572E50084BC50 /* Edge+PublicAPITests.swift in Sources */,
4CBEE6192A1571DC0084BC50 /* Edge+ConsentTests.swift in Sources */,
D48CBD2224A17EEA00A24BD8 /* TestXDMSchema.swift in Sources */,
BFDF25AB2BD02E58002114B6 /* EdgeQueuedEntityFunctionalTests.swift in Sources */,
4CBEE6252A157CB40084BC50 /* SampleFunctionalTests.swift in Sources */,
2ECFB7522AB391F400653128 /* EdgeDatastreamConfigOverrideTests.swift in Sources */,
4CBEE61D2A1574CE0084BC50 /* EdgePathOverwriteTests.swift in Sources */,
Expand Down Expand Up @@ -1546,7 +1554,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 5.0.0;
MARKETING_VERSION = 5.0.1;
OTHER_LDFLAGS = "$(inherited)";
PRODUCT_BUNDLE_IDENTIFIER = com.adobe.aep.edge;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
Expand Down Expand Up @@ -1582,7 +1590,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 5.0.0;
MARKETING_VERSION = 5.0.1;
OTHER_LDFLAGS = "$(inherited)";
PRODUCT_BUNDLE_IDENTIFIER = com.adobe.aep.edge;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
Expand Down
2 changes: 1 addition & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ end

def edge_pods
pod 'AEPEdgeIdentity'
pod 'AEPEdgeConsent', :git => 'https://github.com/adobe/aepsdk-edgeconsent-ios.git', :branch => 'staging'
pod 'AEPEdgeConsent'
pod 'AEPEdge', :path => './AEPEdge.podspec'
end

Expand Down
19 changes: 7 additions & 12 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PODS:
- AEPAssurance (4.1.1):
- AEPCore (>= 4.0.0)
- AEPServices (>= 4.0.0)
- AEPAssurance (5.0.0):
- AEPCore (< 6.0.0, >= 5.0.0)
- AEPServices (< 6.0.0, >= 5.0.0)
- AEPCore (5.0.0):
- AEPRulesEngine (< 6.0.0, >= 5.0.0)
- AEPServices (< 6.0.0, >= 5.0.0)
Expand All @@ -24,7 +24,7 @@ DEPENDENCIES:
- AEPAssurance
- AEPCore
- AEPEdge (from `./AEPEdge.podspec`)
- AEPEdgeConsent (from `https://github.com/adobe/aepsdk-edgeconsent-ios.git`, branch `staging`)
- AEPEdgeConsent
- AEPEdgeIdentity
- AEPTestUtils (from `https://github.com/adobe/aepsdk-testutils-ios.git`, tag `5.0.0`)
- SwiftLint (= 0.52.0)
Expand All @@ -33,6 +33,7 @@ SPEC REPOS:
trunk:
- AEPAssurance
- AEPCore
- AEPEdgeConsent
- AEPEdgeIdentity
- AEPRulesEngine
- AEPServices
Expand All @@ -41,23 +42,17 @@ SPEC REPOS:
EXTERNAL SOURCES:
AEPEdge:
:path: "./AEPEdge.podspec"
AEPEdgeConsent:
:branch: staging
:git: https://github.com/adobe/aepsdk-edgeconsent-ios.git
AEPTestUtils:
:git: https://github.com/adobe/aepsdk-testutils-ios.git
:tag: 5.0.0

CHECKOUT OPTIONS:
AEPEdgeConsent:
:commit: e5897846c716e8cbdfa43c8ea68d95223c7bd0fe
:git: https://github.com/adobe/aepsdk-edgeconsent-ios.git
AEPTestUtils:
:git: https://github.com/adobe/aepsdk-testutils-ios.git
:tag: 5.0.0

SPEC CHECKSUMS:
AEPAssurance: 765587ef65481bab544aa25efcfa294e14161d49
AEPAssurance: 7f260ded4df38a70a06efebade8c33a3e3221984
AEPCore: f1c3e9238bb12e7e1103f4407c341ebc65aeab5b
AEPEdge: 6bc7c3f6573fdf0a12fb3ddfd32420112a89c80b
AEPEdgeConsent: d7db1d19eb4c1e2146360ed3c8df315f671b26d5
Expand All @@ -67,6 +62,6 @@ SPEC CHECKSUMS:
AEPTestUtils: 20495b368da57904ca2e9f241d1d8b114f9887b5
SwiftLint: 13280e21cdda6786ad908dc6e416afe5acd1fcb7

PODFILE CHECKSUM: d99001e08e7f2aa2fdc0a37b8004964ae6f37042
PODFILE CHECKSUM: 559b845c969523123ac98dd7a3e4559871b3c2aa

COCOAPODS: 1.14.3
58 changes: 24 additions & 34 deletions Sources/Edge.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class Edge: NSObject, Extension {
private let SELF_TAG = "Edge"
private var networkService: EdgeNetworkService = EdgeNetworkService()
private var networkResponseHandler: NetworkResponseHandler?
private let sharedStateReader: SharedStateReader
internal var state: EdgeState?

// MARK: - Extension
Expand All @@ -30,6 +31,8 @@ public class Edge: NSObject, Extension {

public required init(runtime: ExtensionRuntime) {
self.runtime = runtime
self.sharedStateReader = SharedStateReader(getSharedState: runtime.getSharedState(extensionName:event:barrier:))

super.init()

// set default on init for register/unregister use-case
Expand Down Expand Up @@ -96,12 +99,29 @@ public class Edge: NSObject, Extension {
/// - Parameter event: an event containing ExperienceEvent data for processing
func handleExperienceEventRequest(_ event: Event) {
guard !shouldIgnore(event: event) else { return }
processAndQueueEvent(event: event)
}

/// Handles the Consent Update event
/// - Parameter event: current event to process
func handleConsentUpdate(_ event: Event) {
processAndQueueEvent(event: event)
}

private func processAndQueueEvent(event: Event) {
guard let data = event.data, !data.isEmpty else {
Log.trace(label: EdgeConstants.LOG_TAG, "\(SELF_TAG) - Event with id \(event.id.uuidString) contained no data, ignoring.")
Log.trace(label: EdgeConstants.LOG_TAG, "\(SELF_TAG) - Event with id \(event.id.uuidString) contains no data, ignoring.")
return
}

// get Configuration shared state, this should be resolved based on readyForEvent check
let edgeConfig = sharedStateReader.getEdgeConfig(event: event)
guard let configId = edgeConfig[EdgeConstants.SharedState.Configuration.CONFIG_ID], !configId.isEmpty else {
Log.warning(label: EdgeConstants.LOG_TAG,
"\(SELF_TAG) - Unable to process the event '\(event.id.uuidString)', configuration 'edge.configId' is missing or empty.")
return // drop current event
}

// get IdentityMap from Identity shared state, this should be resolved based on readyForEvent check
guard let identityState =
getXDMSharedState(extensionName: EdgeConstants.SharedState.Identity.STATE_OWNER_NAME,
Expand All @@ -113,6 +133,7 @@ public class Edge: NSObject, Extension {
}

let edgeEntity = EdgeDataEntity(event: event,
configuration: AnyCodable.from(dictionary: edgeConfig) ?? [:],
identityMap: AnyCodable.from(dictionary: identityState) ?? [:])

guard let entityData = try? JSONEncoder().encode(edgeEntity) else {
Expand All @@ -139,7 +160,7 @@ public class Edge: NSObject, Extension {
/// Handles the generic identities reset event
/// - Parameter event: an `Event`
func handleIdentitiesReset(_ event: Event) {
let edgeEntity = EdgeDataEntity(event: event, identityMap: [:])
let edgeEntity = EdgeDataEntity(event: event, configuration: [:], identityMap: [:])

guard let entityData = try? JSONEncoder().encode(edgeEntity) else {
Log.debug(label: EdgeConstants.LOG_TAG, "\(SELF_TAG) - Failed to encode EdgeDataEntity for event with id: '\(event.id.uuidString)'.")
Expand All @@ -151,36 +172,6 @@ public class Edge: NSObject, Extension {
state?.hitQueue.queue(entity: entity)
}

/// Handles the Consent Update event
/// - Parameter event: current event to process
func handleConsentUpdate(_ event: Event) {
guard let data = event.data, !data.isEmpty else {
Log.trace(label: EdgeConstants.LOG_TAG, "\(SELF_TAG) - Consent update request event \(event.id.uuidString) contained no data, ignoring.")
return
}

// get IdentityMap from Identity shared state, this should be resolved based on readyForEvent check
guard let identityState =
getXDMSharedState(extensionName: EdgeConstants.SharedState.Identity.STATE_OWNER_NAME,
event: event)?.value else {
Log.warning(label: EdgeConstants.LOG_TAG,
"\(SELF_TAG) - Unable to process the event '\(event.id.uuidString)', " +
"Identity shared state is nil.")
return // drop current event
}

let edgeEntity = EdgeDataEntity(event: event,
identityMap: AnyCodable.from(dictionary: identityState) ?? [:])

guard let entityData = try? JSONEncoder().encode(edgeEntity) else {
Log.debug(label: EdgeConstants.LOG_TAG, "\(SELF_TAG) - Failed to encode EdgeDataEntity for event with id: '\(event.id.uuidString)'.")
return
}

let entity = DataEntity(uniqueIdentifier: event.id.uuidString, timestamp: event.timestamp, data: entityData)
state?.hitQueue.queue(entity: entity)
}

func handleRequestLocationHint(_ event: Event) {
var data: [String: Any] = [:]
if let hint = getLocationHint() {
Expand Down Expand Up @@ -248,8 +239,7 @@ public class Edge: NSObject, Extension {

let hitProcessor = EdgeHitProcessor(networkService: networkService,
networkResponseHandler: networkResponseHandler,
getSharedState: getSharedState(extensionName:event:),
getXDMSharedState: getXDMSharedState(extensionName:event:barrier:),
sharedStateReader: sharedStateReader,
readyForEvent: readyForEvent(_:),
getImplementationDetails: getImplementationDetails,
getLocationHint: getLocationHint)
Expand Down
2 changes: 1 addition & 1 deletion Sources/EdgeConstants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import Foundation
enum EdgeConstants {

static let EXTENSION_NAME = "com.adobe.edge"
static let EXTENSION_VERSION = "5.0.0"
static let EXTENSION_VERSION = "5.0.1"
static let FRIENDLY_NAME = "AEPEdge"
static let LOG_TAG = FRIENDLY_NAME

Expand Down
3 changes: 3 additions & 0 deletions Sources/EdgeNetworkHandlers/EdgeDataEntity.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ struct EdgeDataEntity: Codable {
/// The `Event` responsible for the hit
let event: Event

/// The current configuration shared state at the time `Event` was queued
let configuration: [String: AnyCodable]

/// The current identity shared state at the time `Event` was queued
let identityMap: [String: AnyCodable]
}
Loading