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

rename neo4j package according to version stream #38299

Merged
merged 1 commit into from
Dec 24, 2024

Conversation

developer-guy
Copy link
Member

@developer-guy developer-guy commented Dec 24, 2024

Neo4j is a version streamed package so according to that we should rename the package for making it version streamed compliant.

For new version streams

  • The upstream project actually supports multiple concurrent versions.
  • Any subpackages include the version string in their package name (e.g. name: ${{package.name}}-compat)
  • The package (and subpackages) provides: logical unversioned forms of the package (e.g. nodejs, nodejs-lts)
  • If non-streamed package names no longer built, open PR to withdraw them (see WITHDRAWING PACKAGES)

Copy link
Contributor

octo-sts bot commented Dec 24, 2024

Gen AI suggestions to solve the build error:

Based on the error log, I'll analyze and provide a solution:

• Detected Error: None visible in the log - the build appears to stop after the git checkout step without an explicit error message

• Error Category: Build/Configuration

• Failure Point: After git checkout step, before maven build can start

• Root Cause Analysis: The build appears to silently fail after the git checkout step, likely due to missing environment setup or directory permission issues common in Java/Maven builds.

• Suggested Fix:

  1. Add explicit environment variables before the maven build:
pipeline:
  - uses: git-checkout
    with:
      repository: https://github.com/neo4j/neo4j
      tag: ${{package.version}}
      expected-commit: 17dc7f7e1787c451938b97666a06afd3695987ca

  - uses: maven/pombump

  - runs: |
      export JAVA_HOME=/usr/lib/jvm/java-17-openjdk
      export PATH=$JAVA_HOME/bin:$PATH
      export MAVEN_OPTS="-Xmx2048m -Dmaven.repo.local=/tmp/m2"
      export HOME=/tmp

      mvn package -DskipTests=true -T$(nproc)C -q

• Explanation:

  • Setting JAVA_HOME ensures Maven uses the correct JDK
  • Creating a specific maven local repo prevents permission issues
  • Setting HOME to /tmp ensures build user has write permissions
  • These environment variables are commonly required for Java builds in containerized environments

• Additional Notes:

  • The build appears to complete the git checkout but fails silently before Maven execution
  • Maven builds require specific environment setup in containerized environments
  • Similar issues are common in CI systems when building Java applications

• References:

Copy link
Contributor

octo-sts bot commented Dec 24, 2024

Gen AI suggestions to solve the build error:

• Detected Error:
"Error: no dependencies or properties provides, use --dependencies/--patch-file or --properties/properties-file"

• Error Category: Build Configuration

• Failure Point:
The maven/pombump pipeline step

• Root Cause Analysis:
The maven/pombump step is failing because it requires either dependencies or properties to be specified, but none were provided in the melange YAML configuration.

• Suggested Fix:
Remove the maven/pombump step since it's not needed for this build. The package is being built from a specific git tag, so there's no need to bump versions in the pom.xml. Modify the pipeline section to:

pipeline:
  - uses: git-checkout
    with:
      repository: https://github.com/neo4j/neo4j
      tag: ${{package.version}}
      expected-commit: 17dc7f7e1787c451938b97666a06afd3695987ca

  - runs: |
      export LANG=en_US.UTF-8
      export MAVEN_OPTS="-Xmx2048m"
      
      mvn package -DskipTests=true -T$(nproc)C -q
      # ... rest of the build steps

• Explanation:
The maven/pombump tool is typically used when you need to modify Maven dependencies or properties in the pom.xml before building. Since this package is building from a specific tagged release (5.26.0), there's no need to modify the pom.xml file. Removing this step will allow the build to proceed with the original pom.xml from the source.

• Additional Notes:

  • The build still maintains version control through the git tag checkout
  • Maven will use the dependencies as defined in the original pom.xml
  • This approach is more appropriate for building released versions

• References:

@octo-sts octo-sts bot added the bincapz/pass bincapz/pass Bincapz (aka. malcontent) scan didn't detect any CRITICALs on the scanned packages. label Dec 24, 2024
@developer-guy developer-guy force-pushed the rename-neo4j branch 3 times, most recently from d0010fa to f0e8ebb Compare December 24, 2024 14:43
Copy link
Contributor

octo-sts bot commented Dec 24, 2024

Gen AI suggestions to solve the build error:

• Detected Error:

