Hacker News new | ask | show | jobs
by phailhaus 1313 days ago
> configuration files do not actually perform steps

And I don't think he's saying they do either. In fact, I don't think the post gets into execution details at all! If you go through it again, he's only talking about ways of writing config files, not ways of running them. In one approach, the config defines the pipeline itself. In the second approach, the config defines your desired end state.

The "imperative" vs "declarative" distinction is entirely dependent on what your goal is. If your goal is to write a very specific pipeline, then the former is also declarative! But the context of the article is in achieving some desired end state in CI. With that context in mind, the former is "imperative" and the latter is "declarative".

1 comments

Well, he does get into execution detais; he's showing you multiple configs that have a lot of steps in series, and saying, "Look, this file is ridiculous! Too many steps! Bugs! Instead, just define one function! Let the program deal with it!" Which I 1000% agree with.

I get that the whole story is saying "do things declaratively". But I think that term, and its ability to be misused (as in the quoted example) are distracting, because we get lost in the weeds and miss the real point, which is that we shouldn't be writing pseudo-programs in configuration files. I think we can all agree on that; so let's just say that, and leave the magic words alone.

Where's the execution detail? He never tells you how the config file is going to be run. Again, the entire post is relative to the goal of getting a stable CI build. If your config file is filled with implementation details of that goal, you're being imperative.

It has nothing to do with "writing programs in your config file". The problem is that your config file is telling the runner how to reach the goal rather than what the goal is.

> The problem is that your config file is telling the runner how to reach the goal rather than what the goal is.

The real-world alternative is a partial rewrite of your CI infra, which usually not feasible.