已删除项目继续从管理员列表和详情中隐藏。

删除后,同一 GitHub 来源可通过“新建迁移”重新拉取,生成新的项目、任务和仓库。
旧任务的“重试迁移”保持原有校验。
This commit is contained in:
lxp
2026-10-29 17:37:44 +08:00
parent bec48bb3ea
commit 37d88683b0
9 changed files with 233 additions and 23 deletions
@@ -19,13 +19,19 @@ public final class ProjectCodes {
}
public static String github(long repositoryId) {
return github(repositoryId, 0);
}
/** 同一来源删除后重新迁移时使用新一代编码,避免复用旧项目及其仓库、资源。 */
public static String github(long repositoryId, long generation) {
if (repositoryId <= 0) throw new IllegalArgumentException("GitHub 仓库 ID 必须为正数");
if (generation < 0) throw new IllegalArgumentException("迁移代次不能为负数");
String seed = generation == 0 ? "github-import:v1:" + repositoryId
: "github-import:v2:" + repositoryId + ":" + generation;
try {
byte[] hash =
MessageDigest.getInstance("SHA-256")
.digest(
("github-import:v1:" + repositoryId)
.getBytes(StandardCharsets.UTF_8));
.digest(seed.getBytes(StandardCharsets.UTF_8));
StringBuilder code = new StringBuilder(12);
for (int i = 0; i < 12; i++) {
int offset = i * 5;