Maven patches can only be delivered as the main jar: hpi, aar, war and typed dependencies have no path

未关闭
#2,202 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
20/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
rust
领域
cli

调研方向

Start with the type check in crates/socket-patch-core/src/patch/redirect/mod.rs, which refuses any Maven type other than jar, and the handling of non-jar types in crates/socket-patch-core/src/formats/maven/mod.rs. The issue lists three options, from failing loudly on non-main-jar targets to carrying the file extension through the rewriter and handling nested jars in .hpi and .aar files. Done means a maintainer has chosen one option, and that choice is reflected in the refusal warnings or the served tree. The issue is a design question, so settle the scope with maintainers before writing code.

由索引模型根据 Issue 内容生成。

描述

agent:triaged priority:p3

[agent] Filed after a read-only review of the CLI source at 02add9be (main). Nothing was executed; the claims below come from reading the code.

Summary

A Maven patch can be delivered only as the main <artifactId>-<version>.jar. Artifacts whose users consume another file have no working path in hosted or vendored mode, and only a partial one in agent mode:

Artifact kind What users run Agent mode Hosted / vendored
Jenkins plugin (hpi/jpi) classes inside the .hpi, under WEB-INF/lib/<artifactId>.jar the companion <artifactId>-<version>.jar in the cache can be patched; the .hpi copy Jenkins loads is not addressed a dependency with <type>hpi</type> is refused; the served tree holds only .jar and .pom
Android library (aar) classes.jar inside the .aar, and the copy Gradle extracts into its transforms cache an .aar is treated as an opaque archive; the nested classes.jar and the extracted copy are not patched; a version directory that holds only an .aar is not discovered <type>aar</type> is refused, and Android Gradle builds are refused as a whole
war, or a dependency that declares <type>bundle</type> the typed file not checked here refused: the rewriter accepts only jar (and pom)

The refusals are warnings on a skipped dependency, so a project can look patched while the file that runs is unchanged. For Jenkins that means a patched compile class path and an unpatched running controller.

Where

  • Hosted Maven accepts a <type> only when it is jar: crates/socket-patch-core/src/patch/redirect/mod.rs (if typ != "jar"), and crates/socket-patch-core/src/formats/maven/mod.rs treats any other non-empty type as not redirectable.
  • No code path looks inside a nested archive for a class-level record (WEB-INF/lib/*.jar in an .hpi, classes.jar in an .aar); a search of crates/socket-patch-core/src finds no handling of either layout.
  • This is separate from #1069 (upstream files fetched only from Maven Central), which also affects these artifacts because most of them are published in other repositories.

What would close it

Any one of these, in order of size:

  1. State the limit and fail loudly: refuse a patch whose target is not a main jar with a named code, and say in the scan output that the runtime copy of a Jenkins plugin or an Android library is not covered.
  2. Carry the artifact's file extension from the patch record into the rewriter and the served tree, so a typed dependency whose file is in fact a jar (bundle) or a whole-file replacement (hpi, aar, war) can be redirected.
  3. Cover the nested copies: a record that names the nested jar member of an .hpi or the classes.jar of an .aar, and detection of Gradle's extracted copies.

Context: the patch service is starting to build patches for artifacts published outside Maven Central (Jenkins, XWiki, Google's Maven repository). Plain jars from those repositories are found and patched by coordinates today, whatever repository they came from; this issue is about the other packaging kinds.

主要语言
Rust
星标
9
派生
2
平均合并
1 天 8 小时
30 天内合并 PR
309

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

SocketDev/socket-patch 的其他 Issue

查看 SocketDev/socket-patch 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。