From c7266ae70825ab393f0dbf280e511abac365d7f5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 27 Aug 2026 17:53:06 +0000 Subject: [PATCH 1/5] Bump actions/setup-java from 5 to 6 Bumps [actions/setup-java](https://github.com/actions/setup-java) from 5 to 6. - [Release notes](https://github.com/actions/setup-java/releases) - [Commits](https://github.com/actions/setup-java/compare/v5...v6) --- updated-dependencies: - dependency-name: actions/setup-java dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/mvn.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mvn.yml b/.github/workflows/mvn.yml index 9541e6c..b1b036c 100644 --- a/.github/workflows/mvn.yml +++ b/.github/workflows/mvn.yml @@ -22,7 +22,7 @@ jobs: restore-keys: | ${{ runner.os }}-maven- - name: Set up JDK - uses: actions/setup-java@v5 + uses: actions/setup-java@v6 with: java-version: '17.0.4+8' distribution: 'adopt' From fe67f6e13dde08080bf4156b0480f694c72659f0 Mon Sep 17 00:00:00 2001 From: Denis Yuen Date: Fri, 18 Sep 2026 11:16:10 -0400 Subject: [PATCH 2/5] Add CLAUDE.md guidance for this repository Documents the OpenAPI codegen build pipeline and generated package layout, and adopts the generic PR/branching/dependency conventions from dockstore/dockstore's CLAUDE.md (adjusted for this repo's actual main-only branching model). Co-Authored-By: Claude Sonnet 5 --- CLAUDE.md | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..116cc79 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,103 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Project overview + +A generated Java client for Zenodo's second-generation (InvenioRDM) API. The client code itself is **not +hand-written** — it is generated at build time from the upstream OpenAPI spec at +https://github.com/inveniosoftware/invenio-openapi/blob/master/docs/openapi.yaml via the +`swagger-codegen-maven-plugin`. This repo only contains the Maven build configuration plus a couple of +small example/scaffold files under `src/`. + +Reference docs: +- Zenodo/InvenioRDM REST API list: https://inveniosoftware.github.io/invenio-openapi/ +- REST API documentation: https://inveniordm.docs.cern.ch/reference/rest_api_index/ + +## Common commands + +Always invoke the Maven wrapper (`./mvnw`), never a system-installed `mvn`, so builds use the project's +pinned Maven version. + +```bash +./mvnw clean install # full build: downloads spec, generates client, compiles, tests, installs +./mvnw clean install -DskipTests # skip tests +./mvnw test -Dtest=ZenodoClientTest # run a single test class +``` + +CI (`.github/workflows/mvn.yml`) runs `./mvnw -B -ntp clean install` on every push, on Ubuntu with JDK 17. + +There is no separate lint/checkstyle gate for day-to-day work: checkstyle and spotbugs are configured but +set to `skip`/`failOnError=false` for the generated sources, since generated code is not expected to +conform to project style. + +## Build / code generation architecture + +The build pipeline (all driven from the single `pom.xml`, no parent POM) works as follows: + +1. **`swagger-codegen-maven-plugin`** (v3.0.71, `generate` goal) fetches the OpenAPI spec directly from the + `inveniosoftware/invenio-openapi` GitHub repo (`inputSpec` is a raw GitHub URL — network access is + required to build) and generates a `jersey2`-based Java client into + `target/generated-sources/swagger/src/main/java`. + - Generated models go in `io.openapi.invenio.model`, generated API classes in `io.openapi.invenio.api` + (configured via `configOptions.modelPackage` / `configOptions.apiPackage`). + - Each Invenio resource/tag becomes its own `*Api` class (e.g. `RecordsApi`, `DraftsApi`, `CommunitiesApi`, + `AccessApi`, `UsersApi`, `VocabulariesApi`, etc.) — there is no single "Zenodo client" facade class. +2. **`replacer` plugin** post-processes the generated sources to rewrite `javax.*` imports to `jakarta.*` + (`javax.annotation` → `jakarta.annotation`, `javax.ws` → `jakarta.ws`, etc.), because the swagger-codegen + templates still emit `javax` even though the project depends on the `jakarta.*` Jersey 3 stack. +3. **`build-helper-maven-plugin`** adds `target/generated-sources` (the codegen output) as a compiled source + root, alongside the hand-written `src/main/java` and `src/test/java`. +4. **`flatten-maven-plugin`** writes a flattened POM to `generated/src/main/resources/pom.xml` (used for + downstream publishing; not something to hand-edit). +5. HTTP transport is Jersey (`jersey-client`, `jersey-media-multipart`, `jersey-media-json-jackson`); JSON + via Jackson (including `jackson-datatype-jsr310` for date/time and `jackson-dataformat-xml`). + +Because the client is generated fresh from the upstream spec on every build, do not hand-edit anything +under `target/generated-sources/**` — those changes will be discarded. If the generated API surface needs +to change, either wait for an upstream spec update or adjust the `configOptions`/plugin config in `pom.xml`. + +## Hand-written code + +- `src/main/java/io/dockstore/EntryCreatorExample.java` — a worked example (currently entirely commented + out, pending the generated classes being wired up) showing the intended usage pattern: create a + `DepositsApi`/`FilesApi`/`ActionsApi` deposit-and-publish flow against Zenodo (`sandbox.zenodo.org` or + `zenodo.org`), including setting metadata, creators, and related identifiers, then publishing and + versioning a deposit. +- `src/test/java/io/dockstore/ZenodoClientTest.java` — corresponding test scaffold (also commented out). + +Both files predate/anticipate the new Invenio-generated client (`io.openapi.invenio.*`) and still reference +older `io.swagger.zenodo.client.*` types from a previous codegen setup — treat them as a guide to intended +usage, not working code, until updated to the current generated package names. + +## Dependency management + +Dependency versions are managed via the `io.dockstore:bom-internal` BOM (imported in +`dependencyManagement`), pulled from the OICR Artifactory repo (`artifacts.oicr.on.ca`). When adding a new +dependency already covered by the BOM, omit the ``. + +When a need could be met more than one way, prefer, in order: (1) built-in Java features, (2) a +third-party library already pulled in via Maven elsewhere in the project, (3) a new third-party +dependency — only reach for a new one when neither of the above covers the need. + +## Branching + +Unlike some other Dockstore repos, this one does not use a `develop`/`main` Hubflow split in practice: +`main` is the default branch and PRs (including dependabot bumps) merge directly into it. A stale +`develop` branch exists but isn't the integration target — base new branches/PRs on `main`. + +## Pull requests + +When creating a PR, always create it in draft mode. A human developer must be the one to mark it ready +for review/move it out of draft state — Claude Code should not do this itself. + +Keep the freeform "Description" and "Review Instructions" sections of `.github/PULL_REQUEST_TEMPLATE.md` +brief — one paragraph each, or two for a genuinely complicated fix. The "Security and Privacy" checklist +section is separate and must be copied into the PR description verbatim — never reword, reformat, +condense, or append explanatory text to a checklist item. Only toggle `[ ]` to `[x]` for an item, and only +after actually confirming that action was taken/verified for this PR; leave it unchecked otherwise. + +## JIRA + +When adding comments to JIRA tickets, clearly indicate that the comment was written by Claude (e.g. lead +with a line like "This comment was generated by Claude (Claude Code)."). From 0921ed1a41a91c1ea1c29a8e3b7ac9855f500b70 Mon Sep 17 00:00:00 2001 From: Denis Yuen Date: Fri, 18 Sep 2026 11:20:14 -0400 Subject: [PATCH 3/5] Fix CI: use temurin distribution for setup-java@v6 actions/setup-java@v6 (this branch's dependabot bump) dropped support for the 'adopt' distribution alias, failing "Set up JDK" with "No supported distribution was found for input adopt". Switch to 'temurin', matching the fix applied in dockstore/swagger-java-zenodo-client#40. Co-Authored-By: Claude Sonnet 5 --- .github/workflows/mvn.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mvn.yml b/.github/workflows/mvn.yml index b1b036c..a0fdbf8 100644 --- a/.github/workflows/mvn.yml +++ b/.github/workflows/mvn.yml @@ -25,6 +25,6 @@ jobs: uses: actions/setup-java@v6 with: java-version: '17.0.4+8' - distribution: 'adopt' + distribution: 'temurin' - name: Build with mvn run: ./mvnw -B -ntp clean install \ No newline at end of file From a5b188db3843e33d7a1aabd0822c02446dad33a7 Mon Sep 17 00:00:00 2001 From: Denis Yuen Date: Fri, 18 Sep 2026 11:21:39 -0400 Subject: [PATCH 4/5] Bump CI JDK to 21.0.10+7.0.LTS Matches dockstore/swagger-java-zenodo-client#40's fix: run the build on a current JDK 21 via temurin, while pom.xml still targets bytecode release 17 (maven-compiler-plugin's 17). Co-Authored-By: Claude Sonnet 5 --- .github/workflows/mvn.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mvn.yml b/.github/workflows/mvn.yml index a0fdbf8..67872f8 100644 --- a/.github/workflows/mvn.yml +++ b/.github/workflows/mvn.yml @@ -24,7 +24,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v6 with: - java-version: '17.0.4+8' + java-version: '21.0.10+7.0.LTS' distribution: 'temurin' - name: Build with mvn run: ./mvnw -B -ntp clean install \ No newline at end of file From 6f6e53fafd585a41490b269338c84b3b736dfa9d Mon Sep 17 00:00:00 2001 From: Denis Yuen Date: Fri, 18 Sep 2026 11:22:42 -0400 Subject: [PATCH 5/5] Bump compiler release to 21 to match CI JDK pom.xml's maven-compiler-plugin was still targeting release 17 after bumping the CI JDK to 21.0.10+7.0.LTS. Bump to 21 to match. ./mvnw clean install verified locally on JDK 21. Co-Authored-By: Claude Sonnet 5 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 81a2cd4..d9729dd 100644 --- a/pom.xml +++ b/pom.xml @@ -104,7 +104,7 @@ maven-compiler-plugin 3.10.1 - 17 + 21 true true