News for hackers. Stuff that matters.
Re:Sourcehut's Second Year in Alpha by wpietri on Sunday November 15, 2020 @11:02AM (#25102145)
There's a nice feature list on their home page: https://sourcehut.org/

The one that made me go "oooh!" is this:

  Powerful continuous integration
    - Runs fully virtualised builds on various Linux distros and BSDs
    - Submit ad-hoc jobs without pushing to your repository
    - Post-build triggers for email, webhooks, etc
    - Log in with SSH after build failures to investigate further
Submitting jobs without pushing and logging in after failed builds are two features that I didn't know I wanted. But now that I see them, I really want them.
Re:Sourcehut's Second Year in Alpha by sytse on Sunday November 15, 2020 @12:54PM (#25103153)
The parent asked which features of sourcehut are not in GitLab. I think manual triggers are in GitLab https://forum.gitlab.com/t/gitlab-ci-run-pipeline-manually/1... and I assume post build triggers are.

Logging in via SSH seems useful although that would mean keeping the machine running after a failed build.

Re:Sourcehut's Second Year in Alpha by eatonphil on Sunday November 15, 2020 @01:04PM (#25103245)
Somewhat related to this thread: a frustration I have with most CI systems is how hard it can be to reproduce the run locally using (ideally all of the) same configuration.

For example, Gitlab CI has a local runner but it's not really first class, definitely isn't kept up to date with the real runners. It seems like it's more of a recreation of a job system based off of (an older version of) Gitlab CI configuration files.

Circle CI has a more decent story around this if I remember correctly. But first-class support for local reproduction of CI runs is the kind of thing I'd like to see as table stakes today.

It can be challenging to debug certain things in the live CI system for developers without being able to recreate locally (otherwise you have to bring in the team that manages the CI system to help them debug with you which takes time).

Re:Sourcehut's Second Year in Alpha by Macha on Sunday November 15, 2020 @01:24PM (#25103400)
The trick is to do as much as possible outside the CI system. Ideally, each step should just call a single script, Makefile command, or your language's build tool equivalent.
Re:Sourcehut's Second Year in Alpha by zbentley on Sunday November 15, 2020 @02:45PM (#25104109)
That gets deeply complicated where integration or automation tests are concerned, and those types of tests provide the most value per effort in environments where test-authoring, QA, and refactoring time is limited.
Re:Sourcehut's Second Year in Alpha by Arnavion on Sunday November 15, 2020 @03:00PM (#25104253)
>That gets deeply complicated where integration or automation tests are concerned

I don't understand why this would be true.

For $dayjob I've been writing end-to-end tests that run via GitHub Actions. Each test starts with a package of the compiled code (built by another GHA workflow), deploys a bunch of cloud resources including a VM, scp's the package to the VM, and ssh's to the VM to install the package and run the test. The package contains multiple services that must be individually configured based on the particular test, and then a test process interacts with these services in a bunch of ways. I think we can agree these are complicated tests; they're not just unit tests you can run in a Docker container and be done with (which we also have, of course).

Now, these tests are written entirely in a shell script. It has been designed from the start that a developer can run the script locally and get exactly the same result as when GHA runs it. The things like auth tokens for the cloud are read as environment variables, so when running as a GHA workflow the env vars are hooked up to repository secrets, but when running locally the developer can just provide their own auth token via env vars to the script. Furthermore, the script cleans up the cloud resources when it finishes, but if the developer wants to investigate the failure they can just comment out the cleanup step from the script.

I'm sure there are third-party GH Actions to create those cloud resources, to scp files to remote targets, and to run commands via ssh against remote targets. But using those actions not only removes the ability to run the tests locally, it also requires learning arbitrary DSLs ("How does this action take parameters? What limitations does it have? How do I process the output of one action to be the parameter of the next? How do I parallelize these two actions that don't need to run in series?") and introduces third-party code that you have to trust with your cloud auth token.

Re:Sourcehut's Second Year in Alpha by rwj on Sunday November 15, 2020 @06:21PM (#25105951)
I've found it pretty easy debug GitLab CI issues. You know the docker image, so you can create the environment locally. You then need to concat the scripts together.
Re:Sourcehut's Second Year in Alpha by sytse on Sunday November 15, 2020 @01:32PM (#25103466)
Local CI is very important to quickly solve failed runs.

The problem is that we need a ton of logic in the coordinator. For example on how to do matrix builds. For local builds to be perfectly similar we would have to recreate that logic inside the runner. This is hard, not in the least because it are different programming languages.

Re:Sourcehut's Second Year in Alpha by PuercoPop on Sunday November 15, 2020 @04:35PM (#25105109)
They are not talking about manual triggers. afaik, and correct me in I'm wrong, I have to write a commit and push yaml file to the repo to be able to run the pipeline. On srht's builds on the other hand I can submit a yaml file by itself to start a job. That way when setting up the build you don't have to go through the whole edit/commit/push cycle.
Re:Sourcehut's Second Year in Alpha by sytse on Sunday November 15, 2020 @05:05PM (#25105368)
That sounds interesting and useful. Thanks for the explanation.