Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Course automation submission: Automatic labels #1144

Merged
merged 4 commits into from
May 3, 2021
Merged

Course automation submission: Automatic labels #1144

merged 4 commits into from
May 3, 2021

Conversation

mans-andersson
Copy link

@mans-andersson mans-andersson commented Apr 6, 2021

Course-automation: Automatic labels

Members

Kalle Meurman ([email protected])
GitHub: Kalle

Måns Andersson ([email protected])
GitHub: Måns

Proposal

Action that automatically adds labels to issues, pull-requests, etc. based on keywords in message.

Original proposal pull request: #932

Submission

We have created our own Github action that adds labels to a pull request based on
keywords within the title of the pull request. The code is available publicly at
https://github.com/Wizkas0/PR-LabelGenerator. In the repo both the code and
documentation (README) can be found.

The keywords and corresponding labels to be added are specified in the workflow .yml file
as a JSON object. As a part of this pull request we have added the file ./github/workflows/label-generator.yml.
If this pull request gets merged the action will hopefully become functional instantly and
start adding labels to pull requests.

Here are the suggestions for keyword/label pairs that we think are reasonable based on
the labels that are already used in the course:

{
"presentation":"presentation",
"essay":"essay",
"demo":"demo",
"executable tutorial":"tutorial",
"open-source contribution":"contribution_to_open_source",
"contribution to open-source":"contribution_to_open_source",
"course automation":"course_automation",
"feedback":"feedback",
"proposal":"proposal",
"submission":"final_submission"
}

For example this would mean that if the PR title contains the phrase "course automation"
the label course_automation will be added. We will gladly take suggestions for changing the
keywords/labels and adding additional labels.

Here is the link to the repo we used for testing our action: https://github.com/mansand1/action-test/pulls
If you look at the PRs you can see that some labels have been added automatically.

Grading

According to our own assessment, we have satisfied four criteria and two of those at a remarkable level.

Criteria Yes No Remarkable Motivation
The automation task produces a PR status or issue / PR comment Yes When the action is run, the targeted pull request receives a pending status, and when the job is completed, it receives a successful status. If any labels are added by the action, this shows up in the pull request as github-actions[bot] added the <something> label .
The automation task is reusable Yes (next year for this course) In other courses than this one Our action can be reused in both this course and others (and unrelated projects) by simply editing the keyword-dict input in the workflow .yml file to include the appropriate key-words/phrases and labels for the course/ course-run.
The task runs on a standard platform Yes (Github action) Our action is a Github action.
The code for the task is available Yes (public repo) Well documented repo Our source code is a available at https://github.com/Wizkas0/PR-LabelGenerator and the action is available on the Github marketplace at https://github.com/marketplace/actions/pr-labelgenerator with thorough instructions for how to implement it. The source code is also well documented.

@Wizkas0
Copy link

Wizkas0 commented Apr 30, 2021

Obs! This is the link to our test repo, where the action has been used to automatically add labels to pull requests https://github.com/mansand1/action-test/pulls .

@SophieHYe
Copy link

Thanks for your work. I am now merging your PR.

@SophieHYe SophieHYe self-assigned this May 3, 2021
@SophieHYe SophieHYe merged commit 1ca345a into KTH:2021 May 3, 2021
@Deee92
Copy link
Collaborator

Deee92 commented May 9, 2021

Hi @Wizkas0 and @mansand1, your test repo gives a 404. Can you check access permissions?

@mans-andersson
Copy link
Author

@Deee92 Hello! Sorry about that, the repository is now public and you should be able to view it.

monperrus pushed a commit that referenced this pull request Sep 15, 2022
* Add workflow file

* Add submission details

Co-authored-by: Kalle <[email protected]>

* Change job name

Co-authored-by: Kalle <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants