Skip to content

chore: Add script to copy release artifacts to the same staging repo#18747

Merged
yihua merged 2 commits into
apache:masterfrom
yihua:add-script-staging-repo-merging
May 15, 2026
Merged

chore: Add script to copy release artifacts to the same staging repo#18747
yihua merged 2 commits into
apache:masterfrom
yihua:add-script-staging-repo-merging

Conversation

@yihua
Copy link
Copy Markdown
Contributor

@yihua yihua commented May 15, 2026

Describe the issue this Pull Request addresses

During an RC release, jars built with Java 17 (currently the Spark 4 bundle) are deployed to a separate Apache Nexus staging repo from the Java 11 build. To produce a single, consistent staging repo for the vote, the release manager today has to manually download every Java 17 artifact and re-upload it into the Java 11 staging repo, which is tedious and error-prone.

Summary and Changelog

  • Add scripts/release/copy_staging_repo.sh that, given a source and target Nexus staging repo ID, crawls the source repo via the Nexus content API, downloads every artifact, and re-uploads it to the target repo using credentials from ~/.m2/settings.xml (server id apache.releases.https).
    • Supports --dry-run to list artifacts without downloading or uploading.
    • Reports per-file HTTP status and an end-of-run success/failure summary.
  • Update release/release_guide.md step "Deploy maven artifacts and verify" to reference the new script in place of the manual merge instructions.

Impact

Release-only tooling and documentation. No runtime or user-facing change.

Risk Level

none

Documentation Update

Updated release/release_guide.md to document the script.

Contributor's checklist

  • Read through contributor's guide
  • Enough context is provided in the sections above
  • Adequate tests were added if applicable

Copy link
Copy Markdown
Contributor

@hudi-agent hudi-agent left a comment

Choose a reason for hiding this comment

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

🤖 This review was generated by an AI agent and may contain mistakes. Please verify any suggestions before applying.

Thanks for the docs update! The new instructions clearly explain how to use copy_staging_repo.sh to consolidate Java 17 and Java 11 artifacts into a single Nexus staging repo, and the dry-run-first guidance is helpful. A couple of small clarifications around verification ordering and execution context would make the steps even safer for release managers — please defer to a Hudi committer or PMC member for the final call.

Comment thread release/release_guide.md
./scripts/release/copy_staging_repo.sh <java17-repo-id> <java11-repo-id> 2>&1 | tee -a "/tmp/${RELEASE_VERSION}-${RC_NUM}.copy_staging.log"
```
4. The script reads Nexus credentials from `~/.m2/settings.xml` (server id `apache.releases.https`), downloads
every artifact from the source repo, and re-uploads them to the target repo. After it finishes, drop the
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.

🤖 It might help to explicitly instruct the release manager to verify that all artifacts have landed in the Java 11 staging repo (e.g., by spot-checking in the Nexus UI or relying on the end-of-run success summary) before dropping the Java 17 staging repo. As written, the step sequences "run the copy" → "drop the Java 17 repo" → "review all staged artifacts" (step 6), so if the copy silently missed something, the source artifacts would already be gone when the review happens.

- AI-generated; verify before applying. React 👍/👎 to flag quality.

Comment thread release/release_guide.md
2. First do a dry-run to verify the list of artifacts to be copied:
```shell
./scripts/release/copy_staging_repo.sh --dry-run <java17-repo-id> <java11-repo-id>
```
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.

🤖 Since both invocations use a relative path (./scripts/release/copy_staging_repo.sh), it could clarify that the commands should be run from the repository root, consistent with the convention used elsewhere in the guide.

- AI-generated; verify before applying. React 👍/👎 to flag quality.

Comment thread release/release_guide.md
5. Note that the artifacts from Java 17 build are uploaded to a separate staging repo. Use the
`copy_staging_repo.sh` script to copy all artifacts from the Java 17 staging repo into the Java 11 staging repo
so that all artifacts stay in the same repo.
1. Identify both staging repo IDs from [Apache Nexus Staging Repositories](https://repository.apache.org/#stagingRepositories)
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.

🤖 Worth confirming: does the script require the target (Java 11) staging repo to be in the "open" state as well? The note says "Make sure both repos are still in the 'open' state (not closed)" — if Nexus rejects uploads to a closed repo, it might be useful to mention what error the user would see, or whether the script surfaces a clear message in that case.

- AI-generated; verify before applying. React 👍/👎 to flag quality.

@github-actions github-actions Bot added the size:M PR with lines of changes in (100, 300] label May 15, 2026
@yihua yihua added this to the release-1.2.0 milestone May 15, 2026
Copy link
Copy Markdown
Member

@voonhous voonhous left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Contributor

@hudi-agent hudi-agent left a comment

Choose a reason for hiding this comment

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

🤖 This review was generated by an AI agent and may contain mistakes. Please verify any suggestions before applying.

Thanks for the docs update! The new step clearly walks through using copy_staging_repo.sh with a dry-run first, which is a nice improvement over the manual download/upload flow. Two concerns worth a look: the instruction to drop the Java 17 staging repo immediately after the copy (before the verification steps that follow) is irreversible if the copy was incomplete, and the doc could clarify whether the script also copies the .asc signatures and .md5/.sha1 checksums required for the release vote. Please defer to a Hudi committer or PMC member for final review.

Comment thread release/release_guide.md
```
4. The script reads Nexus credentials from `~/.m2/settings.xml` (server id `apache.releases.https`), downloads
every artifact from the source repo, and re-uploads them to the target repo. After it finishes, drop the
Java 17 staging repo on Apache Nexus.
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.

