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 generation and dev mode, build file modified integration test fix #1409

Merged
merged 9 commits into from
Feb 7, 2022

Conversation

kathrynkodama
Copy link
Contributor

@kathrynkodama kathrynkodama commented Jan 31, 2022

Fixes #1375
Enabled generateFeatures for MultiModuleUpdatePomsTest.

General dev mode improvements:
On build file change, dependency equals check was always indicating that dependencies had changed even when the two lists were the same. Added the dependencyListEquals(...) and dependencyEquals(...) methods to compare dependencies. Dependencies are considered "equal" if they have the same groupId, artifactId, version, type and scope.

When checking if compilation dependencies have changed, include dependencies with scope "provided" as they are also used to build the project and should be considered compile dependencies. See https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#dependency-scope

Feature generation flow:
If a build file is modified and compilation dependencies have changed, call generateFeatures if:
EDIT: updated to only call incrementGenerateFeatures if there are class files to generate for

multi module project: (1) main module's compile dependencies were modified and source directory exists OR (2) module's compile dependencies were modified and there are dependent modules
single module project: source directory exists

@kathrynkodama
Copy link
Contributor Author

MultiModuleUpdatePomsTest is passing locally but failing through GitHub actions, investigating.

@kathrynkodama
Copy link
Contributor Author

kathrynkodama commented Feb 2, 2022

MultiModuleUpdatePomsTest is passing locally but failing through GitHub actions, investigating.

Test failures seem to be due to timing issues on dev mode startup, and when files are compiled. Generate features should be skipped for the initial compile that occurs once we enter the dev mode inner loop.

Initial compile:

[INFO] guide-maven-multimodules-jar source compilation was successful.
[INFO] guide-maven-multimodules-jar tests compilation was successful.
[INFO] guide-maven-multimodules-war source compilation was successful.
[INFO] guide-maven-multimodules-war tests compilation was successful.
[INFO] guide-maven-multimodules-ear tests compilation was successful.

Then, on my local machine:

[DEBUG] Processing file changes for /private/var/folders/gr/3p093xzj0f9fj9psx80z_zw00000gn/T/temp4730549617925461330/jar/target/classes/io/openliberty/guides/multimodules/lib/Converter.class, change type MODIFY
[DEBUG] Processing file changes for /private/var/folders/gr/3p093xzj0f9fj9psx80z_zw00000gn/T/temp4730549617925461330/war/target/classes/io/openliberty/guides/multimodules/web/HeightsBean.class, change type MODIFY
[DEBUG] Detected a change in the following classes: [/private/var/folders/gr/3p093xzj0f9fj9psx80z_zw00000gn/T/temp4730549617925461330/war/target/classes/io/openliberty/guides/multimodules/web/HeightsBean.class, /private/var/folders/gr/3p093xzj0f9fj9psx80z_zw00000gn/T/temp4730549617925461330/jar/target/classes/io/openliberty/guides/multimodules/lib/Converter.class]
[DEBUG] Skipping generate features from first call after dev mode startup
  1. Converter.class file modified
  2. HeightsBean.class file modified
  3. Detected change in (1) and (2)
  4. Skipping generate features from first call after dev mode startup

However on machines through GH actions the timing is slightly off where it detects the class file changes one after another rather than in the same loop:

2022-02-02T14:45:47.8662777Z [INFO] [DEBUG] Processing file changes for /tmp/temp5321838797061560511/jar/target/classes/io/openliberty/guides/multimodules/lib/Converter.class, change type MODIFY
2022-02-02T14:45:47.8671347Z [INFO] [DEBUG] Detected a change in the following classes: [/tmp/temp5321838797061560511/jar/target/classes/io/openliberty/guides/multimodules/lib/Converter.class]
2022-02-02T14:45:47.8677854Z [INFO] [DEBUG] Skipping generate features from first call after dev mode startup
2022-02-02T14:45:47.8679209Z [INFO] [DEBUG] Processing file changes for /tmp/temp5321838797061560511/war/target/classes/io/openliberty/guides/multimodules/web/HeightsBean.class, change type MODIFY
2022-02-02T14:45:47.8758631Z [INFO] [DEBUG] Detected a change in the following classes: [/tmp/temp5321838797061560511/war/target/classes/io/openliberty/guides/multimodules/web/HeightsBean.class]
2022-02-02T14:45:47.8759178Z [INFO] [INFO] Generating feature list from incremental changes...
  1. Converter.class file modified
  2. Skipping generate features from first call after dev mode startup
  3. HeightsBean.class file modified
  4. Generating feature list from incremental changes....

Signed-off-by: Kathryn Kodama <kathryn.s.kodama@gmail.com>
Signed-off-by: Kathryn Kodama <kathryn.s.kodama@gmail.com>
…iggered from build file change

Signed-off-by: Kathryn Kodama <kathryn.s.kodama@gmail.com>
Signed-off-by: Kathryn Kodama <kathryn.s.kodama@gmail.com>
…asses

Signed-off-by: Kathryn Kodama <kathryn.s.kodama@gmail.com>
Signed-off-by: Kathryn Kodama <kathryn.s.kodama@gmail.com>
…ling dev mode IT

Signed-off-by: Kathryn Kodama <kathryn.s.kodama@gmail.com>
…file for generate features

Signed-off-by: Kathryn Kodama <kathryn.s.kodama@gmail.com>
Signed-off-by: Kathryn Kodama <kathryn.s.kodama@gmail.com>
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.

Generate features and dev mode, modifying pom.xml in multi module project errors
3 participants