[MOB-16479] Allow path overwrite for Media Edge requests#258
[MOB-16479] Allow path overwrite for Media Edge requests#258
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #258 +/- ##
==========================================
- Coverage 94.59% 92.54% -2.05%
==========================================
Files 27 27
Lines 998 1032 +34
==========================================
+ Hits 944 955 +11
- Misses 54 77 +23 |
|
Do you know why the coverage drops 2.5% with these changes? The report states that your changes are 100% covered by tests, however coverage is lost on lines this PR doesn't change. |
It has to do with the Xcode 13.0.0 update. We have noticed this in other repos as well that the coverage drops when we update to xcode 13.0.0 |
| } | ||
|
|
||
| /// Extracts all the Edge configuration keys from the Configuration shared state | ||
| /// Extracts all the Edge configuration keys needed for this request. Configuration keys are extracted from the Configuration shared state and the given `event` instance. |
There was a problem hiding this comment.
I recommend not mixing config keys with event keys in the same payload here to keep this function code specialized on a single item at a time. We could instead use a new helper getRequestProperties(event) that extract the request path overwrite and maybe additional request settings in the future.
There was a problem hiding this comment.
Additionally getEdgeConfig is used for all the endpoints we integrate with (currently interact and consent), we should allow the path overwrite only in the edge requestContent (interact) requests, and not for consent. Let's also include a test that overwrites are ignored for consent
There was a problem hiding this comment.
Should we revert this doc change?
There was a problem hiding this comment.
Don't forget to revert this doc change.
…t for similar requests in future. Added validation to drop paths with invalid cahracters.
…paths to have leading /
kevinlind
left a comment
There was a problem hiding this comment.
Can you check the coverage report and increase your diff coverage back to 100%? You may just need to add some negative tests to isValidPath.
…anged unitTest and functionTest schemes settings to build when run.
kevinlind
left a comment
There was a problem hiding this comment.
One additional small comment, otherwise looks good.
| } | ||
|
|
||
| /// Extracts all the Edge configuration keys from the Configuration shared state | ||
| /// Extracts all the Edge configuration keys needed for this request. Configuration keys are extracted from the Configuration shared state and the given `event` instance. |
There was a problem hiding this comment.
Should we revert this doc change?
| import XCTest | ||
|
|
||
| /// End-to-end testing for the AEPEdge public APIs | ||
| class AEPEdgePathOverwriteTests: FunctionalTestBase { |
There was a problem hiding this comment.
can you also add a test that it does not include the "request" portion in the request body?
There was a problem hiding this comment.
I see the request being sent as event payload.
There was a problem hiding this comment.
hmm.. that should not be the case, we should handle this and not include the client-side "request" portion in the request to Konductor
…payload. Added test for the same.
kevinlind
left a comment
There was a problem hiding this comment.
Looks good. One small clean up comment before you merge to revert a doc change after you refactored some code.
| } | ||
|
|
||
| /// Extracts all the Edge configuration keys from the Configuration shared state | ||
| /// Extracts all the Edge configuration keys needed for this request. Configuration keys are extracted from the Configuration shared state and the given `event` instance. |
There was a problem hiding this comment.
Don't forget to revert this doc change.
Description
Add support to override interact request path. This is primarily being added to support Media edge workflow, but is generic, so that any other extension can make use of it.
Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: