Skip to content

Commit

Permalink
Merge pull request #468 from adobe/staging
Browse files Browse the repository at this point in the history
  • Loading branch information
praveek authored May 23, 2023
2 parents 5a05488 + 2350da5 commit 8aa2950
Show file tree
Hide file tree
Showing 65 changed files with 3,102 additions and 2,202 deletions.
90 changes: 90 additions & 0 deletions .github/workflows/update-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# This is a basic workflow that is manually triggered

# IMPORTANT!
# For this repo which contains AEPCore, AEPIdentity, AEPLifecycle, AEPServices, and AEPSignal, it is assumed
# that when the version is updated for AEPCore, all other extensions (excluding AEPServices) will also
# have their minimum dependencies updated to the same new version.

name: Update Versions

# Controls when the action will run. Workflow runs when manually triggered using the UI
# or API.
on:
workflow_dispatch:
# Inputs the workflow accepts.
inputs:
core-version:
description: 'New version to use for Core. Example: 3.0.2'
required: false

identity-version:
description: 'New version to use for Identity. Example: 3.0.2'
required: false

lifecycle-version:
description: 'New version to use for Lifecycle. Example: 3.0.2'
required: false

signal-version:
description: 'New version to use for Signal. Example: 3.0.2'
required: false

branch:
description: 'Branch to be used when updating versions'
required: true

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
update-versions:
runs-on: macos-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:

- name: Checkout
uses: actions/[email protected]
with:
ref: ${{ github.event.inputs.branch }}

- if: ${{ github.event.inputs.core-version != '' }}
name: Update Core Version
run: (sh ./scripts/update-versions.sh -n Core -v ${{ github.event.inputs.core-version }})

- if: ${{ github.event.inputs.identity-version != '' }}
name: Update Identity Version
run: (sh ./scripts/update-versions.sh -n Identity -v ${{ github.event.inputs.identity-version }})

- if: ${{ github.event.inputs.lifecycle-version != '' }}
name: Update Lifecycle Version
run: (sh ./scripts/update-versions.sh -n Lifecycle -v ${{ github.event.inputs.lifecycle-version }})

- if: ${{ github.event.inputs.signal-version != '' }}
name: Update Signal Version
run: (sh ./scripts/update-versions.sh -n Signal -v ${{ github.event.inputs.signal-version }})

- name: Generate Commit Message
shell: bash
run: |
COMMIT_MSG=""
if [ "${{ github.event.inputs.core-version }}" ]; then
COMMIT_MSG="[Core-${{ github.event.inputs.core-version }}]"
fi
if [ "${{ github.event.inputs.identity-version }}" ]; then
COMMIT_MSG="$COMMIT_MSG [Identity-${{ github.event.inputs.identity-version }}]"
fi
if [ "${{ github.event.inputs.lifecycle-version }}" ]; then
COMMIT_MSG="$COMMIT_MSG [Lifecycle-${{ github.event.inputs.lifecycle-version }}]"
fi
if [ "${{ github.event.inputs.signal-version }}" ]; then
COMMIT_MSG="$COMMIT_MSG [Signal-${{ github.event.inputs.signal-version }}]"
fi
echo $COMMIT_MSG
echo COMMIT_MSG=$COMMIT_MSG >> $GITHUB_ENV
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
commit-message: Update versions ${{ env.COMMIT_MSG }}
title: Update versions ${{ env.COMMIT_MSG }}
body: Update versions ${{ env.COMMIT_MSG }}
base: ${{ github.event.inputs.branch }}
6 changes: 0 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,6 @@ identity-publish-maven-local:
identity-publish-maven-local-jitpack:
(./code/gradlew -p code/identity assemblePhone)
(./code/gradlew -p code/identity publishReleasePublicationToMavenLocal -Pjitpack -x signReleasePublication)

