Skip to content

Added merging prerelease sdk and addons with regular one#363

Open
michalwedzik wants to merge 5 commits into
adobe:mainfrom
michalwedzik:SKYOPS-80559-merging-prerelease
Open

Added merging prerelease sdk and addons with regular one#363
michalwedzik wants to merge 5 commits into
adobe:mainfrom
michalwedzik:SKYOPS-80559-merging-prerelease

Conversation

@michalwedzik

@michalwedzik michalwedzik commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

In this PR, I added support for merging prerelease SDKs and add-ons with their regular counterparts.

Description

For now, this functionality is available only through AemAggregator when the following fields are provided:

prereleaseSdkId
prereleaseAddOnIds

If these fields are left empty, the behavior remains unchanged. When they are set, the features from the prerelease SDK and/or add-ons are merged with the corresponding regular SDK and add-ons.

Related Issue

#362

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.

return feature;
}

private boolean isEffectivelyEmpty(final Feature feature) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure what is expected for the empty feature.

@rombert rombert self-requested a review June 9, 2026 14:42

@rombert rombert left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think checking for 'empty' features is not the right heuristic. I suggest that you take a look at some of the add-on SDK APIs published on Maven Central and either test directly against them or add simplifed copies to git. AFAICT there are two main scenarios:

In both scenarios feature aggregation should work and we probably need to either define a merge handler or conflict policies. If you did not try out the two cases outlined above please do and let's see how this plays out.

@michalwedzik michalwedzik force-pushed the SKYOPS-80559-merging-prerelease branch from 91d8c9e to 272e8bc Compare June 30, 2026 08:41
@michalwedzik michalwedzik force-pushed the SKYOPS-80559-merging-prerelease branch from ea1e563 to 3767e12 Compare July 2, 2026 14:08
@michalwedzik

Copy link
Copy Markdown
Contributor Author

I implemented it the way we discussed. I added ApiRegionsMergeHandler to handle merging apiRegions, and AssemblyBasedFeatureConflictResolver.java to choose the correct version when conflicts occur.

I think I've covered all the scenarios.

@michalwedzik michalwedzik requested a review from rombert July 2, 2026 14:14

final JsonObject mergedRegion = firstObjectRegion(ApiRegionsMergeHandler.merge(stableJson, prereleaseJson));

assertEquals("prerelease.api", mergedRegion.getJsonArray("exports").getString(0));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this should assert that both exports are kept, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No, I adopted the strategy that whenever a specific key exists, I replace its value with the prerelease version.

I want to avoid writing a complex merging strategy for the content:

 "api-regions:JSON|false":[
    {
      "name":"global",
      "exports":[
        {
          "name":"ch.qos.logback.classic",
          "deprecated":{
            "msg":"This internal logback API is not supported by AEM as a Cloud Service.",
            "since":"2022-01-27",
            "for-removal":"2025-08-31"
          }
        }
      ]
    },
    {
      "name":"com.adobe.aem.deprecated",
      "exports":[
        {
          "name":"org.apache.abdera.ext.opensearch",
          "deprecated":{
            "msg":"Legacy AEM 6.x API.",
            "since":"2019-04-08",
            "for-removal":"2025-08-31"
          }
        }
      ]
    }
  ],

Otherwise, I'll have to implement a strategy for handling duplicates.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I afraid of to have structure like:

"api-regions:JSON|false":[
    {
      "name":"global",
      "exports":[
        {
          "name":"ch.qos.logback.classic",
          "deprecated":{
            "msg":"This internal logback API is not supported by AEM as a Cloud Service.",
            "since":"2022-01-27",
            "for-removal":"2025-08-31"
          }
        }, 
         {
          "name":"ch.qos.logback.classic",
          "deprecated":{
            "msg":",
            "since":"2022-01-28",
            "for-removal":"2025-08-31"
          }
      ]
    }
  
  ],

Comment thread src/test/java/com/adobe/aem/analyser/AemSdkProductFeatureGeneratorTest.java Outdated
Comment thread src/test/java/com/adobe/aem/analyser/AemSdkProductFeatureGeneratorTest.java Outdated
Comment thread src/main/java/com/adobe/aem/analyser/AemSdkProductFeatureGenerator.java Outdated
Comment thread src/main/java/com/adobe/aem/analyser/AemSdkProductFeatureGenerator.java Outdated
Comment thread src/main/java/com/adobe/aem/analyser/AemSdkProductFeatureGenerator.java Outdated
Comment thread src/main/java/com/adobe/aem/analyser/AssemblyBasedFeatureConflictResolver.java Outdated
Comment thread src/main/java/com/adobe/aem/analyser/AssemblyBasedFeatureConflictResolver.java Outdated
Comment thread src/main/java/com/adobe/aem/analyser/AssemblyBasedFeatureConflictResolver.java Outdated
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.

2 participants