We also shouldn't enable CI if .gitlab-ci.yml is pushed to a non-default branch, since this could be a feature branch that was created before it was deleted in the default branch.
Maybe we shouldn't enable/disable CI for the entire project based on .gitlab-ci.yml being pushed, but simply run it for branches that have it, and don't for branches that don't.
I don't think we need the project-wide CI-enabled status at all, it can simply be always-on.
Maybe we shouldn't enable/disable CI for the entire project based on .gitlab-ci.yml being pushed, but simply run it for branches that have it, and don't for branches that don't.
In IRC some users complained that they can't completly disable ci in their instance at the moment.
When this is decided based on the existence of the .gitlab-ci.yml file,
can we create a global git hook for this that prevents uploading it?
That way we can keep it simple and still satisfy the admins who don't want anyone to use gitlab ci for some reason. (corporate policy or something like that)
when someone push .gitlab-ci.yml - we should enable CI (by !1403 (merged))
Not sure about that. Not everyone uses CI. What if someone clones a public GitLab repo with CI (and therefore a .gitlab.yml) and pushes this to its private GitLab server without CI?
@dzaporozhets well... you can already do this now with the git hooks.
disallow .gitlab-ci.yml as a file ending and you have that effect.
A seperate hook would just make it more obvious.
Not sure about that. Not everyone uses CI. What if someone clones a public GitLab repo with CI (and therefore a .gitlab.yml) and pushes this to its private GitLab server without CI?
Good point. That would leave the user with useless UI elements in their project...
Well lets be realistic. There is very little chance you are going to fork project with .gitlab-ci.yml file and not using CI but wanting to keep file. And for this people its ok to have a bit of useless UI elements in their project.
By default we enable GitLabCiService for a new projects, just like Issues or Merge Requests. Maybe we should also enable it for all projects that doesn't have other CI service enabled.
If someone wants to disable build triggers he simply unticks Active in GitLabCiService, but data are still accessible for commits.
No logic when .gitlab-ci.yml is pushed or not.
Is someone doesn't want to use built-in CI, he deactivates GitLabCiService and enables Drone CI or something else.
We can put CI option in Project Settings in Features group:
Existence of the file seems like a great way to do it, because there may be instances where we do not want to run CI for a particular branch -- e.g. gh-pages
In our case, we have an old branch that does not have any tests built for it, but it still needs occasional maintenance.
Perhaps at the very least, a disabled: true line in the yml?
@sytses@ayufan having it in Project Settings makes sense. Its not an external service but a built-in feature like Issues and Merge Requests. So I see it like this:
Put CI in Project Settings under features like Issues or Wiki
Enable CI by default for new projects
Remove logic that enables CI with you push .gitlab-ci.yml file