🤖 Dropping the Java 17 staging repo right after the copy script finishes is irreversible — if any artifact failed to upload (or if signatures/checksums are missing), the original source is gone. This step could direct the release manager to first complete the verification in step 6 (confirming the Java 11 repo contains all expected artifacts, including .asc/.md5/.sha1 files for each jar/pom) and only then drop the Java 17 repo.

- AI-generated; verify before applying. React 👍/👎 to flag quality.

Comment thread release/release_guide.md
3. Then run the actual copy:
```shell
./scripts/release/copy_staging_repo.sh <java17-repo-id> <java11-repo-id> 2>&1 | tee -a "/tmp/${RELEASE_VERSION}-${RC_NUM}.copy_staging.log"
```
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.

🤖 It might help to clarify what the script considers an "artifact" — specifically, does it also copy the accompanying .asc signature files and .md5/.sha1 checksum files that Apache releases require? If not, the resulting Java 11 staging repo would fail signature verification during the vote. Worth calling out explicitly in the doc (or confirming the script handles them).

- AI-generated; verify before applying. React 👍/👎 to flag quality.

@hudi-bot
Copy link
Copy Markdown
Collaborator

CI report:

Bot commands @hudi-bot supports the following commands:
  • @hudi-bot run azure re-run the last Azure build

@yihua yihua force-pushed the add-script-staging-repo-merging branch from fea7a23 to da5a87e Compare May 15, 2026 20:26
@yihua yihua force-pushed the add-script-staging-repo-merging branch from da5a87e to 0cb543e Compare May 15, 2026 20:28
@yihua yihua force-pushed the add-script-staging-repo-merging branch from 0cb543e to d4a4a52 Compare May 15, 2026 20:29
@yihua yihua merged commit 21cc7c6 into apache:master May 15, 2026
19 of 62 checks passed
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 54.00%. Comparing base (ce1f5f0) to head (d4a4a52).
⚠️ Report is 6 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master   #18747      +/-   ##
============================================
- Coverage     54.01%   54.00%   -0.01%     
+ Complexity    12461    12457       -4     
============================================
  Files          1434     1434              
  Lines         72161    72161              
  Branches       8245     8245              
============================================
- Hits          38979    38974       -5     
- Misses        29686    29690       +4     
- Partials       3496     3497       +1     
Flag Coverage Δ
hadoop-mr-java-client 45.01% <ø> (-0.01%) ⬇️
spark-client-hadoop-common 48.32% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M PR with lines of changes in (100, 300]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants