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

Feature: POMs should be automatically migrated to account for Fabric8 throwing errors for non-Docker modules #320

Closed
5 tasks done
ewilkins-csi opened this issue Sep 9, 2024 · 5 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@ewilkins-csi
Copy link
Contributor

ewilkins-csi commented Sep 9, 2024

Description

Orphedomos was written to simply skip plugin execution if the packaging type of the POM was not orphedomos. This allowed for configuring the plugin in the parent module of the Docker builds (i.e. in <project>-docker/pom.xml). Fabric8 will throw an error in this instance. To properly migrate downstream projects upgrading to 1.8, we need to account for this difference by ensuring any docker plugin configuration in non-docker modules is confined to a pluginManagement section, and ensure that all docker-build modules have the docker plugin directly added to their build.

DOD

  • Migrated POMs with pom packaging have any Fabric8 docker plugin specification moved to an appropriate pluginManagement section
    • this includes within profiles, where the plugin configuration should be moved to a management section within the same profile
  • Migrated POMs with docker-build packaging have at least a bare bones Docker plugin config add to the main build/plugins section
  • These migrations run after other Orphedomos-to-Fabric8 migrations
  • Archetype and MDA templates should be updated to contain these fixes by default
  • Archetype/MDA changes should be merged to dev

Test Strategy/Script

Test Upgrade to 1.8.1

  1. Create a new project from the 1.7 archetype
    mvn archetype:generate -B '-DarchetypeGroupId=com.boozallen.aissemble' \
                              '-DarchetypeArtifactId=foundation-archetype' \
                              '-DarchetypeVersion=1.7.0' \
                              '-DgroupId=org.test' \
                              '-Dpackage=org.test' \
                              '-DprojectGitUrl=test.org/test.git' \
                              '-DprojectName=Test Project' \
                              '-DartifactId=ots-320-upgrade' \
                              '-DdockerProjectRepositoryUrl=test-registry/' \
    && cd ots-320-upgrade
  2. Add SparkPipeline.json to ots-320-upgrade-pipeline-models/src/main/resources/pipelines
  3. Run the build and resolve manual actions until none are printed: mvn clean install
  4. Change the build-parent version in the root pom.xml to 1.8.1-SNAPSHOT
  5. Run the build and verify it is successful: mvn clean install
  6. Run the build with the CI profile and verify it is successful
    mvn clean install -Pci -pl :ots-320-upgrade-docker -amd
  7. Verify each docker module executes the docker:build goal during the build
  8. In ots-320-upgrade-docker/pom.xml update the docker-maven-plugin within the first pluginManagement block by changing skip from true to false
  9. Run the build: mvn clean install
  10. Verify that the docker modules produced images
    docker images | grep ots-320

Test 1.9

  1. Create a new project from the 1.9 snapshot archetype
    mvn archetype:generate -B '-DarchetypeGroupId=com.boozallen.aissemble' \
                              '-DarchetypeArtifactId=foundation-archetype' \
                              '-DarchetypeVersion=1.9.0-SNAPSHOT' \
                              '-DgroupId=org.test' \
                              '-Dpackage=org.test' \
                              '-DprojectGitUrl=test.org/test.git' \
                              '-DprojectName=Test Project' \
                              '-DartifactId=ots-320' \
                              '-DdockerProjectRepositoryUrl=test-registry/' \
    && cd ots-320
  2. Add SparkPipeline.json to ots-320-pipeline-models/src/main/resources/pipelines
  3. Run the build and resolve manual actions until none are printed: mvn clean install
  4. Run the docker builds with the CI profile and verify it is successful
    mvn clean install -Pci -pl :ots-320-docker -amd
  5. Verify each docker module executes the docker:build goal during the build
  6. In ots-320-docker/pom.xml update the docker-maven-plugin within the first pluginManagement block by changing skip from true to false
  7. Run the build: mvn clean install
  8. Verify that the docker modules produced images (note the image from the upgrade test will likely still be present – ensure the images without -upgrade are also present)
    docker images | grep ots-320
@ewilkins-csi ewilkins-csi added the enhancement New feature or request label Sep 9, 2024
@ewilkins-csi ewilkins-csi added this to the 1.8.1 milestone Sep 9, 2024
@ewilkins-csi ewilkins-csi self-assigned this Sep 9, 2024
@ewilkins-csi
Copy link
Contributor Author

DoD with @csun-cpointe

@ewilkins-csi
Copy link
Contributor Author

Migration and template/archetype changes done! (Thanks @csun-cpointe!) Just need to ensure anything worth keeping from the migrations are picked over to branch off of dev and run through OTS.

@csun-cpointe
Copy link
Contributor

OTS looks good ✅

ewilkins-csi pushed a commit that referenced this issue Sep 11, 2024
ewilkins-csi added a commit that referenced this issue Sep 11, 2024
[#320] fix docker plugin config to account for change from orphedomos
ewilkins-csi pushed a commit that referenced this issue Sep 12, 2024
@ewilkins-csi
Copy link
Contributor Author

Changes merged into 1.8.1 branch with successful build.

csun-cpointe added a commit that referenced this issue Sep 12, 2024
…mda-templates

[#320] fix fabric8 archetype and mda templates
@csun-cpointe
Copy link
Contributor

Final test passed!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants