Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

dev-v2.0.0 -> staging #84

Merged
merged 29 commits into from
Jan 12, 2023
Merged

dev-v2.0.0 -> staging #84

merged 29 commits into from
Jan 12, 2023

Conversation

emdobrin
Copy link
Contributor

Description

dev -> staging for 2.0.0-SNAPSHOT covering the integration with core 2.0.0

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

emdobrin and others added 29 commits June 7, 2022 19:02
Staging -> Main v1.1.0 Release
* Upgrade AGP, Gradle, language dependencies

- Upgrades
   - Gradle distribution 7.5
   - Gradle 7.3.1
   - Java 1.8
   - Kotlin 1.6.2
   - jacoco 0.8.8
- Expand .gitignore
- Restructure plugin declarations
- Fix functional test configuration (dex, androidx.test:core))

* Fix javadoc task

* Fix app namespace warning

* Address review comments

- remove *Version suffix for sdk options in gradle
- switch to gradle 7.3.0
- Use `required` instead of `enabled` for xml, csv, html reports
- Remove aar maven upload script

* Fix namespace warning and rename variable

* Enable multidex only for debug builds

Functional tests will fail without this flag as this module exceeds the DEX limit.
It is sufficient to enable this for debug as it is the type used for functional tests.
Consuming apps are responsible for making changes to their gradle to overcome
the DEX limit as necessary.

* Remove unneeded dependencies and variables
* Core 2.0 adoption

 - .gradle changes
    - Add jitpack to repositories
    - Consume Core 2.0 via com.github.adobe.aepsdk-core-android:core:v2.0.0-SNAPSHOT
      from jitpack
    - Prevent transitive dependencies from other extensions
    - Change moduleVersion, mavenCoreVersion to 2.0.0.

 - Change IdentityConstants.EXTENSION_VERSION to 2.0.0
 - Expose IdentityExtension.class via Idenity.EXTENSION
 - Switch to MobileCore.dispatchEventWithResponseCallback(event, timeout, callbackWithError)
   and ExtensionApi.dispatch(event)

 - Switch to using new shared state api
   - Remove multiple instance creation of SharedStateCallback.
   - Streamline shared state calls via SharedStateCallback within and
      outside the Identity extension

 - Implement IdentityExtension.onRegistered()
   - Change event listener registration to be done in onRegistered() instead of the
     IdentityExtension's constructor
 - Remove Listener*.java classes in favor of inline methods
   - Remove the inhouse executor service and mutex as the events are now incident
     via a single thread maintained by the extension container housing this extension.

 - Implement IdentityExtension.readyForEvent()
   - Add logic to wait for EventHub state and IdentityDirect registration check
     if ECID from persisted properties is unavailable.
   - Remove the logic to cache events internally. Take advantage of the Hub
     shared state fetching to boot up and disambiguate between Identity direct and
     EdgeIdentity.

 - Switch to use public utility classes and methods from Core where applicable
   - Use StringUtils.isEmpty()
   - Use JSONUtil.toMap() and JSONUtil.toList()
   - Use DataReader.opt*() to read and parse event data. Remove class cast
     exception guards and resolve unchecked cast warnings where possible.

 - General changes done on code path toched
   - private and finals where applicable
   - Use cascading constructors to eliminate constructor divergence risk and
     ease test injection

Out of scope for this PR
 - Switching to Log from MobileCore.Log
 - Switching IdentityStorageService to NamedCollection
 - Test changes
 - PowerMock elimination

