Skip to content

Conversation

@jmle
Copy link
Collaborator

@jmle jmle commented Oct 15, 2025

https://issues.redhat.com/browse/MTA-6231

Summary by CodeRabbit

  • New Features

    • The container image now includes pre-packaged Maven index metadata, making it available to the application at runtime.
  • Chores

    • Updated the Docker build process to download and incorporate Maven index data via an additional build stage.
    • Established a dedicated working directory in the image for the bundled index data.
    • Preserved existing build stages while integrating the new data into the final image.

Signed-off-by: Juan Manuel Leflet Estrada <[email protected]>
@coderabbitai
Copy link

coderabbitai bot commented Oct 15, 2025

Walkthrough

Adds a new Docker multi-stage build step (index-download) that installs wget/zip, downloads and unpacks Maven index data, and copies two metadata files into the final image at /usr/local/etc/maven-index.txt and /usr/local/etc/maven-index.idx. Existing stages remain; final image now contains Maven index metadata.

Changes

Cohort / File(s) Summary
Docker build pipeline
Dockerfile
Introduces index-download stage (installs wget, zip), sets WORKDIR /maven-index-data, downloads/unzips Maven index archive, and copies central.archive-metadata.txt and central.archive-metadata.idx into final image as /usr/local/etc/maven-index.txt and /usr/local/etc/maven-index.idx.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Dev as Docker Build
  participant IDX as index-download Stage
  participant REM as Remote Maven Index
  participant FIN as Final Image

  Dev->>IDX: Build index-download stage
  IDX->>REM: wget Maven index ZIP
  REM-->>IDX: ZIP bytes
  IDX->>IDX: unzip to /maven-index-data

  Dev->>FIN: Build final stage
  FIN->>IDX: COPY central.archive-metadata.txt
  FIN->>IDX: COPY central.archive-metadata.idx
  note over FIN: Files placed at\n/usr/local/etc/maven-index.txt\n/usr/local/etc/maven-index.idx
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • pranavgaikwad
  • eemcmullan
  • aufi

Poem

I hopped through layers, stage by stage,
Fetching Maven’s secrets like a sage.
Two little files, snug where they sit,
Tucked in the image—perfect fit.
Zip, unzip, whiskers twitch—hooray!
Build bunnies ship faster today. 🐇📦

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title clearly summarizes the main change of including the Maven index in the release image by highlighting "Bring in maven index," which aligns with the Dockerfile updates.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f0b6d70 and 37c343d.

