TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

A Continuous Integration Mystery

31 pointsby basicallydanover 4 years ago

8 comments

orfover 4 years ago
&gt; Should CI create a merged branch behind-the-scenes and run tests on that before allowing the branch to be merged?<p>This is surprisingly difficult to get right, especially with projects with lots of concurrent changes. Gitlab merge trains[1] really help here.<p>1. <a href="https:&#x2F;&#x2F;docs.gitlab.com&#x2F;ee&#x2F;ci&#x2F;merge_request_pipelines&#x2F;pipelines_for_merged_results&#x2F;merge_trains&#x2F;" rel="nofollow">https:&#x2F;&#x2F;docs.gitlab.com&#x2F;ee&#x2F;ci&#x2F;merge_request_pipelines&#x2F;pipeli...</a>
评论 #25313913 未加载
评论 #25313363 未加载
评论 #25313642 未加载
评论 #25313502 未加载
评论 #25309361 未加载
评论 #25309667 未加载
kiallmacinnesover 4 years ago
The issue is with how GitHub (and most PR &#x2F; CI systems...) relies on stale CI results.<p>Master&#x2F;Main changed between the tests running for that PR, and it merging. Why should those test results be considered a useful indicator for what happens after the PR merges anymore?<p>GitHub does have a setting you can enable to help with this, essentially, when any PR merges, it forces the developer to rebase any open PRs. A huge waste of effort, so nobody turns it in.<p>There are far better systems out there, e.g. zuul-ci.org which was designed to handle this exact problem at scale. Others have mentioned GitLab merge trains, though I&#x27;ve never used them - so hard to tell if they really solve this :)
analogjover 4 years ago
You can actually clone&#x2F;checkout a &quot;merged&quot; PR provided by Github:<p>git checkout --force refs&#x2F;remotes&#x2F;pull&#x2F;119&#x2F;merge<p>They generate it async behind the scenes, so it may not be immediately available after your PR is opened, and changes to master may be delayed.
评论 #25313373 未加载
iabover 4 years ago
Maybe the difference is whether you consider each atom to be a releasable candidate, or is there is another release layer (a-la good old “a successful git branching model”)
rubatugaover 4 years ago
I’m confused because this isn’t stated clearly in the comments, but shouldn’t you create a merge commit (for the feature branch) that combines both master and feature branch code before running the tests? And then change master to point to your newly created merge commit once tests pass?
choegerover 4 years ago
Actually one should treat changes as totally ordered <i>before</i> merging them.<p>But that brings a choke point into your workflow:<p>* Change A developed and good for master<p>* Change B developed and good for master<p>* Change A merged into master<p>* Change B not good for master any more, gets pushed back<p>* Change C developed and good for master<p>* ...<p>In principle, a change can be put back forever, depending on your practical situation.
评论 #25313923 未加载
timzamanover 4 years ago
You could use a merge queue, that does an rebase on latest master, then tests your code and merges.
评论 #25315855 未加载
ianlevesqueover 4 years ago
Another point in favor of rebase not merge.
评论 #25315845 未加载