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

Add support for mutable branches (not recommended)

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

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
java
领域
build-system

调研方向

从 BlowdryerSetup API 以及现有的 GitHub、GitLab 和 Bitbucket 锚点解析路径开始。跟踪 GitAnchorType 和锚点值的解析方式,然后确定如何让分支查找保持在 setup 块内。通过提议的 API 支持可变分支,且不改变下游资源处理或现有不可变模式,即表示完成。

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

描述

enhancement

Blowdryer supports GitHub, GitLab, and Bitbucket in the following modes: COMMIT, TAG, and optionally TREE. The key property these modes share is that they are immutable. Blowdryer can compute the URL for any of these resources without making a network call, and once it has downloaded that URL, Blowdryer will never need to request it again. Immutable builds are a good practice, they let Blowdryer support fully offline builds, and it's a performance improvement as well.

Rather than basing your build on links to immutable scripts, you could base them instead on mutable scripts, e.g.

blowdryerSetup {
  github('acme/blowdryer-acme', 'branch', 'master')

The advantage of this would be that as the scripts in master improved, all of the builds which rely on them will also improve. But the downside is that your builds will no longer be reproducible. If you check out an old commit, the scripts at blowdryer-acme branch master might have changed, and so the build results will change. This will make it very difficult to track down regressions, because you can't tell if the changes came from the repo you're looking at, or from the repo you're pointing to from blowdryer.

build = f(repo) is easy to work with. Pointing to a mutable branch changes that to build = f(repo, current_time)

But I want to do it anyway

I am pretty sure this is a bad idea, but if you want to do it, I am happy to merge a PR which adds support for mutable branches. If you make such a PR, it should be implemented roughly along these lines:

public class BlowdryerSetup {
  ..
  public enum GitAnchorType { TAG, COMMIT, TREE } // no new branch mode

  public class GitHub {
      String anchor;
      GitAnchorType anchorType;
      ...
      public GitHub branchBuildNotReproducible(String branch) {
        anchorType = GitAnchorType.COMMIT;
        anchor = networkRequestLookupCommitSha(branch);
        return this;
      }
    }

And the usage would be

blowdryerSetup {
  github('acme/blowdryer-acme', 'TAG', 'UNUSED').branchBuildNotReproducible('master')

Basically, if you want to bring mutability into blowdryer, it should all be resolved within the blowdryerSetup block, so that the mutability doesn't ripple throughout the system.

主要语言
Java
星标
29
派生
6
PR 合并指标
30 天内没有已合并 PR

环境准备

从这里开始

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

diffplug/blowdryer 的其他 Issue

查看 diffplug/blowdryer 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

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