From 912ef3d5bd992fc709700b8697f7ed7e1a723ebf Mon Sep 17 00:00:00 2001 From: Christoph Pirkl Date: Mon, 3 Jun 2024 10:01:03 +0200 Subject: [PATCH 1/9] #578: Fix automatic dependency update --- .github/workflows/dependencies_update.yml | 14 +-- dependencies.md | 6 +- doc/changes/changelog.md | 1 + doc/changes/changes_4.3.2.md | 98 +++++++++++++++++++ maven-project-crawler/pk_generated_parent.pom | 8 +- parent-pom/pom.xml | 6 +- project-keeper-cli/pk_generated_parent.pom | 8 +- .../pk_generated_parent.pom | 8 +- project-keeper/pk_generated_parent.pom | 8 +- .../maven_templates/maven-enforcer-plugin.xml | 2 +- .../maven_templates/maven-javadoc-plugin.xml | 2 +- .../nexus-staging-maven-plugin.xml | 4 +- .../maven_templates/sonar-maven-plugin.xml | 2 +- .../.github/workflows/dependencies_update.yml | 19 +--- shared-model-classes/pk_generated_parent.pom | 8 +- shared-test-setup/pk_generated_parent.pom | 4 +- 16 files changed, 142 insertions(+), 56 deletions(-) create mode 100644 doc/changes/changes_4.3.2.md diff --git a/.github/workflows/dependencies_update.yml b/.github/workflows/dependencies_update.yml index 45bbe37d..8058875c 100644 --- a/.github/workflows/dependencies_update.yml +++ b/.github/workflows/dependencies_update.yml @@ -68,14 +68,6 @@ jobs: env: { CREATED_ISSUES: '${{ inputs.vulnerability_issues }}' } - - name: Project Keeper Fix - id: project-keeper-fix - run: | - mvn --batch-mode com.exasol:project-keeper-maven-plugin:fix --projects . - - name: Project Keeper Fix for updated Project Keeper version - id: project-keeper-fix-2 - run: | - mvn --batch-mode com.exasol:project-keeper-maven-plugin:fix --projects . - name: Generate Pull Request comment id: pr-comment run: | @@ -88,7 +80,11 @@ jobs: echo 'It updates dependencies.' >> "$GITHUB_OUTPUT" fi echo >> "$GITHUB_OUTPUT" - echo '# ⚠️ This PR does not trigger CI workflows by default ⚠️' >> "$GITHUB_OUTPUT" + echo '# ⚠️ Notes ⚠️' >> "$GITHUB_OUTPUT" + echo '## Run PK fix manually' >> "$GITHUB_OUTPUT" + echo 'Due to restrictions workflow `dependencies_update.yml` can't update other workflows, see https://github.com/exasol/project-keeper/issues/578 for details.' >> "$GITHUB_OUTPUT" + echo 'Please checkout this PR locally and run `mvn com.exasol:project-keeper-maven-plugin:fix --projects .`' >> "$GITHUB_OUTPUT" + echo '## This PR does not trigger CI workflows' >> "$GITHUB_OUTPUT" echo 'Please click the **Close pull request** button and then **Reopen pull request** to trigger running checks.' >> "$GITHUB_OUTPUT" echo 'See https://github.com/exasol/project-keeper/issues/534 for details.' >> "$GITHUB_OUTPUT" echo 'EOF' >> "$GITHUB_OUTPUT" diff --git a/dependencies.md b/dependencies.md index 0b547895..bb03d959 100644 --- a/dependencies.md +++ b/dependencies.md @@ -362,7 +362,7 @@ [51]: https://github.com/vdurmont/semver4j [52]: https://bitbucket.org/snakeyaml/snakeyaml [53]: https://bitbucket.org/snakeyaml/snakeyaml-engine -[54]: https://maven.apache.org/ref/3.9.6/maven-model/ +[54]: https://maven.apache.org/ref/3.9.7/maven-model/ [55]: https://www.jcabi.com/jcabi-github [56]: https://www.jcabi.com/LICENSE.txt [57]: https://github.com/exasol/maven-project-version-getter/ @@ -376,8 +376,8 @@ [65]: https://github.com/exasol/artifact-reference-checker-maven-plugin/ [66]: https://github.com/exasol/artifact-reference-checker-maven-plugin/blob/main/LICENSE [67]: https://maven.apache.org/plugin-tools/maven-plugin-annotations -[68]: https://maven.apache.org/ref/3.9.6/maven-plugin-api/ -[69]: https://maven.apache.org/ref/3.9.6/maven-core/ +[68]: https://maven.apache.org/ref/3.9.7/maven-plugin-api/ +[69]: https://maven.apache.org/ref/3.9.7/maven-core/ [70]: https://www.eclemma.org/jacoco/index.html [71]: https://maven.apache.org/plugin-tools/maven-plugin-plugin [72]: https://maven.apache.org/plugins/maven-dependency-plugin/ diff --git a/doc/changes/changelog.md b/doc/changes/changelog.md index 0bc7384e..6a48b5bc 100644 --- a/doc/changes/changelog.md +++ b/doc/changes/changelog.md @@ -1,5 +1,6 @@ # Changes +* [4.3.2](changes_4.3.2.md) * [4.3.1](changes_4.3.1.md) * [4.3.0](changes_4.3.0.md) * [4.2.0](changes_4.2.0.md) diff --git a/doc/changes/changes_4.3.2.md b/doc/changes/changes_4.3.2.md new file mode 100644 index 00000000..7ddfefca --- /dev/null +++ b/doc/changes/changes_4.3.2.md @@ -0,0 +1,98 @@ +# Project Keeper 4.3.2, released 2024-06-03 + +Code name: Fix automatic dependency update + +## Summary + +This release fixes creation of the automatic dependency update Pull Request. Due to restrictions of GitHub workflows it is not possible to run `project-keeper fix` which potentially updates other workflows. Please follow the instructions in the generated Pull Request and run PK fix manually. See #578 for details. + +## Bugfixes + +* #578: Fixed automatic dependency update + +## Dependency Updates + +### Project Keeper Shared Model Classes + +#### Plugin Dependency Updates + +* Updated `org.apache.maven.plugins:maven-enforcer-plugin:3.4.1` to `3.5.0` +* Updated `org.apache.maven.plugins:maven-javadoc-plugin:3.6.3` to `3.7.0` +* Updated `org.sonarsource.scanner.maven:sonar-maven-plugin:3.11.0.3922` to `4.0.0.4121` +* Updated `org.sonatype.plugins:nexus-staging-maven-plugin:1.6.13` to `1.7.0` + +### Project Keeper Core + +#### Compile Dependency Updates + +* Updated `com.exasol:project-keeper-shared-model-classes:4.3.1` to `4.3.2` + +#### Runtime Dependency Updates + +* Updated `com.exasol:project-keeper-java-project-crawler:4.3.1` to `4.3.2` + +#### Test Dependency Updates + +* Updated `com.exasol:project-keeper-shared-test-setup:4.3.1` to `4.3.2` + +#### Plugin Dependency Updates + +* Updated `org.apache.maven.plugins:maven-enforcer-plugin:3.4.1` to `3.5.0` +* Updated `org.apache.maven.plugins:maven-javadoc-plugin:3.6.3` to `3.7.0` +* Updated `org.sonarsource.scanner.maven:sonar-maven-plugin:3.11.0.3922` to `4.0.0.4121` +* Updated `org.sonatype.plugins:nexus-staging-maven-plugin:1.6.13` to `1.7.0` + +### Project Keeper Command Line Interface + +#### Compile Dependency Updates + +* Updated `com.exasol:project-keeper-core:4.3.1` to `4.3.2` +* Updated `org.apache.maven:maven-model:3.9.6` to `3.9.7` + +#### Test Dependency Updates + +* Updated `com.exasol:project-keeper-shared-test-setup:4.3.1` to `4.3.2` + +#### Plugin Dependency Updates + +* Updated `org.apache.maven.plugins:maven-enforcer-plugin:3.4.1` to `3.5.0` +* Updated `org.apache.maven.plugins:maven-javadoc-plugin:3.6.3` to `3.7.0` +* Updated `org.sonarsource.scanner.maven:sonar-maven-plugin:3.11.0.3922` to `4.0.0.4121` +* Updated `org.sonatype.plugins:nexus-staging-maven-plugin:1.6.13` to `1.7.0` + +### Project Keeper Maven Plugin + +#### Compile Dependency Updates + +* Updated `com.exasol:project-keeper-core:4.3.1` to `4.3.2` + +#### Plugin Dependency Updates + +* Updated `org.apache.maven.plugins:maven-enforcer-plugin:3.4.1` to `3.5.0` +* Updated `org.apache.maven.plugins:maven-javadoc-plugin:3.6.3` to `3.7.0` +* Updated `org.sonarsource.scanner.maven:sonar-maven-plugin:3.11.0.3922` to `4.0.0.4121` +* Updated `org.sonatype.plugins:nexus-staging-maven-plugin:1.6.13` to `1.7.0` + +### Project Keeper Java Project Crawler + +#### Compile Dependency Updates + +* Updated `com.exasol:project-keeper-shared-model-classes:4.3.1` to `4.3.2` + +#### Plugin Dependency Updates + +* Updated `org.apache.maven.plugins:maven-enforcer-plugin:3.4.1` to `3.5.0` +* Updated `org.apache.maven.plugins:maven-javadoc-plugin:3.6.3` to `3.7.0` +* Updated `org.sonarsource.scanner.maven:sonar-maven-plugin:3.11.0.3922` to `4.0.0.4121` +* Updated `org.sonatype.plugins:nexus-staging-maven-plugin:1.6.13` to `1.7.0` + +### Project Keeper Shared Test Setup + +#### Compile Dependency Updates + +* Updated `com.exasol:project-keeper-shared-model-classes:4.3.1` to `4.3.2` + +#### Plugin Dependency Updates + +* Updated `org.apache.maven.plugins:maven-enforcer-plugin:3.4.1` to `3.5.0` +* Updated `org.sonarsource.scanner.maven:sonar-maven-plugin:3.11.0.3922` to `4.0.0.4121` diff --git a/maven-project-crawler/pk_generated_parent.pom b/maven-project-crawler/pk_generated_parent.pom index f872a1a6..2a60a26a 100644 --- a/maven-project-crawler/pk_generated_parent.pom +++ b/maven-project-crawler/pk_generated_parent.pom @@ -64,7 +64,7 @@ org.sonarsource.scanner.maven sonar-maven-plugin - 3.11.0.3922 + 4.0.0.4121 org.apache.maven.plugins @@ -102,7 +102,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.4.1 + 3.5.0 enforce-maven @@ -273,7 +273,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.6.3 + 3.7.0 attach-javadocs @@ -295,7 +295,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.13 + 1.7.0 true ossrh diff --git a/parent-pom/pom.xml b/parent-pom/pom.xml index 6063a3e4..0ff0949a 100644 --- a/parent-pom/pom.xml +++ b/parent-pom/pom.xml @@ -28,10 +28,10 @@ - 4.3.1 + 4.3.2 17 - 3.9.6 + 3.9.7 3.6.3 5.10.2 2.10.0 @@ -89,7 +89,7 @@ org.apache.maven.plugin-tools maven-plugin-annotations - 3.13.0 + 3.13.1 provided diff --git a/project-keeper-cli/pk_generated_parent.pom b/project-keeper-cli/pk_generated_parent.pom index 7ef6c21f..55cc61b5 100644 --- a/project-keeper-cli/pk_generated_parent.pom +++ b/project-keeper-cli/pk_generated_parent.pom @@ -56,7 +56,7 @@ org.sonarsource.scanner.maven sonar-maven-plugin - 3.11.0.3922 + 4.0.0.4121 org.apache.maven.plugins @@ -94,7 +94,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.4.1 + 3.5.0 enforce-maven @@ -315,7 +315,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.6.3 + 3.7.0 attach-javadocs @@ -337,7 +337,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.13 + 1.7.0 true ossrh diff --git a/project-keeper-maven-plugin/pk_generated_parent.pom b/project-keeper-maven-plugin/pk_generated_parent.pom index cbb3cc72..81dadfd1 100644 --- a/project-keeper-maven-plugin/pk_generated_parent.pom +++ b/project-keeper-maven-plugin/pk_generated_parent.pom @@ -64,7 +64,7 @@ org.sonarsource.scanner.maven sonar-maven-plugin - 3.11.0.3922 + 4.0.0.4121 org.apache.maven.plugins @@ -102,7 +102,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.4.1 + 3.5.0 enforce-maven @@ -273,7 +273,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.6.3 + 3.7.0 attach-javadocs @@ -295,7 +295,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.13 + 1.7.0 true ossrh diff --git a/project-keeper/pk_generated_parent.pom b/project-keeper/pk_generated_parent.pom index 3db04daa..118a33ae 100644 --- a/project-keeper/pk_generated_parent.pom +++ b/project-keeper/pk_generated_parent.pom @@ -56,7 +56,7 @@ org.sonarsource.scanner.maven sonar-maven-plugin - 3.11.0.3922 + 4.0.0.4121 org.apache.maven.plugins @@ -94,7 +94,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.4.1 + 3.5.0 enforce-maven @@ -265,7 +265,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.6.3 + 3.7.0 attach-javadocs @@ -287,7 +287,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.13 + 1.7.0 true ossrh diff --git a/project-keeper/src/main/resources/maven_templates/maven-enforcer-plugin.xml b/project-keeper/src/main/resources/maven_templates/maven-enforcer-plugin.xml index 7c653c1d..e4560830 100644 --- a/project-keeper/src/main/resources/maven_templates/maven-enforcer-plugin.xml +++ b/project-keeper/src/main/resources/maven_templates/maven-enforcer-plugin.xml @@ -1,7 +1,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.4.1 + 3.5.0 enforce-maven diff --git a/project-keeper/src/main/resources/maven_templates/maven-javadoc-plugin.xml b/project-keeper/src/main/resources/maven_templates/maven-javadoc-plugin.xml index be039795..5c796e23 100644 --- a/project-keeper/src/main/resources/maven_templates/maven-javadoc-plugin.xml +++ b/project-keeper/src/main/resources/maven_templates/maven-javadoc-plugin.xml @@ -1,7 +1,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.6.3 + 3.7.0 attach-javadocs diff --git a/project-keeper/src/main/resources/maven_templates/nexus-staging-maven-plugin.xml b/project-keeper/src/main/resources/maven_templates/nexus-staging-maven-plugin.xml index 5950464c..113a737c 100644 --- a/project-keeper/src/main/resources/maven_templates/nexus-staging-maven-plugin.xml +++ b/project-keeper/src/main/resources/maven_templates/nexus-staging-maven-plugin.xml @@ -1,7 +1,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.13 + 1.7.0 true ossrh @@ -18,4 +18,4 @@ - \ No newline at end of file + diff --git a/project-keeper/src/main/resources/maven_templates/sonar-maven-plugin.xml b/project-keeper/src/main/resources/maven_templates/sonar-maven-plugin.xml index dac8a7cc..eb9541e5 100644 --- a/project-keeper/src/main/resources/maven_templates/sonar-maven-plugin.xml +++ b/project-keeper/src/main/resources/maven_templates/sonar-maven-plugin.xml @@ -1,5 +1,5 @@ org.sonarsource.scanner.maven sonar-maven-plugin - 3.11.0.3922 + 4.0.0.4121 diff --git a/project-keeper/src/main/resources/templates/.github/workflows/dependencies_update.yml b/project-keeper/src/main/resources/templates/.github/workflows/dependencies_update.yml index ff70296b..ce54e193 100644 --- a/project-keeper/src/main/resources/templates/.github/workflows/dependencies_update.yml +++ b/project-keeper/src/main/resources/templates/.github/workflows/dependencies_update.yml @@ -62,19 +62,6 @@ jobs: env: CREATED_ISSUES: ${{ inputs.vulnerability_issues }} - - name: Project Keeper Fix - id: project-keeper-fix - run: | - mvn --batch-mode com.exasol:project-keeper-maven-plugin:fix --projects . - - - name: Project Keeper Fix for updated Project Keeper version - id: project-keeper-fix-2 - # Calling PK fix a second time is necessary because the first invocation potentially updated PK itself. - # So we need to run PK fix again with the latest PK version. - # [impl->dsn~dependency-updater.workflow.start-pk-fix~1] - run: | - mvn --batch-mode com.exasol:project-keeper-maven-plugin:fix --projects . - - name: Generate Pull Request comment id: pr-comment # [impl->dsn~dependency-updater.workflow.create-pull-request~1] @@ -89,7 +76,11 @@ jobs: echo 'It updates dependencies.' >> "$GITHUB_OUTPUT" fi echo >> "$GITHUB_OUTPUT" - echo '# ⚠️ This PR does not trigger CI workflows by default ⚠️' >> "$GITHUB_OUTPUT" + echo '# ⚠️ Notes ⚠️' >> "$GITHUB_OUTPUT" + echo '## Run PK fix manually' >> "$GITHUB_OUTPUT" + echo 'Due to restrictions workflow `dependencies_update.yml` can't update other workflows, see https://github.com/exasol/project-keeper/issues/578 for details.' >> "$GITHUB_OUTPUT" + echo 'Please checkout this PR locally and run `mvn com.exasol:project-keeper-maven-plugin:fix --projects .`' >> "$GITHUB_OUTPUT" + echo '## This PR does not trigger CI workflows' >> "$GITHUB_OUTPUT" echo 'Please click the **Close pull request** button and then **Reopen pull request** to trigger running checks.' >> "$GITHUB_OUTPUT" echo 'See https://github.com/exasol/project-keeper/issues/534 for details.' >> "$GITHUB_OUTPUT" echo 'EOF' >> "$GITHUB_OUTPUT" diff --git a/shared-model-classes/pk_generated_parent.pom b/shared-model-classes/pk_generated_parent.pom index 660259f0..7dd730be 100644 --- a/shared-model-classes/pk_generated_parent.pom +++ b/shared-model-classes/pk_generated_parent.pom @@ -56,7 +56,7 @@ org.sonarsource.scanner.maven sonar-maven-plugin - 3.11.0.3922 + 4.0.0.4121 org.apache.maven.plugins @@ -94,7 +94,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.4.1 + 3.5.0 enforce-maven @@ -265,7 +265,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.6.3 + 3.7.0 attach-javadocs @@ -287,7 +287,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.13 + 1.7.0 true ossrh diff --git a/shared-test-setup/pk_generated_parent.pom b/shared-test-setup/pk_generated_parent.pom index 187e9cfc..d3cd19a0 100644 --- a/shared-test-setup/pk_generated_parent.pom +++ b/shared-test-setup/pk_generated_parent.pom @@ -45,7 +45,7 @@ org.sonarsource.scanner.maven sonar-maven-plugin - 3.11.0.3922 + 4.0.0.4121 org.apache.maven.plugins @@ -83,7 +83,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.4.1 + 3.5.0 enforce-maven From 48657eb4bed88c1555e43f5ca726b2144358249d Mon Sep 17 00:00:00 2001 From: Christoph Pirkl Date: Mon, 3 Jun 2024 10:06:38 +0200 Subject: [PATCH 2/9] Update plugin versions --- dependencies.md | 2 +- doc/changes/changes_4.3.2.md | 11 +++++++++++ parent-pom/pom.xml | 2 +- pom.xml | 4 ++-- project-keeper-cli/pom.xml | 1 - project-keeper-maven-plugin/pom.xml | 2 +- 6 files changed, 16 insertions(+), 6 deletions(-) diff --git a/dependencies.md b/dependencies.md index bb03d959..f8c7e154 100644 --- a/dependencies.md +++ b/dependencies.md @@ -213,7 +213,7 @@ | [org.sonatype.ossindex.maven:ossindex-maven-plugin][33] | [ASL2][34] | | [Maven Surefire Plugin][35] | [Apache-2.0][1] | | [Versions Maven Plugin][36] | [Apache License, Version 2.0][1] | -| [Apache Maven JAR Plugin][62] | [Apache License, Version 2.0][1] | +| [Apache Maven JAR Plugin][62] | [Apache-2.0][1] | | [duplicate-finder-maven-plugin Maven Mojo][37] | [Apache License 2.0][38] | | [Apache Maven Deploy Plugin][4] | [Apache-2.0][1] | | [Apache Maven GPG Plugin][39] | [Apache-2.0][1] | diff --git a/doc/changes/changes_4.3.2.md b/doc/changes/changes_4.3.2.md index 7ddfefca..c91825ad 100644 --- a/doc/changes/changes_4.3.2.md +++ b/doc/changes/changes_4.3.2.md @@ -12,6 +12,13 @@ This release fixes creation of the automatic dependency update Pull Request. Due ## Dependency Updates +### Project Keeper Root Project + +#### Plugin Dependency Updates + +* Updated `org.apache.maven.plugins:maven-deploy-plugin:3.1.1` to `3.1.2` +* Updated `org.apache.maven.plugins:maven-enforcer-plugin:3.4.1` to `3.5.0` + ### Project Keeper Shared Model Classes #### Plugin Dependency Updates @@ -55,6 +62,7 @@ This release fixes creation of the automatic dependency update Pull Request. Due #### Plugin Dependency Updates +* Updated `org.apache.maven.plugins:maven-assembly-plugin:3.6.0` to `3.7.1` * Updated `org.apache.maven.plugins:maven-enforcer-plugin:3.4.1` to `3.5.0` * Updated `org.apache.maven.plugins:maven-javadoc-plugin:3.6.3` to `3.7.0` * Updated `org.sonarsource.scanner.maven:sonar-maven-plugin:3.11.0.3922` to `4.0.0.4121` @@ -69,7 +77,9 @@ This release fixes creation of the automatic dependency update Pull Request. Due #### Plugin Dependency Updates * Updated `org.apache.maven.plugins:maven-enforcer-plugin:3.4.1` to `3.5.0` +* Updated `org.apache.maven.plugins:maven-jar-plugin:3.3.0` to `3.4.1` * Updated `org.apache.maven.plugins:maven-javadoc-plugin:3.6.3` to `3.7.0` +* Updated `org.apache.maven.plugins:maven-plugin-plugin:3.11.0` to `3.13.1` * Updated `org.sonarsource.scanner.maven:sonar-maven-plugin:3.11.0.3922` to `4.0.0.4121` * Updated `org.sonatype.plugins:nexus-staging-maven-plugin:1.6.13` to `1.7.0` @@ -83,6 +93,7 @@ This release fixes creation of the automatic dependency update Pull Request. Due * Updated `org.apache.maven.plugins:maven-enforcer-plugin:3.4.1` to `3.5.0` * Updated `org.apache.maven.plugins:maven-javadoc-plugin:3.6.3` to `3.7.0` +* Updated `org.apache.maven.plugins:maven-plugin-plugin:3.11.0` to `3.13.1` * Updated `org.sonarsource.scanner.maven:sonar-maven-plugin:3.11.0.3922` to `4.0.0.4121` * Updated `org.sonatype.plugins:nexus-staging-maven-plugin:1.6.13` to `1.7.0` diff --git a/parent-pom/pom.xml b/parent-pom/pom.xml index 0ff0949a..bcda6651 100644 --- a/parent-pom/pom.xml +++ b/parent-pom/pom.xml @@ -259,7 +259,7 @@ org.apache.maven.plugins maven-plugin-plugin - 3.11.0 + 3.13.1 diff --git a/pom.xml b/pom.xml index 72463692..7f0a7c1d 100644 --- a/pom.xml +++ b/pom.xml @@ -31,7 +31,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.4.1 + 3.5.0 enforce-maven @@ -70,7 +70,7 @@ org.apache.maven.plugins maven-deploy-plugin - 3.1.1 + 3.1.2 true diff --git a/project-keeper-cli/pom.xml b/project-keeper-cli/pom.xml index 3e2655d1..13c44153 100644 --- a/project-keeper-cli/pom.xml +++ b/project-keeper-cli/pom.xml @@ -75,7 +75,6 @@ org.apache.maven.plugins maven-assembly-plugin - 3.6.0 project-keeper-cli-${project.version} diff --git a/project-keeper-maven-plugin/pom.xml b/project-keeper-maven-plugin/pom.xml index 701fd0bc..237c7410 100644 --- a/project-keeper-maven-plugin/pom.xml +++ b/project-keeper-maven-plugin/pom.xml @@ -108,7 +108,7 @@ org.apache.maven.plugins maven-jar-plugin - 3.3.0 + 3.4.1 From 6c0c2d389d87cb87e17a91fd6a3dd034541ad160 Mon Sep 17 00:00:00 2001 From: Christoph Pirkl Date: Mon, 3 Jun 2024 10:09:43 +0200 Subject: [PATCH 3/9] Remove requirement --- doc/requirements/design.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/requirements/design.md b/doc/requirements/design.md index 94285813..6f209f56 100644 --- a/doc/requirements/design.md +++ b/doc/requirements/design.md @@ -754,7 +754,10 @@ Rationale: * After updating dependency versions, the workflow runs PK `fix` to update the dependencies section in the changes file. * PK `fix` will potentially update PK to a newer version in `pom.xml` (see [`dsn~self-update~1`](#project-keeper-self-update)). So the workflow runs PK `fix` a second time (using the updated PK version) to update all generated files. -Needs: impl +Note: +Due to restrictions of GitHub permissions it is not possible for a workflow triggered by an event to modify GitHub workflows (see https://github.com/orgs/community/discussions/35410). That's why pushing the changes fail. A workaround would be to use a separate PAT, but this is too much effort. + +We decided to skip running PK fix. The user must checkout the branch locally and run PK fix manually. Covers: * [`dsn~dependency-updater.workflow.generate~1`](#generate-dependencies_updateyml-workflow) From bdce96656ec03a54dbae825f9b6dbba36232712d Mon Sep 17 00:00:00 2001 From: Christoph Pirkl Date: Mon, 3 Jun 2024 10:19:07 +0200 Subject: [PATCH 4/9] #577: Fix code for failing NPM dependency URL --- .../sources/analyze/npm/NpmDependencies.java | 4 +++- .../sources/analyze/npm/NpmDependenciesTest.java | 11 +++++++++++ .../projectkeeper/sources/analyze/npm/TestData.java | 10 ++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/project-keeper/src/main/java/com/exasol/projectkeeper/sources/analyze/npm/NpmDependencies.java b/project-keeper/src/main/java/com/exasol/projectkeeper/sources/analyze/npm/NpmDependencies.java index d90344f2..217c3bce 100644 --- a/project-keeper/src/main/java/com/exasol/projectkeeper/sources/analyze/npm/NpmDependencies.java +++ b/project-keeper/src/main/java/com/exasol/projectkeeper/sources/analyze/npm/NpmDependencies.java @@ -66,6 +66,8 @@ private List moduleLicenses(final String moduleName) { } private String getUrl(final String moduleName) { - return this.additionalInfo.getJsonObject(moduleName).getString("resolved"); + return Optional.ofNullable(this.additionalInfo.getJsonObject(moduleName)) // + .map(object -> object.getString("resolved")) // + .orElse(null); } } diff --git a/project-keeper/src/test/java/com/exasol/projectkeeper/sources/analyze/npm/NpmDependenciesTest.java b/project-keeper/src/test/java/com/exasol/projectkeeper/sources/analyze/npm/NpmDependenciesTest.java index 0ed8a675..39abc627 100644 --- a/project-keeper/src/test/java/com/exasol/projectkeeper/sources/analyze/npm/NpmDependenciesTest.java +++ b/project-keeper/src/test/java/com/exasol/projectkeeper/sources/analyze/npm/NpmDependenciesTest.java @@ -39,6 +39,17 @@ void getDependencies() { )); } + @Test + void getDependenciesMissingUrl() { + when(this.npmServices.listDependencies(any())).thenReturn(json(TestData.DEPENDENCIES_MISSING_URL)); + when(this.npmServices.getLicenses(any())).thenReturn(json(TestData.LICENSES)); + + final NpmDependencies testee = new NpmDependencies(this.npmServices, TestData.samplePackageJson()); + assertThat(testee.getDependencies(), containsInAnyOrder( // + dependency(Type.COMPILE, "new-compile", "2.3.0", "NC") // + )); + } + private ProjectDependency dependency(final Type type, final String name, final String version, final String license) { return ProjectDependency.builder() // diff --git a/project-keeper/src/test/java/com/exasol/projectkeeper/sources/analyze/npm/TestData.java b/project-keeper/src/test/java/com/exasol/projectkeeper/sources/analyze/npm/TestData.java index c1498d7b..4cdabdf0 100644 --- a/project-keeper/src/test/java/com/exasol/projectkeeper/sources/analyze/npm/TestData.java +++ b/project-keeper/src/test/java/com/exasol/projectkeeper/sources/analyze/npm/TestData.java @@ -77,6 +77,16 @@ class TestData { " }", // "}"); + static final String DEPENDENCIES_MISSING_URL = jsonString("{", // + " 'name': 'module-name',", // + " 'version': '2.0.0',", // + " 'dependencies': {", // + " 'new-compile': {", // + " 'version': '2.3.0'", // + " }", // + " }", // + "}"); + static String jsonString(final String... s) { return String.join("\n", s).replace('\'', '"'); } From e917c8c7f416211a1c362e038648f8a7c99f4ba5 Mon Sep 17 00:00:00 2001 From: Christoph Pirkl Date: Mon, 3 Jun 2024 10:24:58 +0200 Subject: [PATCH 5/9] Adapt unit tests --- .../validators/files/CiBuildWorkflowGeneratorTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/project-keeper/src/test/java/com/exasol/projectkeeper/validators/files/CiBuildWorkflowGeneratorTest.java b/project-keeper/src/test/java/com/exasol/projectkeeper/validators/files/CiBuildWorkflowGeneratorTest.java index d5eb8c6b..455fd990 100644 --- a/project-keeper/src/test/java/com/exasol/projectkeeper/validators/files/CiBuildWorkflowGeneratorTest.java +++ b/project-keeper/src/test/java/com/exasol/projectkeeper/validators/files/CiBuildWorkflowGeneratorTest.java @@ -214,7 +214,7 @@ void dependencyUpdateBuildCustomized() { .step(WorkflowStep.createStep(Map.of("id", "new-step", "name", "New Step"))).build()) .build())) .build()).getJob("update_dependencies"); - assertAll(() -> assertThat(job.getSteps(), hasSize(16)), + assertAll(() -> assertThat(job.getSteps(), hasSize(14)), () -> assertThat(job.getStep("new-step").getName(), equalTo("New Step"))); } @@ -249,7 +249,7 @@ void dependencyCheckBuildAllStepsHaveId() { @Test void dependencyUpdateBuildAllStepsHaveId() { final Job job = dependencyUpdateBuildContent(BuildOptions.builder().build()).getJob("update_dependencies"); - assertThat(job.getSteps(), hasSize(greaterThanOrEqualTo(15))); + assertThat(job.getSteps(), hasSize(greaterThanOrEqualTo(13))); job.getSteps().forEach(step -> assertThat(step.getId(), notNullValue())); } From a1988cf42ef176a65cd73d6a55f3a89d15543c03 Mon Sep 17 00:00:00 2001 From: Christoph Pirkl Date: Mon, 3 Jun 2024 10:33:33 +0200 Subject: [PATCH 6/9] #577: Don't fail for missing URL --- .../sources/analyze/npm/NpmDependencies.java | 1 + .../sources/analyze/npm/NpmDependenciesTest.java | 10 +++++++++- .../projectkeeper/sources/analyze/npm/TestData.java | 12 ++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/project-keeper/src/main/java/com/exasol/projectkeeper/sources/analyze/npm/NpmDependencies.java b/project-keeper/src/main/java/com/exasol/projectkeeper/sources/analyze/npm/NpmDependencies.java index 217c3bce..386a7542 100644 --- a/project-keeper/src/main/java/com/exasol/projectkeeper/sources/analyze/npm/NpmDependencies.java +++ b/project-keeper/src/main/java/com/exasol/projectkeeper/sources/analyze/npm/NpmDependencies.java @@ -67,6 +67,7 @@ private List moduleLicenses(final String moduleName) { private String getUrl(final String moduleName) { return Optional.ofNullable(this.additionalInfo.getJsonObject(moduleName)) // + .filter(object -> object.containsKey("resolved")) // .map(object -> object.getString("resolved")) // .orElse(null); } diff --git a/project-keeper/src/test/java/com/exasol/projectkeeper/sources/analyze/npm/NpmDependenciesTest.java b/project-keeper/src/test/java/com/exasol/projectkeeper/sources/analyze/npm/NpmDependenciesTest.java index 39abc627..f0dec22b 100644 --- a/project-keeper/src/test/java/com/exasol/projectkeeper/sources/analyze/npm/NpmDependenciesTest.java +++ b/project-keeper/src/test/java/com/exasol/projectkeeper/sources/analyze/npm/NpmDependenciesTest.java @@ -46,7 +46,15 @@ void getDependenciesMissingUrl() { final NpmDependencies testee = new NpmDependencies(this.npmServices, TestData.samplePackageJson()); assertThat(testee.getDependencies(), containsInAnyOrder( // - dependency(Type.COMPILE, "new-compile", "2.3.0", "NC") // + dependency(Type.DEV, "changed-plugin", "1.2.0", "CP"), // + dependency(Type.DEV, "new-plugin", "1.3.0", "NP"), // + dependency(Type.COMPILE, "changed-compile", "2.2.0", "CC"), // + ProjectDependency.builder() // + .type(Type.COMPILE)// + .name("new-compile") // + .websiteUrl(null) // + .licenses(List.of(new License("NC" + "-License", "https://" + "new-compile"))) // + .build() // )); } diff --git a/project-keeper/src/test/java/com/exasol/projectkeeper/sources/analyze/npm/TestData.java b/project-keeper/src/test/java/com/exasol/projectkeeper/sources/analyze/npm/TestData.java index 4cdabdf0..8a42991d 100644 --- a/project-keeper/src/test/java/com/exasol/projectkeeper/sources/analyze/npm/TestData.java +++ b/project-keeper/src/test/java/com/exasol/projectkeeper/sources/analyze/npm/TestData.java @@ -81,6 +81,18 @@ class TestData { " 'name': 'module-name',", // " 'version': '2.0.0',", // " 'dependencies': {", // + " 'changed-plugin': {", // + " 'version': '1.2.0',", // + " 'resolved': 'https://changed-plugin/-/1.2.0.tgz'", // + " },", // + " 'new-plugin': {", // + " 'version': '1.3.0',", // + " 'resolved': 'https://new-plugin/-/1.3.0.tgz'", // + " },", // + " 'changed-compile': {", // + " 'version': '2.2.0',", // + " 'resolved': 'https://changed-compile/-/2.2.0.tgz'", // + " },", // " 'new-compile': {", // " 'version': '2.3.0'", // " }", // From 7f3681baaa67e8cd613100dcf6342de05ca4418f Mon Sep 17 00:00:00 2001 From: Christoph Pirkl Date: Mon, 3 Jun 2024 11:07:49 +0200 Subject: [PATCH 7/9] Fix javadoc generation --- project-keeper-cli/pom.xml | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/project-keeper-cli/pom.xml b/project-keeper-cli/pom.xml index 13c44153..425b69f0 100644 --- a/project-keeper-cli/pom.xml +++ b/project-keeper-cli/pom.xml @@ -98,17 +98,10 @@ org.apache.maven.plugins maven-javadoc-plugin - - - - - - - - - false + + true From 0bdd409b314b5d4f2904cfe03fa127b05dc3429b Mon Sep 17 00:00:00 2001 From: Christoph Pirkl Date: Mon, 3 Jun 2024 12:36:59 +0200 Subject: [PATCH 8/9] Increment requirement revision --- doc/requirements/design.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/requirements/design.md b/doc/requirements/design.md index 6f209f56..f1427431 100644 --- a/doc/requirements/design.md +++ b/doc/requirements/design.md @@ -745,7 +745,7 @@ Covers: * [`dsn~dependency-updater.workflow.generate~1`](#generate-dependencies_updateyml-workflow) #### `dependencies_update.yml` Workflow Starts PK `fix` Mode Twice -`dsn~dependency-updater.workflow.start-pk-fix~1` +`dsn~dependency-updater.workflow.start-pk-fix~2` PK generates the `dependencies_update.yml` workflow so that it starts PK's `fix` mode twice after updating dependencies. From 4fee27ab01b21cd946b1f7b029d47dcd19a33e32 Mon Sep 17 00:00:00 2001 From: Christoph Pirkl Date: Mon, 3 Jun 2024 12:38:45 +0200 Subject: [PATCH 9/9] Update changelog --- doc/changes/changes_4.3.2.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/changes/changes_4.3.2.md b/doc/changes/changes_4.3.2.md index c91825ad..19ceac29 100644 --- a/doc/changes/changes_4.3.2.md +++ b/doc/changes/changes_4.3.2.md @@ -9,6 +9,7 @@ This release fixes creation of the automatic dependency update Pull Request. Due ## Bugfixes * #578: Fixed automatic dependency update +* #577: Fixed reading NPM dependencies with a missing project URL ## Dependency Updates