# make bump-versions from='2\.0\.0' to=2.0.1
bump-versions:
(LC_ALL=C find . -type f -name 'gradle.properties' -exec sed -i '' 's/$(from)/$(to)/' {} +)
(LC_ALL=C find . -type f -name '*.kt' -exec sed -i '' 's/$(from)/$(to)/' {} +)
(LC_ALL=C find . -type f -name '*.java' -exec sed -i '' 's/$(from)/$(to)/' {} +)

# SDK size
sdk-size:
Expand Down
20 changes: 17 additions & 3 deletions code/core/api/core.api
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public final class com/adobe/marketing/mobile/Event {
public fun getEventData ()Ljava/util/Map;
public fun getMask ()[Ljava/lang/String;
public fun getName ()Ljava/lang/String;
public fun getParentID ()Ljava/lang/String;
public fun getResponseID ()Ljava/lang/String;
public fun getSource ()Ljava/lang/String;
public fun getTimestamp ()J
Expand All @@ -35,6 +36,7 @@ public class com/adobe/marketing/mobile/Event$Builder {
public fun <init> (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
public fun <init> (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)V
public fun build ()Lcom/adobe/marketing/mobile/Event;
public fun chainToParentEvent (Lcom/adobe/marketing/mobile/Event;)Lcom/adobe/marketing/mobile/Event$Builder;
public fun inResponseToEvent (Lcom/adobe/marketing/mobile/Event;)Lcom/adobe/marketing/mobile/Event$Builder;
public fun setEventData (Ljava/util/Map;)Lcom/adobe/marketing/mobile/Event$Builder;
}
Expand All @@ -59,6 +61,7 @@ public final class com/adobe/marketing/mobile/EventSource {
public static final field APPLICATION_CLOSE Ljava/lang/String;
public static final field APPLICATION_LAUNCH Ljava/lang/String;
public static final field CONSENT_PREFERENCE Ljava/lang/String;
public static final field CREATE_TRACKER Ljava/lang/String;
public static final field ERROR_RESPONSE_CONTENT Ljava/lang/String;
public static final field NONE Ljava/lang/String;
public static final field OS Ljava/lang/String;
Expand All @@ -72,6 +75,7 @@ public final class com/adobe/marketing/mobile/EventSource {
public static final field RESPONSE_IDENTITY Ljava/lang/String;
public static final field RESPONSE_PROFILE Ljava/lang/String;
public static final field SHARED_STATE Ljava/lang/String;
public static final field TRACK_MEDIA Ljava/lang/String;
public static final field UPDATE_CONSENT Ljava/lang/String;
public static final field UPDATE_IDENTITY Ljava/lang/String;
public static final field WILDCARD Ljava/lang/String;
Expand All @@ -88,6 +92,7 @@ public final class com/adobe/marketing/mobile/EventType {
public static final field CUSTOM Ljava/lang/String;
public static final field EDGE Ljava/lang/String;
public static final field EDGE_IDENTITY Ljava/lang/String;
public static final field EDGE_MEDIA Ljava/lang/String;
public static final field GENERIC_DATA Ljava/lang/String;
public static final field GENERIC_IDENTITY Ljava/lang/String;
public static final field GENERIC_LIFECYCLE Ljava/lang/String;
Expand Down Expand Up @@ -337,8 +342,11 @@ public final class com/adobe/marketing/mobile/launch/rulesengine/LaunchRule : co

public class com/adobe/marketing/mobile/launch/rulesengine/LaunchRulesEngine {
public fun <init> (Lcom/adobe/marketing/mobile/ExtensionApi;)V
public fun <init> (Ljava/lang/String;Lcom/adobe/marketing/mobile/ExtensionApi;)V
public fun addRules (Ljava/util/List;)V
public fun evaluateEvent (Lcom/adobe/marketing/mobile/Event;)Ljava/util/List;
public fun process (Lcom/adobe/marketing/mobile/Event;)Ljava/util/List;
public fun processEvent (Lcom/adobe/marketing/mobile/Event;)Lcom/adobe/marketing/mobile/Event;
public fun replaceRules (Ljava/util/List;)V
}

Expand Down Expand Up @@ -872,6 +880,7 @@ public abstract interface class com/adobe/marketing/mobile/services/ui/Fullscree
}

public abstract interface class com/adobe/marketing/mobile/services/ui/FullscreenMessageDelegate {
public fun onBackPressed (Lcom/adobe/marketing/mobile/services/ui/FullscreenMessage;)V
public abstract fun onDismiss (Lcom/adobe/marketing/mobile/services/ui/FullscreenMessage;)V
public abstract fun onShow (Lcom/adobe/marketing/mobile/services/ui/FullscreenMessage;)V
public abstract fun onShowFailure ()V
Expand All @@ -882,21 +891,26 @@ public class com/adobe/marketing/mobile/services/ui/MessageCreationException : j
public fun <init> (Ljava/lang/String;)V
}

public class com/adobe/marketing/mobile/services/ui/MessageFragment : android/app/Fragment, android/view/View$OnTouchListener {
public class com/adobe/marketing/mobile/services/ui/MessageFragment : android/app/DialogFragment, android/view/View$OnTouchListener {
protected field dismissedWithGesture Z
protected field gestureDetector Landroid/view/GestureDetector;
protected field gestures Ljava/util/Map;
protected field message Lcom/adobe/marketing/mobile/services/ui/AEPMessage;
protected field webViewGestureListener Lcom/adobe/marketing/mobile/services/ui/WebViewGestureListener;
public fun <init> ()V
public fun dismiss ()V
public fun getAEPMessage ()Lcom/adobe/marketing/mobile/services/ui/AEPMessage;
public fun getGestureDetector ()Landroid/view/GestureDetector;
public fun getGestures ()Ljava/util/Map;
public fun getWebViewGestureListener ()Lcom/adobe/marketing/mobile/services/ui/WebViewGestureListener;
public fun isDismissedWithGesture ()Z
public fun onActivityCreated (Landroid/os/Bundle;)V
public fun onAttach (Landroid/content/Context;)V
public fun onCreate (Landroid/os/Bundle;)V
public fun onResume ()V
public fun onDestroyView ()V
public fun onDetach ()V
public fun onTouch (Landroid/view/View;Landroid/view/MotionEvent;)Z
public fun setAEPMessage (Lcom/adobe/marketing/mobile/services/ui/AEPMessage;)V
public fun show (Landroid/app/FragmentTransaction;Ljava/lang/String;)I
}

public class com/adobe/marketing/mobile/services/ui/MessageSettings {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ public void testEncodeDecode_When_AllTheFieldsAreNull() {

@Test
public void testEncodeDecode_When_AllTheFieldsAreValid() {
Event parentEvent =
new Event.Builder("ParentEvent", "responseType", "responseSource").build();

Map<String, Object> data =
new HashMap<String, Object>() {
{
Expand All @@ -66,6 +69,7 @@ public void testEncodeDecode_When_AllTheFieldsAreValid() {
.setEventData(data)
.setResponseId("response id")
.setUniqueIdentifier("uuid")
.chainToParentEvent(parentEvent)
.build();
Event decodedEvent = EventCoder.decode(EventCoder.encode(event));
verifyEventEquals(event, decodedEvent);
Expand Down Expand Up @@ -231,6 +235,7 @@ private void verifyEventEquals(final Event a, final Event b) {
assertEquals(a.getSource(), b.getSource());
assertEquals(a.getUniqueIdentifier(), b.getUniqueIdentifier());
assertEquals(a.getResponseID(), b.getResponseID());
assertEquals(a.getParentID(), b.getParentID());
assertEquals(a.getEventData(), b.getEventData());
assertTrue(Arrays.equals(a.getMask(), b.getMask()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ public void testInsertThenSelect_Happy() {
long startTimestamp = System.currentTimeMillis();

for (int i = 0; i < 10; i++) {
assertTrue(androidEventHistoryDatabase.insert(1234567890 + i));
assertTrue(
androidEventHistoryDatabase.insert(1234567890 + i, System.currentTimeMillis()));
}

long endTimestamp = System.currentTimeMillis();
Expand All @@ -92,11 +93,11 @@ public void testInsertThenDelete_Happy() {
long startTimestamp = System.currentTimeMillis();

for (int i = 0; i < 15; i++) {
assertTrue(androidEventHistoryDatabase.insert(1111111111));
assertTrue(androidEventHistoryDatabase.insert(1111111111, System.currentTimeMillis()));
}

for (int i = 0; i < 10; i++) {
assertTrue(androidEventHistoryDatabase.insert(222222222));
assertTrue(androidEventHistoryDatabase.insert(222222222, System.currentTimeMillis()));
}

String dbPath = context.getDatabasePath(DATABASE_NAME).getPath();
Expand Down Expand Up @@ -125,7 +126,7 @@ public void testInsert_ApplicationContextIsNull() throws EventHistoryDatabaseCre
mockAppContextService.appContext = null;
ServiceProviderModifier.setAppContextService(mockAppContextService);

new AndroidEventHistoryDatabase().insert(1111111111);
new AndroidEventHistoryDatabase().insert(1111111111, System.currentTimeMillis());
}

@Test
Expand All @@ -136,7 +137,7 @@ public void testInsert_DatabasesDirectoryAbsent() {

// create new event history database
AndroidEventHistoryDatabase eventHistoryDatabase = new AndroidEventHistoryDatabase();
assertTrue(eventHistoryDatabase.insert(222222222));
assertTrue(eventHistoryDatabase.insert(222222222, System.currentTimeMillis()));

final Cursor cursor2 =
eventHistoryDatabase.select(222222222, 0, System.currentTimeMillis());
Expand All @@ -157,7 +158,7 @@ public void testInsert_MigrationFromCacheDirectory() {

// create new event history database
AndroidEventHistoryDatabase eventHistoryDatabase = new AndroidEventHistoryDatabase();
assertTrue(eventHistoryDatabase.insert(222222222));
assertTrue(eventHistoryDatabase.insert(222222222, System.currentTimeMillis()));

// assert cache event history database content is copied to new event history database
String dbPath = context.getDatabasePath(DATABASE_NAME).getPath();
Expand Down Expand Up @@ -193,7 +194,7 @@ public void testInsert_MigrationFromCacheDirectory_DatabasesDirectoryAbsent() {

// create new event history database
AndroidEventHistoryDatabase eventHistoryDatabase = new AndroidEventHistoryDatabase();
assertTrue(eventHistoryDatabase.insert(222222222));
assertTrue(eventHistoryDatabase.insert(222222222, System.currentTimeMillis()));

// assert cache event history database content is copied to new event history database
String dbPath = context.getDatabasePath(DATABASE_NAME).getPath();
Expand Down Expand Up @@ -222,11 +223,11 @@ public void testInsert_MigrationFromCacheDirectory_DatabasesDirectoryAbsent() {
public void testInsert_DatabaseExists() {
try {
// insert into existing event history database
assertTrue(androidEventHistoryDatabase.insert(1111111111));
assertTrue(androidEventHistoryDatabase.insert(1111111111, System.currentTimeMillis()));

// create new event history database instance
AndroidEventHistoryDatabase eventHistoryDatabase = new AndroidEventHistoryDatabase();
assertTrue(eventHistoryDatabase.insert(222222222));
assertTrue(eventHistoryDatabase.insert(222222222, System.currentTimeMillis()));

// assert contents of event history database
String dbPath = context.getDatabasePath(DATABASE_NAME).getPath();
Expand Down
Loading

0 comments on commit 8aa2950

Please sign in to comment.