[ERROR] Failed to execute goal on project neo4j-cloud-storage-testing: Could not resolve dependencies for project com.neo4j:neo4j-cloud-storage-testing:jar:5.26.0
[ERROR] dependency: org.eclipse.jetty:jetty-webapp:jar:12.0.12 (compile)
[ERROR] Could not find artifact org.eclipse.jetty:jetty-webapp:jar:12.0.12 in central (https://repo.maven.apache.org/maven2)

• Error Category: Dependency

• Failure Point: Maven dependency resolution during build phase

• Root Cause Analysis:
The build is failing because it cannot find Jetty 12.0.12 in Maven Central. This version appears to be too new and may not yet be published to Maven Central.

• Suggested Fix:

  1. Check the latest available version of Jetty in Maven Central
  2. Update the jetty.version property in pombump-deps.yaml to use the latest stable version available (likely 12.0.11)
  3. Update the patch file accordingly

Example fix for pombump-deps.yaml:

properties:
  jetty.version: "12.0.11"

• Explanation:
Maven builds fail when they cannot resolve dependencies from configured repositories. Using the latest published version available in Maven Central will allow the build to proceed while maintaining relatively recent dependencies.

• Additional Notes:

  • Jetty 12.0.12 appears to be very recent and may not be published yet
  • Neo4j typically works with a range of Jetty versions, so using 12.0.11 should be compatible
  • Once Jetty 12.0.12 is published to Maven Central, the version can be bumped back up

• References:

Copy link
Contributor

octo-sts bot commented Dec 24, 2024

Gen AI suggestions to solve the build error:

• Detected Error:

[ERROR] Could not resolve dependencies for project com.neo4j:neo4j-cloud-storage-testing:jar:5.26.0
[ERROR] dependency: org.eclipse.jetty:jetty-webapp:jar:12.0.12
[ERROR] Could not find artifact org.eclipse.jetty:jetty-webapp:jar:12.0.12 in central

• Error Category: Dependency

• Failure Point: Maven dependency resolution during build phase

• Root Cause Analysis: The build is failing because it cannot find Jetty 12.0.12 artifacts. The pombump step updated the Jetty version from 10.0.24 to 12.0.12, but this version appears to be incompatible or unavailable.

• Suggested Fix:

  1. Modify the pombump-deps.yaml file to use a verified available Jetty version
  2. Replace the Jetty version upgrade with:
- property: jetty.version
  value: "10.0.19"  # or another stable 10.x version

• Explanation:

  • Neo4j 5.26.0 was likely tested with Jetty 10.x series
  • Jumping to Jetty 12.x is a major version upgrade that may have compatibility issues
  • Jetty 10.x series is still actively maintained and receives security updates
  • Using a known compatible version will resolve the dependency resolution error

• Additional Notes:

  • Major version jumps (10.x to 12.x) often require significant adaptation
  • Jetty 12 introduces breaking changes that may not be compatible with Neo4j 5.26
  • The safer approach is to stay within the same major version series (10.x)

• References:

Copy link
Contributor

octo-sts bot commented Dec 24, 2024

Gen AI suggestions to solve the build error:

• Detected Error:

[ERROR] Failed to execute goal org.neo4j.build.plugins:licensing-maven-plugin:1.7.11:check (list-all-licenses) on project neo4j-cloud-storage-testing: Generated file differs from the existing file.
[ERROR] Generated: /home/build/private/enterprise/cloud-storage/testing/target/neo4j-cloud-storage-testing-5.26.0-NOTICE.txt
[ERROR] Existing: /home/build/private/enterprise/cloud-storage/testing/target/../NOTICE.txt

• Error Category: Build Configuration

• Failure Point: Maven licensing plugin check during build process

• Root Cause Analysis: The licensing-maven-plugin is failing because there's a mismatch between the generated NOTICE.txt file and the existing one. This is a common issue when building Neo4j from source, as the licensing plugin performs strict checks on license files.

• Suggested Fix:
Add the following to the Maven command in the pipeline:

  - runs: |
      export LANG=en_US.UTF-8
      export MAVEN_OPTS="-Xmx2048m"
      
      mvn package -DskipTests=true -Doverwrite -T$(nproc)C -q

• Explanation:
Adding -Doverwrite flag tells the licensing-maven-plugin to automatically overwrite existing license files with generated ones, which is exactly what the error message suggests. This is safe because we're doing a clean build in an isolated environment.

• Additional Notes:

  • The error is not related to actual build functionality but rather license compliance checking
  • This is a common issue when building Neo4j from source
  • The -Doverwrite flag is specifically mentioned in the error message as the solution
  • This won't affect the runtime functionality of the package

• References:

Copy link
Contributor

octo-sts bot commented Dec 24, 2024

Gen AI suggestions to solve the build error:

• Detected Error:

Rule 0: org.apache.maven.enforcer.rules.dependency.DependencyConvergence failed
Dependency convergence error for org.eclipse.jetty:jetty-http:jar:12.0.12

• Error Category: Dependency

• Failure Point: Maven enforcer plugin dependency convergence check during build

• Root Cause Analysis: There are conflicting versions of Jetty dependencies in the project - some components are using Jetty 12.0.12 while others are using 10.0.24

• Suggested Fix:

  1. Update the patch file to align all Jetty dependencies to version 12.0.12
  2. Add a dependencyManagement section to force Jetty version alignment:
- uses: maven/pombump
  with:
    patch-file: pombump-deps.yaml
    properties:
      jetty.version: 12.0.12
    force-dependencies:
      - org.eclipse.jetty:jetty-http:12.0.12
      - org.eclipse.jetty:jetty-util:12.0.12  
      - org.eclipse.jetty:jetty-io:12.0.12
      - org.eclipse.jetty.http2:*:12.0.12

• Explanation: The Maven enforcer plugin is failing because it detected multiple versions of Jetty dependencies in the dependency tree. By explicitly managing all Jetty dependencies to use version 12.0.12, we ensure dependency convergence.

• Additional Notes:

  • The http2-server component needs to be updated from 10.0.24 to 12.0.12
  • All Jetty components should be aligned to the same version
  • This is a common issue when upgrading components that have multiple interdependencies

• References:

Signed-off-by: Batuhan Apaydin <batuhan.apaydin@chainguard.dev>
@Aditvil-Dev Aditvil-Dev merged commit 61f678b into wolfi-dev:main Dec 24, 2024
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bincapz/pass bincapz/pass Bincapz (aka. malcontent) scan didn't detect any CRITICALs on the scanned packages.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants