Add support for mutable branches (not recommended)
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- java
- 领域
- build-system
调研方向
从 BlowdryerSetup API 以及现有的 GitHub、GitLab 和 Bitbucket 锚点解析路径开始。跟踪 GitAnchorType 和锚点值的解析方式,然后确定如何让分支查找保持在 setup 块内。通过提议的 API 支持可变分支,且不改变下游资源处理或现有不可变模式,即表示完成。
由索引模型根据 Issue 内容生成。
描述
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
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
diffplug/blowdryer 的其他 Issue
-
enhancement
难度 5/5 一周以上 新手友好度 25/100
-
enhancement pr-welcome
难度 5/5 一周以上 新手友好度 30/100
-
enhancement pr-welcome
难度 5/5 一周以上 新手友好度 25/100
-
blowdryerInline未关闭enhancement pr-welcome
难度 5/5 一周以上 新手友好度 35/100
查看 diffplug/blowdryer 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 75/100
521xueweihan/HelloGitHub#4105 ·
-
Awaiting further input from submitter
难度 2/5 1-3 小时 新手友好度 76/100
-
bug
难度 2/5 1-3 小时 新手友好度 82/100
-
Regression in 5.9.0: CuratorCache fails with ClassCastException when the client is not a CuratorFrameworkBase可能已有人在做 @sftwnd 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
-
bug
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复