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

BUG: Resolve migration issues from Orphedomos to Fabric8 to reduce potential errors and manual workarounds for downstream projects #306

Closed
6 tasks done
carter-cundiff opened this issue Aug 29, 2024 · 3 comments · Fixed by #315 or #316
Assignees
Labels
bug Something isn't working
Milestone

Comments

@carter-cundiff
Copy link
Contributor

carter-cundiff commented Aug 29, 2024

Description

The current migration for Orphedomos to Fabric8 has a currently has few issues when utilized in downstream projects:

  • aiSSEMBLE 1.8.0 build-parent defines the configuration for the forked Docker Maven Plugin in org.technologybrewery.fabric8. When performing an upgrade, the migration updates a downstream project to use the Docker Maven Plugin from io.frabric8 instead.
  • When there is both a ci and integration-test profile defined in a POM file using Orphedomos, the migration will result with only the ci profile being migrated.

Steps to Reproduce

  • OTS Only:

    • Build the foundation upgrade module: mvn clean install -pl :foundation-upgrade -Dmaven.build.cache.skipCache=true
    • Build the following docker images: mvn clean install -pl :aissemble-policy-decision-point,:aissemble-vault,:aissemble-spark -am
  • Create a archetype project on version 1.7.0:

mvn archetype:generate -U -DarchetypeGroupId=com.boozallen.aissemble \
  -DarchetypeArtifactId=foundation-archetype \
  -DarchetypeVersion=1.7.0 \
  -DgroupId=com.test \
  -DartifactId=test-306 \
  -DprojectGitUrl=test.url \
  -DprojectName=test-306 \
  && cd test-306
  • Add the SparkPipeline.json file to the test-306-pipeline-models/src/main/resources/pipelines directory
  • Run mvn clean install until all the manual actions are complete
  • Once the manual actions are complete, run mvn clean install -Dmaven.build.cache.skipCache=true once to get any remaining manual actions
  • Add the following ci profile to the test-306-tests/test-306-tests-docker/pom.xml:
<profile>
    <id>ci</id>
    <build>
        <plugins>
            <plugin>
                <groupId>org.technologybrewery.orphedomos</groupId>
                <artifactId>orphedomos-maven-plugin</artifactId>
                <version>${version.orphedomos.plugin}</version>
                <configuration>
                    <skip>false</skip>
                    <imageVersion>latest</imageVersion>
                </configuration>
            </plugin>
        </plugins>
    </build>
</profile>
  • Within the root pom.xml:
    • Update the <docker.project.repository.url> property to be docker-registry/repository/
    • Update <parent> in the root pom.xml to use build parent version 1.8.1-SNAPSHOT
  • Run mvn org.technologybrewery.baton:baton-maven-plugin:baton-migrate to apply the migrations
  • Within the test-306-docker/pom.xml:
    • Within the ci profile, surround the <plugins> block with <pluginManagement></pluginManagement>
    • Within the <build><plugins> block, move the docker-maven-plugin <plugin> to the <pluginManagement><plugins> block
  • Within the test-306-docker/test-306-policy-decision-point-docker/pom.xml, test-306-docker/test-306-spark-worker-docker/pom.xml, and test-306-docker/test-306-vault-docker/pom.xml add the following to the <build><plugins> block:
<plugin>
    <groupId>${group.fabric8.plugin}</groupId>
    <artifactId>docker-maven-plugin</artifactId>
</plugin>
  • Build the project with mvn clean install

Expected Behavior

The project builds successfully and all references to orphedomos-maven-plugin are updated to docker-maven-plugin

  • A search for orphedomos-maven-plugin in the project should return 0 results

Actual Behavior

  • The project fails to build with the following error (condensed) due to the new docker-maven-plugin utilizing io.fabric8 for its groupId instead of org.technologybrewery.fabric8:
    [ERROR] The build could not read 4 projects -> [Help 1]
    [ERROR]
    [ERROR]   The project com.boozallen.aissemble:your-project-spark-worker-docker:0.1.0-SNAPSHOT (your-project-spark-worker-docker/pom.xml) has 1 error
    [ERROR]     Unknown packaging: docker-build @ line 13, column 16
    
  • The project fails to update both references to orphedomos-maven-plugin in the *-tests-docker/pom.xml

DOD

  • The docker-maven-plugin should use a property for the groupId allowing for it to be easily switched between the official repo (io.fabric8) and forked repo (org.technologybrewery.fabric8) :
    • Property should be defined in the build parent
    • All references throughout aiSSEMBLE (including templates) should be updated to use the property instead
    • Update the current migration to utilize the property in downstream projects
  • Current migration should be made more generalized so that it can account for multiple references to orphedomos-maven-plugin in a given pom.xml regardless of their profile
    • Utilize pom modification tool for making all the changes as once

Test Outline

  • Follow steps to reproduce and verify you get the expected result
  • Build the project with mvn clean install -Pci and verify it builds successfully
@carter-cundiff carter-cundiff added the bug Something isn't working label Aug 29, 2024
@carter-cundiff carter-cundiff self-assigned this Aug 29, 2024
@carter-cundiff carter-cundiff added this to the 1.8.1 milestone Aug 29, 2024
@carter-cundiff
Copy link
Contributor Author

DOD with @ewilkins-csi, @nartieri, @csun-cpointe

@carter-cundiff
Copy link
Contributor Author

OTS with @csun-cpointe

@csun-cpointe
Copy link
Contributor

test passed ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants