You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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: test1desc: "A test item"
- name: test2desc: "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: test1desc: "A test item"
- name: test2desc: "Another test item"
Update the root pom.xml to remove the dependencyManagement section and add the following to the dependencies section:
ewilkins-csi
changed the title
BUG: Delta Spark YAML migration fails for some YAML files
BUG: Delta Spark migrations fail for some YAML/POM files
Oct 28, 2024
ewilkins-csi
changed the title
BUG: Delta Spark migrations fail for some YAML/POM files
BUG: Delta Spark migrations fail for some YAML & POM files
Oct 28, 2024
Also fixes a bug with the `hasDouble`, `hasInt`, and `hasBoolean`
methods of `YamlObject`. Adds tests for `YamlUtils` including one to
catch the root list issue. Finally, also updates the POM migration to
account for POMs without dependcy management sections.
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.xmlThe text was updated successfully, but these errors were encountered: