Live data from Hacker News

Show HN: How to Get Started with Continuous Integration

fire.ci

1–10 of 23 posts

Re: Show HN: How to Get Started with Continuous Integration

#2
> Most Continuous Integration tools run the CI build on your branch to say if it can be merged or not. But that is not what is of interest here. If you know what you’re doing there is a pretty good chance that the code you have just pushed is working already! > Your CI tool should perform a local merge of your branch to the main branch and run the build and tests against that.

100% this - I've never seen it written down anywhere so concisely before! What's the point in CI running automated tests on only your changes, when you have already done so locally? If you are pushing your changes just to get your unit test results (and code formatting checks etc), you are doing it wrong! :) merging it first makes much more sense / has much more value.

Re: Show HN: How to Get Started with Continuous Integration

#4
post #2

> Most Continuous Integration tools run the CI build on your branch to say if it can be merged or not. But that is not what is of interest here. If you know what you’re doing there is a pretty good chance that the code you have just pushed is working already! > Your CI tool should perform a local merge of your branch to the main branch and run the build and tests against that. 100% this - I've never seen it written d…

Our CI is setup to merge into a local copy the source branch and then build. Devs are encouraged to regularly pull & the latest source branch changes to reduce the chance of their own integration failing.

Re: Show HN: How to Get Started with Continuous Integration

#5
post #2

> Most Continuous Integration tools run the CI build on your branch to say if it can be merged or not. But that is not what is of interest here. If you know what you’re doing there is a pretty good chance that the code you have just pushed is working already! > Your CI tool should perform a local merge of your branch to the main branch and run the build and tests against that. 100% this - I've never seen it written d…

For me the right way is never to allow non-ff merges and instead require all changes to be integrated into your branch (either via rebase or merge from base into your branch) before merging. GitLab supports this flow nicely and it has been wonderful for ensuring that the resulting product passes tests.

Re: Show HN: How to Get Started with Continuous Integration

#6
post #2

> Most Continuous Integration tools run the CI build on your branch to say if it can be merged or not. But that is not what is of interest here. If you know what you’re doing there is a pretty good chance that the code you have just pushed is working already! > Your CI tool should perform a local merge of your branch to the main branch and run the build and tests against that. 100% this - I've never seen it written d…

> ci runs tests on merged code and says its ok

> main branch moves ahead now merged code doesn't pass tests.

> ci still says merged code is good to go

> user performs merge

> main branch is broken

Re: Show HN: How to Get Started with Continuous Integration

#7
post #5
post #2

> Most Continuous Integration tools run the CI build on your branch to say if it can be merged or not. But that is not what is of interest here. If you know what you’re doing there is a pretty good chance that the code you have just pushed is working already! > Your CI tool should perform a local merge of your branch to the main branch and run the build and tests against that. 100% this - I've never seen it written d…

For me the right way is never to allow non-ff merges and instead require all changes to be integrated into your branch (either via rebase or merge from base into your branch) before merging. GitLab supports this flow nicely and it has been wonderful for ensuring that the resulting product passes tests.

what happens if I am waiting for my PR to merged.

I have to keep merging upstream whenever upstream changes?

Some PRs are open for days.

Re: Show HN: How to Get Started with Continuous Integration

#8
post #6
post #2

> Most Continuous Integration tools run the CI build on your branch to say if it can be merged or not. But that is not what is of interest here. If you know what you’re doing there is a pretty good chance that the code you have just pushed is working already! > Your CI tool should perform a local merge of your branch to the main branch and run the build and tests against that. 100% this - I've never seen it written d…

> ci runs tests on merged code and says its ok > main branch moves ahead now merged code doesn't pass tests. > ci still says merged code is good to go > user performs merge > main branch is broken

4th step should not happen. A cool feature I am implementing into fire.ci now is that it will trigger a new build every time the main branch moves forward until the safe merge happens. If you have fast builds I don't expect this to take more than 2 builds each time (or you have a huuuuge team working on the repo). What do you think?

Re: Show HN: How to Get Started with Continuous Integration

#9
post #7
post #5

Earlier quoted context omitted.

For me the right way is never to allow non-ff merges and instead require all changes to be integrated into your branch (either via rebase or merge from base into your branch) before merging. GitLab supports this flow nicely and it has been wonderful for ensuring that the resulting product passes tests.

what happens if I am waiting for my PR to merged. I have to keep merging upstream whenever upstream changes? Some PRs are open for days.

See my comment above: a cool feature I am implementing into fire.ci now is that it will trigger a new build every time the main branch moves forward until the safe merge happens. If you have fast builds I don't expect this to take more than 2 builds each time (or you have a huuuuge team working on the repo).

Re: Show HN: How to Get Started with Continuous Integration

#10
post #6
post #2

> Most Continuous Integration tools run the CI build on your branch to say if it can be merged or not. But that is not what is of interest here. If you know what you’re doing there is a pretty good chance that the code you have just pushed is working already! > Your CI tool should perform a local merge of your branch to the main branch and run the build and tests against that. 100% this - I've never seen it written d…

> ci runs tests on merged code and says its ok > main branch moves ahead now merged code doesn't pass tests. > ci still says merged code is good to go > user performs merge > main branch is broken

>Your CI tool should perform a local merge of your branch to the main branch and run the build and tests against that. Your branch can then be automatically merged if the main branch does not change in the meantime. If it does change, the CI checks should be run again until your code can be safely merged. If your CI tools does not support this kind of workflow, change your tool.
Post reply on HN