Booz Allen's lean manufacturing approach for holistically designing, developing and fielding AI solutions across the engineering lifecycle from data processing to model building, tuning, and training to secure operational deployment
Other
34
stars
8
forks
source link
BUG: Delta Spark migrations fail for some YAML & POM files #442
The migration to update YAML files with the new delta-spark dependencies as part of the Java 17 upgrade does not gracefully handle YAML files that do not have maps/objects as their root. (I.e. a YAML file which is a list.)
Steps to Reproduce
Create a new project from the 1.10.0-SNAPSHOT archetype
Add a yaml file that is a list, e.g.:
- name: test1
desc: "A test item"
- name: test2
desc: "Another test item"
Run the build: mvn clean install
Expected Behavior
The migration should simply skip the inapplicable YAML file and finish successfully.
Actual Behavior
The build fails at the root project.
Additional Context
Error:
Execution default of goal org.technologybrewery.baton:baton-maven-plugin:1.1.1:baton-migrate failed: Could not complete migrations!: class java.util.ArrayList cannot be cast to class java.util.Map (java.util.ArrayList and java.util.Map are in module java.base of loader 'bootstrap')
Stack trace:
Caused by: java.lang.ClassCastException: class java.util.ArrayList cannot be cast to class java.util.Map (java.util.ArrayList and java.util.Map are in module java.base of loader 'bootstrap')
at com.boozallen.aissemble.upgrade.util.YamlUtils.loadYaml (YamlUtils.java:46)
at com.boozallen.aissemble.upgrade.migration.v1_10_0.DeltaSparkYamlMigration.shouldExecuteOnFile (DeltaSparkYamlMigration.java:38)
at org.technologybrewery.baton.AbstractMigration.execute (AbstractMigration.java:73)
at org.technologybrewery.baton.BatonMojo.performMigration (BatonMojo.java:226)
at org.technologybrewery.baton.BatonMojo.execute (BatonMojo.java:180)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328)
Definition of Done
Following the steps to reproduce causes the expected behavior
The NPE caused by a missing dependenciesManagement section during the DeltaSparkPomMigration no longer occurs
Test Steps
Create a new project from the 1.10.0-SNAPSHOT archetype
Add a yaml file that is a list, e.g.:
- name: test1
desc: "A test item"
- name: test2
desc: "Another test item"
Update the root pom.xml to remove the dependencyManagement section and add the following to the dependencies section:
Description
The migration to update YAML files with the new
delta-spark
dependencies as part of the Java 17 upgrade does not gracefully handle YAML files that do not have maps/objects as their root. (I.e. a YAML file which is a list.)Steps to Reproduce
mvn clean install
Expected Behavior
The migration should simply skip the inapplicable YAML file and finish successfully.
Actual Behavior
The build fails at the root project.
Additional Context
Error:
Stack trace:
Definition of Done
dependenciesManagement
section during theDeltaSparkPomMigration
no longer occursTest Steps
dependencyManagement
section and add the following to thedependencies
section:mvn clean install
delta-core
dependency has been updated todelta-spark
in the root pom.xml