Skip to content

Skip staging SAP HANA client JAR if already present in userlib or vendorlib - #916

Merged
mayankmendix merged 4 commits into
mendix:developfrom
Pri1235:feature/sap-hana-skip-duplicate-jar
Sep 21, 2026
Merged

mayankmendix merged 4 commits into
mendix:developfrom
Pri1235:feature/sap-hana-skip-duplicate-jar

Conversation

@Pri1235

@Pri1235 Pri1235 commented Sep 21, 2026

Copy link
Copy Markdown

Checks both model/lib/userlib and model/lib/vendorlib for an existing ngdbc*.jar before downloading. The Mendix runtime scans both directories, so staging a duplicate is unnecessary.

priyal.chawda@mendix.com and others added 2 commits September 21, 2026 13:32
…dorlib

Checks both model/lib/userlib and model/lib/vendorlib for an existing
ngdbc*.jar before downloading. The Mendix runtime scans both directories,
so staging a duplicate is unnecessary.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Extract version from filename (ngdbc-{version}.jar) when an existing JAR
is found in userlib or vendorlib. Falls back to "unknown" if the filename
does not include a version (e.g. manually placed jar).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Comment thread buildpack/core/runtime.py Outdated
match = re.search(r"ngdbc-(.+)\.jar", os.path.basename(existing[0]))
version = match.group(1) if match else "unknown"
logging.info(
"SAP HANA client JAR version [%s] already present at [%s], skipping download",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Parsing version is not needed. Just loggin the found file name should be enough.

Comment thread buildpack/core/runtime.py Outdated

model_lib = os.path.join(build_dir, "model", "lib")
for lib_dir in ("userlib", "vendorlib"):
existing = glob.glob(os.path.join(model_lib, lib_dir, "ngdbc*.jar"))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

add a '-' in the search. Make it "ngdbc-*.jar"

priyal.chawda@mendix.com and others added 2 commits September 21, 2026 14:47
- Use ngdbc-*.jar (with dash) in glob to avoid false matches
- Remove version parsing; log just the filename when skipping download

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mayankmendix
mayankmendix merged commit 74618d6 into mendix:develop Sep 21, 2026
26 checks passed
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.

2 participants