On Samstag, 30. November 2024 11:41:12 Mitteleuropäische Normalzeit Albert Astals Cid wrote: > El dissabte, 30 de novembre del 2024, a les 4:29:22 (Hora estàndard del > Centre d’Europa), Ben Cooksley va escriure: > > The two options I can see for resolving this are: > > a. Making use of the "ci.skip" Git push option when pushing a new work > > branch to be used in a merge request > > b. We set CI jobs as manual by default on work/ branches (optionally > > making > > use of a CI environment variable to allow work branches to run by default) > > > > I wouldn't be in favour of making the CI jobs disabled by default on work > > branches as that is non-intuitive / non-obvious behaviour, especially if > > you have to pass an environment variable to make them show up. > > How is it non-obvious? You created a "work" branch so no automatic CI for > you, if you want one, create a Merge Request (so you show your work to the > rest of us) or run the CI manually.
For the CD jobs we already do this. They are only run automatically on our
mainline branches. Option b would merely extend this to all jobs for branch
pipelines. The non-obvious part is that one has to know the KDE-specific CI/CD
variable that one has to pass to change the behavior.
Option a could also be a workable solution. We could recommend to set ci.skip
as default option via `git config set push.pushOption ci.skip`. This option
behaves pretty sensible: "Skips only branch pipelines and not merge request
pipelines." i.e. it does exactly what we want. And people should be able to
trigger a branch pipeline by using `git push -o ""`, i.e. by passing an empty
push option. Granted it's not super intuitive.
I'm leaning toward option a because it leaves the choice to the users using a
standard option offered by GitLab.
I have now added this option to my KDE specific .gitconfig file which I include
in the global ~/.gitconfig with
```
[includeIf "gitdir:~/dev/kde/"]
path = ~/dev/kde/.gitconfig
```
Another alternative would be to define an alias, e.g.
alias.push-mr=push -o ci.skip -o merge_request.create
Regards,
Ingo
signature.asc
Description: This is a digitally signed message part.
