News for hackers. Stuff that matters.
Re:The End of CI by cntainer on Sunday July 03, 2022 @02:49AM (#31965653)
I fail to see the point being made in the article. CI done right is the best thing that ever happened to me in terms of collaborative productivity.

Of course there are many pitfalls. Like with any tool it becomes trivial to use it wrong. Integrating less than once per day and deferring all testing and linting to the CI process is an anti-pattern and the issue is not the CI process but how the team chooses to use it.

For example I worked in a team of 10 and we were doing multiple production deploys per day. This was made possible by a great CI workflow. Everyone was running tests precommit and focusing on keeping the pipeline green. Yes I've seen the opposite as well, but that usually is a symptom of issues with the team not the general concept of CI.

Not saying that there isn't room for improvement but all the real-time collaboration features I used on low-code platforms feel like a step back.

Re:The End of CI by adalarmed on Sunday July 03, 2022 @03:37AM (#31965866)
> deferring all testing and linting to the CI process is an anti-pattern

I'm confused as to why this is an anti-pattern? My understanding is that the CI pipeline should run unit tests and linting for every commit. But at the same time, developers should run their tests before pushing code.

Re:The End of CI by cntainer on Sunday July 03, 2022 @04:34AM (#31966127)
Emphasis on all :).

Of course the CI should always run them, but that should normally be as a confirmation/safeguard.

I've seen too many cases where the devs wouldn't even run the code locally. They would push it and expect the CI to do all the work. That's how you get shitty CI that is always broken.

Re:The End of CI by thiht on Sunday July 03, 2022 @06:29AM (#31966611)
That’s why you use branches though. You can break the CI on your own branch as much as you want, it’s nobody’s business. But a broken CI on a dev branch MUST prevent merging to a release branch.

If you allow devs to push directly on release branch, thus breaking the CI, you’re absolutely doing it wrong.

Re:The End of CI by cntainer on Sunday July 03, 2022 @09:24AM (#31967536)
Well, I believe "absolutely doing it wrong" is a bit strong-worded.

Of course you can do it like you said but that means longer feedback loops in general. If the team wants to integrate more often and reduce feedback loops then that model evolves.

I'll give you an example. In the team I mentioned in my top comment we were initially using a branching model with master, releases/, hotfixes/, dev, features/, which gradually evolved into master, dev, features/, which finally ended up as master, features/*. With the important mention that for small changes/fixes that needed to get deployed quickly nobody would bother with a branch they would just push to master.

This allowed us multiple production deploys per day per developer with no risk. That's why I said I don't get the point of the article, you can absolutely get those short feedback loops and continuous integration if you want it, just need to setup the process that way.

Re:The End of CI by thiht on Sunday July 03, 2022 @11:18AM (#31968348)
> Of course you can do it like you said but that means longer feedback loops in general. If the team wants to integrate more often and reduce feedback loops then that model evolves.

Longer feedback loops =/= long feedback loops. You can definitely wait 5 to 10 minutes if it means doing it right.

> With the important mention that for small changes/fixes that needed to get deployed quickly nobody would bother with a branch they would just push to master.

From my experience, the 1-2 lines fixes are the ones that benefit the most from automated CI because you’re doing it in a rush. In my team just last week a junior dev asked us to review their PR quickly because it was just 2 lines, and it didn’t even compile. We told them to be more careful in the future, but in the end it didn’t impact anything. It couldn’t possibly have impacted anything thanks to CI, it just makes it impossible to fuck up too recklessly.

Re:The End of CI by cassianoleal on Sunday July 03, 2022 @08:04AM (#31967079)
The TBD [0] crowd disagrees with you.

I agree with you though.

Not that I don't see the value proposed by TBD, but I think you can have >90% of said value and none of the downsides using a well thought out branching strategy.

[0] Trunk-Based Development: https://trunkbaseddevelopment.com/

Re:The End of CI by liuliu on Sunday July 03, 2022 @09:16AM (#31967476)
TBD doesn't mean you have a red CI main branch. Of course it is always green on main. It means you have short lived feature branch and rely on runtime checks for feature gating. A broken main will halt TBD. You are mischaracterize what TBD is.
Re:The End of CI by smallnix on Sunday July 03, 2022 @08:39AM (#31967252)
From the linked Website:

> Depending on the team size, and the rate of commits, short-lived feature branches are used for code-review and build checking (CI). [...] Very small teams may commit direct to the trunk.

Re:The End of CI by cassianoleal on Monday July 04, 2022 @07:13PM (#31982665)
Indeed. That seems to be a new-ish addition. I'm glad they now admit alternate approaches.
Re:The End of CI by cntainer on Sunday July 03, 2022 @09:34AM (#31967595)
I'm in the "continuously improve the team's process to best suit its needs" crowd.

Sometimes TBD is the answer, sometimes you need something else.

What I did notice is that, with time, mature teams end up simplifying processes in order to reduce friction and increase output.

Re:The End of CI by Merad on Sunday July 03, 2022 @10:21AM (#31967879)
> I've seen too many cases where the devs wouldn't even run the code locally.

Lazy devs are going to be lazy no matter what processes their team uses.

Re:The End of CI by webdog on Sunday July 03, 2022 @11:29AM (#31968444)
From the perspective of the dev, if my local CI isn’t worth anything towards a merge and upstream CI is gospel why run locally? If I’m reasonably certain that the two jobs are duplicative in output it could be seen as wasted time, especially if I have a PM hounding for features. I don’t call that lazy, I call that a trade off. (coming from someone who is constantly running tests locally before pushing upstream)
Re:The End of CI by Merad on Sunday July 03, 2022 @04:53PM (#31970925)
Isn't that slower and less efficient? Usually the CI has to run a full build from scratch before it can run the tests, but locally for me it's going to be an incremental build that takes a second or two. I can also run the subset of tests that I know are affected by my changes to get fast and reasonably reliable feedback vs waiting for CI to run the whole test suite.
Re:The End of CI by charcircuit on Sunday July 03, 2022 @04:27AM (#31966097)
Linters and tests should pass before code is rebased onto master. YOLOing code onto master is an antipattern because if your code breaks the build then you are holding up everyone else from being able to make changes until yours gets reverted. If linters and tests are already passing there is a very good chance the rebase won't break anything.
Re:The End of CI by viraptor on Sunday July 03, 2022 @07:33AM (#31966908)
You can go a step further. Instead of merging anything, you can tell the ci to merge it. Then ci can make a "merge-test" branch, run all the tests on it, and if they pass, then ff-merge it to master for real. No need for "good chance" or rebasing just to keep up with master.

It does take some extra work though, because GH and others don't really support this out of the box.

Re:The End of CI by marcusarmstrong on Sunday July 03, 2022 @08:59AM (#31967371)
Gitlab does support this with “Merged Result pipelines”[0]. We use them extensively alongside their merge train functionality to sequential is everything and it’s fantastic.

[0]: https://docs.gitlab.com/ee/ci/pipelines/merged_results_pipel...

Re:The End of CI by zelos on Sunday July 03, 2022 @10:19AM (#31967864)
Isn’t this the way everyone works? Write code, run some tests/linting locally, then create a PR to master and the CI server runs all the tests and reports pass/fail. Changes without a pass can’t be merged to master.
Re:The End of CI by charcircuit on Sunday July 03, 2022 @03:01PM (#31970080)
The extra step is that once the change is accepted the process of rebasing it or merging it into master is done by a bot that checks if it would break master before preceding to do it.

My issue with this approach is that it becomes tricky to scale since you can only have one job running at a time. Allowing master to potentially break scales better because you can run a job for each commit on master which hasn't been evaluated. Technically you could make that approach work by instead of rebasing onto master rebasing onto the last commit that is being tested, but this adds extra complexity which I don't think standard tooling can easily handle.

Re:The End of CI by viraptor on Sunday July 03, 2022 @05:05PM (#31971029)
> you can only have one job running at a time

https://zuul-ci.org/ and some other systems solve it by optimistic merges. If there's already a merge job running, the next one assumes that will succeed. And tests on merged master + first change + itself. If anything breaks, the optimistic merges are dropped from the queue and everything starts from the second chance only. Openstack uses it and it works pretty well if the merges typically don't fail.

Re:The End of CI by throwaway858 on Sunday July 03, 2022 @03:04PM (#31970108)
This can result in a broken master if there were new commits added to master since the pull request was submitted (but before it is merged).

The solution is to require that all PR must be rebased/synced to master before they can be merged. GitHub has an option for enforcing this. The downside is that this often results in lots of re-running of tests.

Re:The End of CI by benjiweber on Sunday July 03, 2022 @02:53AM (#31965666)
I think the point is about far shorter feedback loops than possible with today's pervasive tech.

> something even more continuous than continuous integration. It might look like real-time integration of your changes, collaborative editing, or smarter build systems that produce near-live feedback

e.g. https://medium.com/darklang/how-dark-deploys-code-in-50ms-77...

Re:The End of CI by cntainer on Sunday July 03, 2022 @03:55AM (#31965935)
Well, how short the feedback loop needs to be is something that can be controlled by the process, and the team sets the process.

I can have the normal flow, which takes minutes and runs all the tests and other stuff I might have on my pipeline (security, performance, etc). I use this for typical day to day work on features. I don't care if the deploy takes 50ms or 5 minutes.

I can have a fast-track for critical production patches. I skip all the main CI steps and just get my code quickly in production. If done right this takes seconds.

I didn't know about dark but I've seen this type of promise too many times, so I'm pretty sure there are many tradeoffs hidden under the nice shiny exterior. I can't know until I try it, but that kind of complexity doesn't all just disappear, i always has a cost even if it's out of sight.

Re:The End of CI by jka on Sunday July 03, 2022 @09:56AM (#31967732)
Here's the thing: we have hundreds of thousands of teams and organizations who currently each need to select and define those processes.

Perhaps some of those teams and individuals are experts at determining the correct, minimal continuous integration suite to run on a per-commit basis to minimize time and energy expenditure without compromising correctness.

But I can guarantee that not all (in fact, not many) are, and that they pay maintenance and mental overheads to adhere to those practices.

It feels to me like there is a potentially massive opportunity to design an integrated language-and-infrastructure environment that only re-runs necessary checks based on each code diff.

- "Altered a single-line docstring in a Python file? OK, the data-flow from that infers a rebuild of one of our documentation pages is required, let's do that... done in 2ms"

- "Refactored the variable names and formatting within a C++ class without affecting any of the logic or ABI? OK, binary compatibility and test compatibility verified as unchanged, that's a no-op... done in 0ms"

- "Renamed the API spec so that the 'Referer' header is renamed 'Referrer'? OK, that's going to invalidate approximately a million downstream server and client implementations, would you like to proceed?"

(examples are arbitrary and should imply no specific limitations or characteristics of languages or protocols)

Doing this effectively would require fairly tight coupling between the syntax of the language, ability to analyze dataflows relating to variables and function calls, cross-package dependency management, and perhaps other factors.

Those properties can be achieved during design of a programming language, or they can iteratively be retrofitted into existing languages (with varying levels of difficulty).

Bazel[1] attempts to achieve much of this, although to my understanding it offloads a lot of the work of determining (re)build requirements onto the developer - perhaps a necessary migration phase until more languages and environments provide formats that have self-evident out-of-date status and dependency graphs.

We'll get there and the (sometimes uneasy) jokes will be about how often the software industry used to re-run huge continuous integration pipelines.

[1] - https://en.wikipedia.org/wiki/Bazel_(software)

Re:The End of CI by cntainer on Monday July 04, 2022 @04:24AM (#31974773)
Honestly diversity is a good thing. It's good that different people are trying to solve problems at the heart of software in different ways as it creates new perspectives and possibilities. Now, after reading these replies I'm really curious about stuff like darklang and Bazel.

What happens is that people don't understand that most of these higher level solutions are very leaky abstractions, they aren't the silver bullet marketed in medium articles. Yes, they can save you a lot of time and headaches in specific scenarios but when you encounter one of the leaks it can take you weeks to get to the bottom of it.

If the teams doesn't understand what problems the tool is solving and if they have that problem then they might be just cargo-culting. An example of this is kubernetes. I know teams that used kubernetes just because everybody else is using it, they didn't actually need it for their monolithic java spring app. They think they avoided accidental complexity by using kubernetes but in fact they just added accidental complexity to their project. And then they add a new tool that makes it easier to manage the complexity of kubernetes, and so on.

Anyway, I'm probably just a rambling fool and I should appreciate that all this generating and shifting around of accidental complexity will actually mean future job safety for guys like us.

Re:The End of CI by eterps on Sunday July 03, 2022 @03:00AM (#31965691)
Yes exactly, I was also thinking about how darklang does it. The feedback loop can be much shorter, and I'm sure it's not just limited to how darklang does it either.