News for hackers. Stuff that matters.
Re:I'll think twice before using GitHub Actions again by jicea on Monday January 20, 2025 @05:22AM (#42767120)
I don't understand why this is not the evident approach for everyone writing GitHub Actions/GitLab CI/CD yaml etc....

I've struggled in some teams to explained why it's better to extract your command in scripts (ShellCheck on it, scripts are simple to run locally etc...) instead of writing a Frankenstein of YAML and shell commands. I hope someday to find an authoritative guidelines on writing pipeline that promote this approach so at least I can point to this link instead of defending myself being a dinosaur!

Re:I'll think twice before using GitHub Actions again by mrweasel on Monday January 20, 2025 @05:43AM (#42767261)
In a previous job we had a team tasked with designing these "modern" CI/CD pipeline solutions, mostly meant for Kubernetes, but it was suppose to work for everything. They had such a hard on for tools that would run each step as a separate isolated task and did not want pipelines to "devolve" into shell scripts.

Getting anything done in such environments are just a pain. You spend more time fighting the systems than you do actually solving problems. It is my opinion that a CI/CD system needs just the following features: Triggers (source code repo, http endpoints or manually triggered), secret management and shell script execution. That's it, you can build anything using that.

Re:I'll think twice before using GitHub Actions again by eddd-ddde on Monday January 20, 2025 @08:50AM (#42768692)
I think what they really wanted was something like bazel. The only real benefit I can think right now for not "devolving" into shell scripts is distributed caching with hermetic builds. It has very real benefits but it also requires real effort to work correctly.
Re:I'll think twice before using GitHub Actions again by datavirtue on Monday January 20, 2025 @05:45PM (#42774018)
I just joined as the enterprise architect for company that has never had one. There is an existing devops team that is making everyone pull their hair out and I haven't had a single spare minute to dig in on their mess but this sounds early familiar.
Re:I'll think twice before using GitHub Actions again by mongol on Monday January 20, 2025 @06:18PM (#42774324)
Is this really the job of an enterprise architect? To dig into the details of a devops team's mess?
Re:I'll think twice before using GitHub Actions again by datavirtue on Monday January 20, 2025 @08:51PM (#42775503)
It's more about giving the team and the overall strategy a thumbs up or down, so yes.
Re:I'll think twice before using GitHub Actions again by eru on Tuesday January 21, 2025 @12:38AM (#42776967)
The job of senior people should mostly be to make sure the organisation runs smoothly.

If no one else is doing anything about the mess, then it falls to the senior person to sort it out.

As a rule of thumb:

- Ideally your people do the Right Thing by themselves by the magic of 'leadership'. - Second best: you chase the people to do the Right Thing. - Third: you as the senior person do the Right Thing. - Least ideal: no one fixes the mess nor implements the proper way.

I guess some people can achieve the ideal outcome with pure charisma (or fear?) alone, but I find that occasionally getting your hands dirty (option 3) helps earn the respect to make the 'leadership' work. It can also help ground you in the reality of the day to day work.

However, you are right that a senior person shouldn't get bogged down with such work. You need to cut your losses at some point.

Re:I'll think twice before using GitHub Actions again by mongol on Tuesday January 21, 2025 @06:13AM (#42778843)
Where I work, which granted is a very large company, the enterprise architects focus on ERP processes, logistic flows, how prices flow from the system where they are managed to the places that need them, and so on. They are several levels removed from devops teams. DevOps concerns are maybe handled by tech leads, system architects or technical product managers.
Re:I'll think twice before using GitHub Actions again by eru on Wednesday January 22, 2025 @11:19PM (#42800679)
Makes sense. From datavirtue's comment is sounded like they joined a much smaller outfit without much in terms of established _working_ procedures here.
Re:I'll think twice before using GitHub Actions again by chrisweekly on Monday January 20, 2025 @07:51PM (#42775045)
Mostly agreed, but (maybe orthogonal) IME, popular CI/CD vendors like TeamCity* can make even basic things like shell script execution problematic.

* TC offers sh, full stop. If you want to script something that depends on bash, it's a PITA and you end up with a kludge to run bash in sh in docker in docker.