* Core 2.0 adoption

 - .gradle changes
    - Add jitpack to repositories
    - Consume Core 2.0 via com.github.adobe.aepsdk-core-android:core:v2.0.0-SNAPSHOT
      from jitpack
    - Prevent transitive dependencies from other extensions
    - Change moduleVersion, mavenCoreVersion to 2.0.0.

 - Change IdentityConstants.EXTENSION_VERSION to 2.0.0
 - Expose IdentityExtension.class via Idenity.EXTENSION
 - Switch to MobileCore.dispatchEventWithResponseCallback(event, timeout, callbackWithError)
   and ExtensionApi.dispatch(event)

 - Switch to using new shared state api
   - Remove multiple instance creation of SharedStateCallback.
   - Streamline shared state calls via SharedStateCallback within and
      outside the Identity extension

 - Implement IdentityExtension.onRegistered()
   - Change event listener registration to be done in onRegistered() instead of the
     IdentityExtension's constructor
 - Remove Listener*.java classes in favor of inline methods
   - Remove the inhouse executor service and mutex as the events are now incident
     via a single thread maintained by the extension container housing this extension.

 - Implement IdentityExtension.readyForEvent()
   - Add logic to wait for EventHub state and IdentityDirect registration check
     if ECID from persisted properties is unavailable.
   - Remove the logic to cache events internally. Take advantage of the Hub
     shared state fetching to boot up and disambiguate between Identity direct and
     EdgeIdentity.

 - Switch to use public utility classes and methods from Core where applicable
   - Use StringUtils.isEmpty()
   - Use JSONUtil.toMap() and JSONUtil.toList()
   - Use DataReader.opt*() to read and parse event data. Remove class cast
     exception guards and resolve unchecked cast warnings where possible.

 - General changes done on code path toched
   - private and finals where applicable
   - Use cascading constructors to eliminate constructor divergence risk and
     ease test injection

Out of scope for this PR
 - Switching to Log from MobileCore.Log
 - Switching IdentityStorageService to NamedCollection
 - Test changes
 - PowerMock elimination

* Address review comments

- Switch to using handlers for each event listener
- Use TimeUtils where applicable
- Eliminate two calls to get event hub shared state
- Add comments and TODOs for verification and logging

* Switch to SNAPSHOT core artifact

* Change callback timeout to 500ms to match API contract
- Make IdentityStorageService methods non-static and inject from constuctor
- Rename IdentityStorageService to IdentityStorageManager
Adopt Log service and DataStoreService changes from Core 2.0
Remove Powermock and fix unit and functional tests
* Set pending shared state before updating identity map

* Create pending state when resetIdentities is called.
* Annotations, unit tests++

* Update test app

* Update registerExtension test

* Update docs
@emdobrin emdobrin requested a review from prudrabhat January 12, 2023 23:03
@codecov
Copy link

codecov bot commented Jan 12, 2023

Codecov Report

Merging #84 (30c9650) into staging (92d38af) will increase coverage by 12.07%.
The diff coverage is 94.02%.

@@             Coverage Diff              @@
##           staging      #84       +/-   ##
============================================
+ Coverage    81.30%   93.37%   +12.07%     
============================================
  Files           20       12        -8     
  Lines         1032      679      -353     
  Branches       151      103       -48     
============================================
- Hits           839      634      -205     
+ Misses         137       16      -121     
+ Partials        56       29       -27     
Flag Coverage Δ
functional-tests 68.48% <60.16%> (+7.82%) ⬆️
unit-tests 93.08% <93.23%> (+13.92%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...adobe/marketing/mobile/edge/identity/URLUtils.java 80.95% <50.00%> (ø)
...e/marketing/mobile/edge/identity/IdentityItem.java 67.44% <71.43%> (+6.57%) ⬆️
...eting/mobile/edge/identity/IdentityProperties.java 89.33% <71.43%> (-0.54%) ⬇️
...adobe/marketing/mobile/edge/identity/Identity.java 91.89% <91.67%> (+19.58%) ⬆️
...be/marketing/mobile/edge/identity/IdentityMap.java 97.56% <92.86%> (+10.99%) ⬆️
.../marketing/mobile/edge/identity/IdentityState.java 95.83% <94.44%> (+6.51%) ⬆️
...keting/mobile/edge/identity/IdentityExtension.java 99.19% <98.67%> (+21.79%) ⬆️
...eting/mobile/edge/identity/AuthenticatedState.java 100.00% <100.00%> (ø)
...com/adobe/marketing/mobile/edge/identity/ECID.java 95.24% <100.00%> (ø)
...obe/marketing/mobile/edge/identity/EventUtils.java 93.75% <100.00%> (+20.31%) ⬆️
... and 10 more

Copy link
Contributor

@timkimadobe timkimadobe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@emdobrin emdobrin merged commit 8633367 into staging Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants