Hi,
sorry, that was not clear to me from your initial question. I was under the impression that you’ve researched on the topic, and now have found the default issue templates
I’m not sure about the behaviour of the aforementioned default issue templates, but I could imagine that with more than one issue template there’s still a chance for the user to make a mistake.
Yep, and the use case where you are coming from is quite often desired. Issue templates can be one way of helping the users to follow the “standard procedure”. There are other approaches too, sometimes hard to find. Good that we have this platform
The power of open source and transparency is that you can follow how others solved the problem, and often chime into source code and configs too. In addition to that, GitLab’s API allows you to manage and retrieve nearly everything you need.
A while ago I was asked about persisting the protected branches in the project settings, just because maintainers may overrule that. In the end, we defined a cronjob talking to the REST API in the customer environment, thinking about hardening flags as feature request
With regard to issue templates, I’d like to add my experience too. In the past 10 years in open source projects I have seen lots of users who do not understand the Markdown text inside, and just mark all and remove it. Or do funny things with it and you always need to do manual triage afterwards.
In order to prevent the dependency on the issue content on its own, I would suggest another approach.
Automated Issue Triage
The user does nothing here, it all happens in a scheduler script.
- The issue gets created, timestamp for the creation date
- Each day a script checks runs and checks:
- creation_date > now - 1d
- Optional: count(comments by team members) == 0
- needs_label(“needs-triage”)
- If the conditions match, the script sets the label
Technical Approach
- CI/CD allows to run jobs, just like a cron job: Scheduled pipelines | GitLab
- Within the .gitlab-ci.yml, you’ll need a job which invokes a script to do the issue triage (as entrypoint)
- REST API and auth token for interacting with the project
- Inspect the CI variables to re-use e.g. the project ID from environment variables: Predefined variables reference | GitLab
In order to avoid curl and bash, using the Python API bindings might be useful.
Examples
GitLab-org Bot
On GitLab.com there is a bot which adds labels and does other tasks for all incoming issues. It is a complex example but you’ll get the idea of using CI/CD as a scheduler to run a script.
Our triage ops team uses the gitlab-triage
Ruby project to specify certain policies and also use plugins.
Might be worthwhile to checkout it out for requirement too: GitLab.org / ruby / gems / GitLab Triage · GitLab
gitlab-triage used at GNOME
Gnome uses the mentioned gem and has incorporated their own policies.
The blog post is really detailed and should help getting things going: Issue handling automation for GNOME
Technical Evangelism Bot
We wanted to have a bot which creates issues for us on a specific date, and also creates a weekly issue summary. Issue triages are on our list - it is not yet done though. @abubakar - please jump in and share some technical details after your vacation, thank you!
Cheers,
Michael