Re:I'll think twice before using GitHub Actions again by mdaniel on Monday January 20, 2025 @10:43PM (#42776362)
> If you need a specific interpreter to be used, specify shebang (for example, #!/bin/bash) as the first line of the script.

https://www.jetbrains.com/help/teamcity/command-line.html#:~...

Your "docker in docker" comment makes me wonder if you're conflating the image that you are using, that just happens to be run by TeamCity, versus some inherent limitation of TC. I believe a boatload of the Hashicorp images ship with dash, or busybox or worse, and practically anything named "slim" or "alpine" similarly

Re:I'll think twice before using GitHub Actions again by maccard on Monday January 20, 2025 @05:45AM (#42767279)
To make the thing actually fast at scale, a lot of the logic ends up being specific to the provider; requiring tokens, artifacts etc that aren't available locally. You end up with something that tries to detect if you're running locally or in CI, and then you end up in exactly the same situation.
Re:I'll think twice before using GitHub Actions again by Lutger on Tuesday January 21, 2025 @04:53AM (#42778205)
You are right, and this is where a little bit of engineering comes in. Push as much of the logic to scripts (either shell or python or whatever) that you can run locally. Perhaps in docker, whatever. All the token, variables, artifacts etc should act as inputs or parameters to your scripts. You have several mechanisms at your disposal, command line arguments, environment variables, config files, etc. Those are all well understood, universal, language and environment agnostic, to an extent.

The trick is to NOT have your script depend on the specifics of the environment, but reverse the dependency. So replace all `If CI then Run X else if Local Run Y` with the ability to configure the script to run X or Y, then let the CI configure X and local configure Y. For example.

I'm not saying it is always easy and obvious. For bigger builds, you often really want caching and have shitloads of secrets and configurations going on. You want to only build what is needed, so you need something like a DAG. It can get complex fast. The trick is making it only as complex as it needs be, and only as reusable as and when it is actually re-used.

Re:I'll think twice before using GitHub Actions again by maccard on Tuesday January 21, 2025 @06:45AM (#42779080)
> The trick is to NOT have your script depend on the specifics of the environment, but reverse the dependency. So replace all `If CI then Run X else if Local Run Y` with the ability to configure the script to run X or Y, then let the CI configure X and local configure Y. For example.

> I'm not saying it is always easy and obvious. For bigger builds, you often really want caching and have shitloads of secrets and configurations going on.

Here's the thing. When you don't want secrets, or caching, or messaging, or conditional deploys, none of this matters. Your build can be make/mvn/go/cargo and it just works, and is easy. It only gets messy when you want to do "detect changes since last run and run tests on those components", or "don't build the moon and the stars, pull that dependency in CI, as local users have it built already and it won't change." And the way to handle those situations involves running different targets/scripts/whatever and not what is actually in your CI environment.

I've lost count of how many deploys have been marked as failed in my career because the shell script for posting updates to slack has an error, and that's not used in the local runs of CI.

What you _actually_ need is a staging branch of your CI and a dry-run flag on all of your state modifying commands. Then, none of this matters.

Re:I'll think twice before using GitHub Actions again by arghwhat on Monday January 20, 2025 @05:40AM (#42767246)
My "favorite" is when I see people go all in, writing thousands of lines of Jenkins-flavor Groovy that parses JSON build specifications of arbitrary complexity to sort out how to build that particular project.

"But then we can reuse the same pipeline for all our projects!"

Re:I'll think twice before using GitHub Actions again by lowercased on Monday January 20, 2025 @04:57PM (#42773545)
I can rarely reuse the same pipeline for the same project 6 months down the road, much less reuse for anything else.

The few bits that end up getting reused are the externalized bash scripts.

Re:I'll think twice before using GitHub Actions again by ozim on Monday January 20, 2025 @05:56PM (#42774130)
I think that is pitfall of software devs.

For me it was an epiphany as software dev - not to write reusable extensible scripts - I am so much more productive after that.

Re:I'll think twice before using GitHub Actions again by baby_souffle on Monday January 20, 2025 @09:35PM (#42775771)
> "But then we can reuse the same pipeline for all our projects!"

oh god just reading that gave me PTSD flash backs.

At $priorGig there was the "omni-chart". It was a helm chart that was so complex it needed to be wrapped in terraform and used composable terraform modules w/ user var overrides as needed.

Debugging anything about it meant clearing your calendar for the day and probably the following day, too.

Re:I'll think twice before using GitHub Actions again by arccy on Monday January 20, 2025 @04:14PM (#42773129)
it can be quite hard to write proper scripts that work consistently... different shells have different behaviours, availability of local tools, paths, etc

and it feels like fighting against the flow when you're trying to make it reusable across many repos

Re:I'll think twice before using GitHub Actions again by akdev1l on Monday January 20, 2025 @05:04PM (#42773616)
Containerize the build environment so everything is captured (dependencies, build tools, etc)
Re:I'll think twice before using GitHub Actions again by carlmr on Monday January 20, 2025 @05:15PM (#42773731)
If you're not containerizing your CI/CD, you're really lost.
Re:I'll think twice before using GitHub Actions again by maccard on Monday January 20, 2025 @06:26PM (#42774392)
How do I containerize building desktop apps for windows with MSVC?
Re:I'll think twice before using GitHub Actions again by eru on Tuesday January 21, 2025 @12:42AM (#42776986)
Wine?

Less snarky: https://learn.microsoft.com/en-us/virtualization/windowscont... seems to be a thing?

And in any case, you can use VMs instead of containers.

Re:I'll think twice before using GitHub Actions again by maccard on Tuesday January 21, 2025 @06:32AM (#42778988)
You know, I'd love to run MSVC in Wine on a ubuntu container. I bet it would be quicker.

I've had the unfortunate pleasure of working with Windows Containers in the past. They are Containers in the sense that you can write a dockerfile for them, and they're somewhat isolated, but they're no better than a VM in my experience.

> And in any case, you can use VMs instead of containers.

They're not the same thing. If that's the case running linux AMI's on EC2 should be the same as containers.

Re:I'll think twice before using GitHub Actions again by akdev1l on Tuesday January 21, 2025 @09:07AM (#42780201)
It’s the same thing for the purposes of capturing the build environment.

It doesn’t really matter if you have to spin up a Linux instances and then run your build environment as a container there vs spinning up a windows VM.

Re:I'll think twice before using GitHub Actions again by akoboldfrying on Monday January 20, 2025 @09:59PM (#42775985)
That might be the case if Docker did in fact guarantee (or at least make it easy to guarantee) deterministic builds -- but it doesn't really even try:

1. Image tags ("latest", etc.) can change over time. Does any layer in your Dockerfile -- including inside transitive deps -- build on an existing layer identified by tag? If so, you never had reproducibility.

2. Plenty of Dockerfiles include things like "apt-get some-tool" or its moral equivalent, which will pull down whatever is the latest version of that tool.

It's currently common and considered normal to use these "features". Until that changes, Docker mostly adds only the impression of reproducibility, but genuine weight and pain.

Re:I'll think twice before using GitHub Actions again by tsimionescu on Tuesday January 21, 2025 @02:15AM (#42777377)
The advantage that Docker brings isn't perfect guaranteed reusability, it's complete independence (or as close you can easily get while not wasting resources on VMs) from the system on which the build is running, plus some resuability in practice in a certain period of time, and given other good practices.

Sure, if I try to rebuild a docker image from 5 years ago, it may fail, or produce something different, because it was pulling in some packages that have changed significantly in apt, or perhaps pip has changed encryption and no longer accepts TLS1.1 or whatever. And if you use ':latest' or if your team has a habit of reusing build numbers or custom tags, you may break the assumptions even sooner.

But even so, especially if using always incremented build numbers as image tags, a docker image will work the same way om the Jenkins system, the GitHub Actions pipeline, and every coworker's local build, for a while.

Re:I'll think twice before using GitHub Actions again by akdev1l on Tuesday January 21, 2025 @09:15AM (#42780282)
1. Use a hash for the base images. 2. The meaning of “latest” is dependent on what base images you are using. Using UBI images for example means your versions are not going to change because redhat versions don’t really change.

But really containerizing the build environment is not related to deterministic builds as there’s a lot more work needed to guarantee that. Including possible changes in the application itself.

Lastly you don’t need to use docker or dockerfiles to build containers. You can use whatever tooling you want to create a rootfs and then create an image out of that. A nifty way of actually guaranteeing reproducibility is to use nix to build a container image.

Re:I'll think twice before using GitHub Actions again by akoboldfrying on Tuesday January 21, 2025 @05:30PM (#42785909)
>But really containerizing the build environment is not related to deterministic builds

What would you say the goal of containerising builds is, if not reproducibility?

Re:I'll think twice before using GitHub Actions again by carlmr on Wednesday January 22, 2025 @03:25AM (#42790411)
They didn't say reproducibility, they said determinism.

If you use a container with the same apt-get commands and the same OS, you already separate out almost all the reproducibility issues. What you get will be a very similar environment.

But it's not deterministic as you point out, that takes a lot more effort.

Re:I'll think twice before using GitHub Actions again by carlmr on Wednesday January 22, 2025 @03:22AM (#42790388)
I agree that Docker doesn't do the best job here, you can still get a lot better reproducibility than without though.

You can use specific image hashes to work around image tag changes.

For problem 2 ideally use something like NixOS as a base or at least nix package manager.

But IMO Nix is quite complicated, even though the working model is really good. So this is mostly if you really need deterministic builds.

Docker already gets you 80% of the way with 20% of the effort.

Re:I'll think twice before using GitHub Actions again by lmm on Monday January 20, 2025 @11:33PM (#42776653)
Only if your tech stack is bad (i.e. Python). My maven builds work anywhere with an even vaguely recent maven and JVM (and will fail-fast with a clear and simple error if you try to run them in something too old), no need to put an extra layer of wrapping around that.
Re:I'll think twice before using GitHub Actions again by akdev1l on Tuesday January 21, 2025 @09:10AM (#42780224)
except you need to install the correct Java version and maven (we really should be using gradle by now)

Also in many projects there’s things other than code that need to be “built” (assets, textures, translations, etc). Adding custom build targets to maven’s build.xml is truly not ideal then there’s people who actually try to write logic in there. That’s objectively worse than the YAML hell we were complaining about at the top of the thread.

Re:I'll think twice before using GitHub Actions again by lmm on Tuesday January 21, 2025 @07:57PM (#42787333)
> you need to install the correct Java version and maven

Like I said, any version from the last, like, 10+ years (Java and Maven are both serious about backward compatibility), and if you install an ancient version you at least get fail-fast with a reasonable error.

> we really should be using gradle by now

We really shouldn't.

> Adding custom build targets to maven’s build.xml is truly not ideal then there’s people who actually try to write logic in there.

Maven doesn't have a build.xml, are you thinking of ant? With maven you write your custom build steps as build plugins, and they're written in plain old Java (or Kotlin, or Scala, or...) code, as plain old Maven modules, with the same kind of ordinary unit testing as your regular code; all your usual code standards apply (e.g. if you want to check your test coverage, you do it the same way as for your regular code - indeed, probably the same configuration you set up for your regular code is already getting applied). That's a lot better than YAML.

Re:I'll think twice before using GitHub Actions again by necovek on Tuesday January 21, 2025 @04:00PM (#42785135)
It's trivial to control your Python stack with things like virtualenv (goes back to at least 2007) and has been for ages now (I don't really remember the time when it wasn't, and I've been using Python for 20+ years).

What in particular did you find "bad" with Python tech stack?

(I've got my gripes with Python and the tooling, but it's not this — I've got bigger gripes with containers ;-))

Re:I'll think twice before using GitHub Actions again by lmm on Tuesday January 21, 2025 @07:46PM (#42787268)
> What in particular did you find "bad" with Python tech stack?

Stateful virtualenvs with no way to check if they're clean (or undo mistakes), no locking of version resolution (much less deterministic resolution), only one-way pip freeze that only works for leaf projects (and poorly even then), no consistency/standards about how the project management works or even basic things like the directory layout, no structured unit tests, no way to manage any of this stuff because all the python tooling is written in python so it needs a python environment to run so even if you try to isolate pieces you always have bootstrap problems... and most frustrating of all, a community that's ok with all this and tries to gaslight you that the problems aren't actually problems.

Re:I'll think twice before using GitHub Actions again by necovek on Wednesday January 22, 2025 @12:51AM (#42789482)
Sounds a lot like nitpicking, and I'll demonstrate why.

With docker containers, you can shell into it, do a couple of changes and "docker commit" it afterwards: similarly stateful, right? You resolve both by recreating them from scratch (and you could easily chmod -w the entire virtualenv directory if you don't want it to change accidentally).

The pattern of using requirements.txt.in and pip-freeze generated requirements.txt has been around for a looong time, so it sounds like non-idiomatic way to use pip if you've got problems with locking of versions or non-leaf projects.

As for directory layout, it's pretty clear it's guided by Python import rules: those are tricky, but once you figure them out, you know what you can and should do.

Can you clarify what do you mean with "structured unit tests"? Python does not really limit you in how you organize them, so I am really curious.

Sure, a bootstrapping problem does exist, but rarely do you need exactly a particular version of Python and any of the dev tools to be able to get a virtualenv off the ground, after which you can easily control all the deps in them (again a requirements-dev.txt.in + requirements-dev.txt pattern will help you).

And there's a bunch of new dev tools springing up recently that are written in Rust for Python, so even that points at a community that constantly works to improve the situation.

I am sorry that you see this as "gaslighting" instead of an opportunity to learn why someone did not have the same negative experience.

Re:I'll think twice before using GitHub Actions again by lmm on Wednesday January 22, 2025 @02:07AM (#42789931)
> With docker containers, you can shell into it, do a couple of changes and "docker commit" it afterwards: similarly stateful, right?

I guess theoretically you could, but I don't think that's part of anyone's normal workflow. Whereas it's extremely easy to run "pip install" from project A's directory with project B's virtualenv active (or vice versa). You might not even notice you've done it.

> You resolve both by recreating them from scratch

But with Docker you can wipe the container and start again from the image, which is fixed. You don't have to re-run the Dockerfile and potentially end up with different versions of everything, which is what you have to do with virtualenv (you run pip install and get something completely different from the virtualenv you deleted).

> you could easily chmod -w the entire virtualenv directory if you don't want it to change accidentally

But you have to undo it every time you want to add or update a dependency. In other ecosystems it's easy to keep my dependencies in line with what's in the equivalent of requirements.txt, but hard to install some random other unmanaged dependency. In the best ecosystems there's no need to "install" your dependencies at all, you just always have exactly the packages listed in the requirements.txt equivalent available at runtime when you run things.

> The pattern of using requirements.txt.in and pip-freeze generated requirements.txt has been around for a looong time, so it sounds like non-idiomatic way to use pip if you've got problems with locking of versions or non-leaf projects.

I've literally never seen a project that does that. And even if you do that, it's still harder to work with because you can't upgrade one dependency without unlocking all of your dependencies, right?

> As for directory layout, it's pretty clear it's guided by Python import rules

I don't mean within my actual code, I mean like: where does source code go, where does test code go, where do non-code assets go.

> Can you clarify what do you mean with "structured unit tests"?

I mean, like, if I'm at looking at a particular module in the source code, where do I go to find the tests for that module? Where's the test-support code as distinct from the specific tests?

> rarely do you need exactly a particular version of Python and any of the dev tools to be able to get a virtualenv off the ground

Whether virtualenv is available is a relatively recent change, so you already have a fractal problem. Having an uncontrolled way of installing your build environment is another of those things that's fine until it isn't.

> And there's a bunch of new dev tools springing up recently that are written in Rust for Python

Yeah, that's the one thing that gives me some hope that there might be light at the end of the tunnel, since I hear they mostly ignore all this idiocy (and avoid e.g. having user-facing virtualenvs at all) and just do the right thing. Hopefully once they catch on we'll see Python start to be ok without containers too and maybe the container hype will die down. But it's certainly not the case that everything has been fine since 2007; quite the opposite.

Re:I'll think twice before using GitHub Actions again by darthwalsh on Monday January 20, 2025 @05:27PM (#42773842)
I'm not sold on using containers for macOS desktop apps...
Re:I'll think twice before using GitHub Actions again by necovek on Tuesday January 21, 2025 @03:56PM (#42785089)
If you don't value your and your developer's time, certainly, containerize everything.

I've rarely seen a feedback loop with containers that's not longer than 10s only due to containerization itself, and that breaks the "golden" 10s rule (see https://www.nngroup.com/articles/response-times-3-important-...).

If you aim for quicker turn-around (eg. just running a single test in <1s), you'll have to either aggressively optimize containers (which is pretty non-idiomatic with Docker containers in particular), or do away with them.

Re:I'll think twice before using GitHub Actions again by crabmusket on Wednesday January 22, 2025 @12:45AM (#42789443)
Are you talking about CI or local development? Why would you run a single test in CI? And why would a container add 10+ seconds to a local task?
Re:I'll think twice before using GitHub Actions again by necovek on Wednesday January 22, 2025 @12:57AM (#42789505)
I am talking about either, because the GP post was about "containerizing a build environment": you need your project built to either run it in CI or locally.

Why would it be slow?

It needs to be rebuilt? (on a fast moving project with mid-sized or large team, you'll get dependency or Dockerfile changes frequently)

It needs to restart a bunch of dependent services?

Container itself is slow to initialize?

Caching of Docker layers is tricky, silly (you re-arrange a single command line and poof, it's invalidated, including all the layers after) and hard to make the most of.

If you can't get a single test running in <1s, you are never going to get a full test suite running in a couple of seconds, and never be able to do an urgent deploy in <30s.

Re:I'll think twice before using GitHub Actions again by akdev1l on Wednesday January 22, 2025 @12:47PM (#42795464)
> I've rarely seen a feedback loop with containers that's not longer than 10s only due to containerization itself

Sounds like a skill issue tbh.

`time podman run —-rm -it fedora:latest echo hello` will return in a few milliseconds, whatever delay you are complaining about would be from the application running in the container.

Lastly containers != docker.

Re:I'll think twice before using GitHub Actions again by eru on Tuesday January 21, 2025 @12:41AM (#42776981)
Pick a single shell and treat it like a programming language.

Or write your stuff in eg Python in the first place. GitHub's CI yaml supports scripts in arbitrary languages, not just shell.

Re:I'll think twice before using GitHub Actions again by dboreham on Monday January 20, 2025 @07:33PM (#42774896)
The reason for this is that nobody took the time to write a proper background document on Github Actions. The kind of information that you or I might convey if asked to explain it at the whiteboard to junior hires, or senior management.

This syndrome is very common these days. Things are explained differentially: it's like Circle CI but in the GH repo. Well that's no use if the audience wasn't around when Circle CI was first new and readily explained (It's like Jenkins but in the cloud...).

Re:I'll think twice before using GitHub Actions again by 0xbadcafebee on Monday January 20, 2025 @09:26PM (#42775712)
I think I can summarize it in a rough, general way.

  CI/CD is a method to automate tasks in the background that you would otherwise run on your laptop. The output
  of the tasks are used as quality gates for merging commits, and for deployments.
  
  - Step 1. Your "laptop in the cloud" requires some configuration (credentials, installed software, cached artifacts)
    before a job can be run.
    - Requires logic specific to the CI/CD system
  
  - Step 2. Running many jobs in parallel, passing data from step to step, etc requires some instructions.
    - Requires logic specific to the CI/CD system
  
  - Step 3. The job itself is the execution of a program (or programs), with some inputs and outputs.
    - Works the same on any computer (assuming the same software, environment, inputs, etc)
    - Using a container in Step 1. makes this practical and easy
  
  - Step 4. After the job finishes, artifacts need to be saved, results collected, and notifications sent.
    - Some steps are specific to the CI/CD system, others can be a reusable job
  
  Step 3 does not require being hard-coded into the config format of the CI/CD system. If it is instead
  just executable code in the repo, it allows developers to use (and work on) the code locally without
  the CI/CD system being involved. It also allows moving to a different CI/CD system without ever rewriting
  all the jobs; the only thing that needs to be rewritten are the CI/CD-specific parts, which should be
  generic and apply to all jobs pretty much the same.
  
  Moving the CI/CD-specific parts to a central library of configuration allows you to write some code
  once and reuse it many times (making it DRY). CircleCI Orbs, GitHub Actions, Jenkins Shared Libraries/
  Groovy Libraries, etc are examples of these. Write your code once, fix a bug once, reuse it everywhere.
Re:I'll think twice before using GitHub Actions again by harrall on Monday January 20, 2025 @11:58PM (#42776785)
A shell script has many extremely sharp edges like dealing with stdin, stderr, stdout, subprocesses, exit codes, environmental variables, etc.

Most programmers have never written a shell script and writing CI files is already frustrating because sometimes you have to deploy, run, fix, deploy, run, fix, which means nobody is going to stop in the middle of that and try to learn shell scripting.

Instead, they copy commands from their terminal into the file and the CI runner takes care of all the rough edges.

I ALWAYS advise writing a shell script but I know it's because I actually know how to write them. But I guess that's why some people are paid more big bux.

Re:I'll think twice before using GitHub Actions again by eru on Tuesday January 21, 2025 @12:40AM (#42776973)
GitHub's CI yaml also accepts eg Python. (Or anything else, actually.)

That's generally a bit less convenient, ie it takes a few more lines, but it has significantly fewer sharp edges than your typical shell script. And more people have written Python scripts, I guess?

Re:I'll think twice before using GitHub Actions again by harrall on Tuesday January 21, 2025 @12:47AM (#42777006)
I find that Python scripts that deal with calling other programs have even more sharp edges because now you have to deal with stdin, stderr and stdout much more explicitly. Now you need to both know shell scripting AND Python.

Python’s subprocess has communicate(), check_output() and other helpers which takes care of a lot but (a) you need to know what method you should actually call and (b) if you need to do something outside of that, you have to use Popen directly and it’s much more work than just writing a shell script. All doable if you understand pipes and all that but if you don’t, you’ll be just throwing stuff at the wall until something sticks.

Re:I'll think twice before using GitHub Actions again by smaudet on Tuesday January 21, 2025 @01:44AM (#42777255)
1) If possible, don't run shell scripts with Python. Evaluate why you are trying to do that and don't. 2) Python has a bunch of infrastructure compared to shell, you can use it. Shell scripts don't. 3) Apply the same you used for the script to what it calls. CI calls control script for job, script calls tools/libraries for heavy lifting.

Often the shell script just calls a python/Ruby/rust exec anyways...

Shell scripts are for scripting...the shell. Nothing else.

Re:I'll think twice before using GitHub Actions again by harrall on Tuesday January 21, 2025 @10:19AM (#42781033)
Sure but I already know all this at a level deeper than most people.

Your average person is going to be blindsighted.

Re:I'll think twice before using GitHub Actions again by smaudet on Tuesday January 21, 2025 @11:07AM (#42781676)
Your average person will be blind sighted either way, at least one way they have a much better set of tools to help them out, once they are blind sighted.
Re:I'll think twice before using GitHub Actions again by eru on Tuesday January 21, 2025 @01:23AM (#42777172)
Yes, but at least that's all fairly obvious---you might not know how to solve the problem, but at least you know you have a problem that needs solving. Compare that to the hidden pitfalls of eg dealing with whitespace in filenames in shell scripts. Or misspelled variable names that accidentally refer to non-existent variables but get treated as if they are set to be "".
Re:I'll think twice before using GitHub Actions again by eru on Tuesday January 21, 2025 @12:33AM (#42776943)
> [...] instead of writing a Frankenstein of YAML and shell commands.

The 'Frankenstein' approach isn't what makes it necessarily worse. Eg Makefiles work like that, too, and while I have my reservations about Make, it's not really because they embed shell scripts.

Re:I'll think twice before using GitHub Actions again by dpkirchner on Tuesday January 21, 2025 @01:09AM (#42777094)
This all reminds me of the systemd ini-like syntax vs shell scripts debate. Shell scripts are superior, of course, but they do require deeper knowledge of unix-like systems.
Re:I'll think twice before using GitHub Actions again by slt2021 on Tuesday January 21, 2025 @01:23AM (#42777169)
yeah if you author CI jobs, you should know linux, otherwise a person should not even touch the CI system with 10ft pole
Re:I'll think twice before using GitHub Actions again by surajrmal on Tuesday January 21, 2025 @05:33AM (#42778517)
I've been working with Linux since I was 10 (I'm much older now), and I still don't think I "know Linux". The upper bound on understanding it is incredibly high. Where do you draw the line?
Re:I'll think twice before using GitHub Actions again by slt2021 on Tuesday January 21, 2025 @11:30AM (#42781990)
just basics enough to understand typical bash commands, scripts, how env variables work, etc