📒 Files selected for processing (1)
  • Dockerfile (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build tackle2-addon-analyzer

Comment on lines +29 to +32
RUN microdnf install -y wget zip && microdnf clean all && rm -rf /var/cache/dnf
WORKDIR /maven-index-data
#TODO: get latest release when we get to update them periodically
RUN wget --quiet https://github.com/konveyor/maven-search-index/releases/download/v0.0.1/maven-index-data-v0.0.1.zip -O maven-index-data.zip && unzip maven-index-data.zip && rm maven-index-data.zip
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Install unzip before using it.

The new stage invokes unzip, but UBI’s zip package does not ship the unzip binary, so this layer fails during the build. Install unzip (or both zip unzip) before running the command.

-RUN microdnf install -y wget zip && microdnf clean all && rm -rf /var/cache/dnf
+RUN microdnf install -y wget unzip && microdnf clean all && rm -rf /var/cache/dnf
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
RUN microdnf install -y wget zip && microdnf clean all && rm -rf /var/cache/dnf
WORKDIR /maven-index-data
#TODO: get latest release when we get to update them periodically
RUN wget --quiet https://github.com/konveyor/maven-search-index/releases/download/v0.0.1/maven-index-data-v0.0.1.zip -O maven-index-data.zip && unzip maven-index-data.zip && rm maven-index-data.zip
RUN microdnf install -y wget unzip && microdnf clean all && rm -rf /var/cache/dnf
WORKDIR /maven-index-data
#TODO: get latest release when we get to update them periodically
RUN wget --quiet https://github.com/konveyor/maven-search-index/releases/download/v0.0.1/maven-index-data-v0.0.1.zip -O maven-index-data.zip && unzip maven-index-data.zip && rm maven-index-data.zip
🤖 Prompt for AI Agents
In Dockerfile around lines 29 to 32, the RUN uses the unzip binary but only
installs the zip package (which on UBI doesn't provide unzip); update the RUN
that currently does "microdnf install -y wget zip ..." to include unzip (e.g.,
microdnf install -y wget zip unzip ...) so the unzip command is available, keep
the subsequent microdnf clean and rm -rf /var/cache/dnf as-is to avoid leaving
package cache.

@jmle jmle added the cherry-pick/release-0.8 This PR should be cherry-picked to release-0.8 branch label Oct 17, 2025
RUN microdnf install -y wget zip && microdnf clean all && rm -rf /var/cache/dnf
WORKDIR /maven-index-data
#TODO: get latest release when we get to update them periodically
RUN wget --quiet https://github.com/konveyor/maven-search-index/releases/download/v0.0.1/maven-index-data-v0.0.1.zip -O maven-index-data.zip && unzip maven-index-data.zip && rm maven-index-data.zip
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we keep this up to date are there going to be version bumps?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will have version bumps yeah, but for the moment we are going to stick to the current version. We can grab the latest version and hardcoded here or pass it through an argument in the future.

@shawn-hurley shawn-hurley merged commit 0d792e7 into konveyor:main Oct 24, 2025
10 of 11 checks passed
github-actions bot pushed a commit that referenced this pull request Oct 24, 2025
jmle added a commit to konveyor/analyzer-lsp that referenced this pull request Oct 27, 2025
- Adds search functionality using pre-generated, bundled index
- Removes unneeded functionality:
  - Maven central HTTP sha search
  - Search by list of public groupIds
- `disableMavenSearch` is no longer used - to be removed in a subsequent
PR?
  
Addresses https://issues.redhat.com/browse/MTA-6231
Requires konveyor/java-analyzer-bundle#158
Bundle PR: 158

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added local Maven index lookup and utilities (index entry type and
random-name helper) for resolving Java artifacts.

* **Improvements**
* Dependency extraction, decompilation, and source resolution now use a
configurable Maven index path for more reliable, faster resolution.

* **Removed**
* Removed reliance on open-source dependency label lists and remote
Maven HTTP lookup in resolution flows.

* **Refactor**
* Public interfaces updated to accept and propagate a Maven index path
instead of label-based inputs.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Juan Manuel Leflet Estrada <[email protected]>
github-actions bot pushed a commit to konveyor/analyzer-lsp that referenced this pull request Oct 27, 2025
- Adds search functionality using pre-generated, bundled index
- Removes unneeded functionality:
  - Maven central HTTP sha search
  - Search by list of public groupIds
- `disableMavenSearch` is no longer used - to be removed in a subsequent
PR?

Addresses https://issues.redhat.com/browse/MTA-6231
Requires konveyor/java-analyzer-bundle#158
Bundle PR: 158

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added local Maven index lookup and utilities (index entry type and
random-name helper) for resolving Java artifacts.

* **Improvements**
* Dependency extraction, decompilation, and source resolution now use a
configurable Maven index path for more reliable, faster resolution.

* **Removed**
* Removed reliance on open-source dependency label lists and remote
Maven HTTP lookup in resolution flows.

* **Refactor**
* Public interfaces updated to accept and propagate a Maven index path
instead of label-based inputs.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Juan Manuel Leflet Estrada <[email protected]>
Signed-off-by: Cherry Picker <[email protected]>
dymurray added a commit that referenced this pull request Oct 27, 2025
* Bring in maven index from release (#158)

Signed-off-by: Cherry Picker <[email protected]>

* Add tag to use release-0.8 addon

Signed-off-by: Juan Manuel Leflet Estrada <[email protected]>

* Add api_hub_tests_ref to global CI workflow

Signed-off-by: Dylan Murray <[email protected]>

---------

Signed-off-by: Cherry Picker <[email protected]>
Signed-off-by: Juan Manuel Leflet Estrada <[email protected]>
Signed-off-by: Dylan Murray <[email protected]>
Co-authored-by: Juan Manuel Leflet Estrada <[email protected]>
Co-authored-by: Dylan Murray <[email protected]>
dymurray pushed a commit to konveyor/analyzer-lsp that referenced this pull request Oct 27, 2025
- Adds search functionality using pre-generated, bundled index
- Removes unneeded functionality:
  - Maven central HTTP sha search
  - Search by list of public groupIds
- `disableMavenSearch` is no longer used - to be removed in a subsequent
PR?

Addresses https://issues.redhat.com/browse/MTA-6231
Requires konveyor/java-analyzer-bundle#158
Bundle PR: 166

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added local Maven index lookup and utilities (index entry type and
random-name helper) for resolving Java artifacts.

* **Improvements**
* Dependency extraction, decompilation, and source resolution now use a
configurable Maven index path for more reliable, faster resolution.

* **Removed**
* Removed reliance on open-source dependency label lists and remote
Maven HTTP lookup in resolution flows.

* **Refactor**
* Public interfaces updated to accept and propagate a Maven index path
instead of label-based inputs.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Juan Manuel Leflet Estrada <[email protected]>
Signed-off-by: Cherry Picker <[email protected]>

Signed-off-by: Juan Manuel Leflet Estrada <[email protected]>
Signed-off-by: Cherry Picker <[email protected]>
Co-authored-by: Juan Manuel Leflet Estrada <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-pick/release-0.8 This PR should be cherry-picked to release-0.8 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants