Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Discussion: how to handle SPDX Spec version 3 dot releases

未关闭
#390 11 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
30/100
Issue 类型
功能
描述清晰度
需要澄清
活跃度
冷清
技术栈
java
领域
backend

调研方向

首先审查 spdx-model-to-java 代码生成器,以及该库目前如何处理 SPDX 2 规范版本。比较四种提议的 package 和 interface 方案,包括 enum 兼容性和先前版本的验证;当维护者就应如何表示 SPDX 3 的点版本达成决定时,即视为完成。

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

描述

enhancement

Adding support for the SPDX 3.1 release will require an update to spdx-model-to-java code generator to support multiple dot releases of the spec.

The simplest approach would be to just add another package specific to the dot release (e.g. org.spdx.library.model.v3_1).

This, however, will require all applications that access the model through Java update their imports to the new version - including the utilities in this library.

Since dot releases are backwards compatible, we could create a package which is always the "latest" - this is similar to how we treat the SPDX 2 spec versions.

I can think of a few specific alternatives:

  1. Just produce the latest version and drop support for earlier dot releases
  2. Produce one package per dot release
  3. Produce one package per dot release plus a "latest" package (e.g. org.spdx.library.model.v3_latest)
  4. Use interfaces rather than class hierarchies and use multiple interfaces and an interface hierarchy to create a common interface that would work across all versions

In looking into 4, I ran into problems with the enums since you can not extend the enum classes and there is no straightforward way that I could find to support a compatible enum class that allows extensions for later dot releases (e.g. adding additional relationship types). 4 is also the most complex and involved solution.

Implementing 3 would be straightforward and I believe will support most use cases.

2 has the issue of requiring code updates on every release to change the imports.

1 doesn't support validating previous versions.

主要语言
Java
星标
71
派生
44
平均合并
16 小时 17 分钟
30 天内合并 PR
9

环境准备

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

从这里开始

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

spdx/Spdx-Java-Library 的其他 Issue

查看 spdx/Spdx-Java-Library 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

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