open-source-ideas / meta

Repo for discussions related to the ideas initiative itself
3 stars 1 forks source link

Use GitHub actions to assign tags to issues automatically #11

Closed KOLANICH closed 4 years ago

KOLANICH commented 4 years ago

Proposed change

GH Actions allow to trigger an action when an issue is added and then do something to it. Currently @FredrikAugust assigns the tags manually. It is proposed to create a script parsing the issues and assigning the needed tags.

Proposed implementation

- name: Complexity
  limit: 1 # the greatest count of the checkboxes to be selected. # If more than this amount is selected, first ones (in `allowed`) are kept.
  allowed: # only these tags are allowed.
    - Much Work
    - Little work

Repetition of the sections mentioned in the file is not allowed, in this case the issue is considered invalid.

FredrikAugust commented 4 years ago

Wow, this is a great idea! Would be very helpful :)

  1. des. 2019 kl. 12:22 skrev KOLANICH notifications@github.com:

 Proposed change

GH Actions allow to trigger an action when an issue is added and then do something to it. Currently @FredrikAugust assigns the tags manually. It is proposed to create a script parsing the issues and assigning the needed tags.

Proposed implementation

In the repo a yaml file containing the description of sections and tags in it is stored.

  • name: Complexity limit: 1 # the greatest count of the checkboxes to be selected. # If more than this amount is selected, first ones (in allowed) are kept. allowed: # only these tags are allowed.
    • Much Work
    • Little work Repetition of the sections mentioned in the file is not allowed, in this case the issue is considered invalid.

on each issue creation or first message update the bot checks the format. If the format is not satisfied, the issue is closed. it then synchronises GH tags with the tags described in the file. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

KOLANICH commented 4 years ago

Old Man Frost 🎅 has brought you a present.

https://github.com/KOLANICH/issuer - action https://github.com/KOLANICH/OSIIssues - demo

Though I likely won't be able to publish it to the marketplace (requires 2FA), feel free to clone and do it yourself.

FredrikAugust commented 4 years ago

Thank you very much @KOLANICH! I'll try to set it up once I get back home tomorrow :)

FredrikAugust commented 4 years ago

How do I install it? Simply merge the OSIIssues repo into this one?

KOLANICH commented 4 years ago
  1. Read https://github.com/KOLANICH/issuer/blob/master/ReadMe.md and the checklist.
  2. Review the source code carefully to understand how it works. I insist on reading all the files. Keep in mind that there is a lot of refactoring work yet to be done, including some compatibility-breaking changes (I wanna decouple form logic from generic logic and put the generic logic (preparation of environment, dispatching and reactions) into a separate package using the backends (templater logic reading labels from the templates and issues text, linting them, and deciding what to do with the issue (there is a yet another project, but it uses YAML for forms instead of markdown, and that YAML has benefits for that project, but the reactions needed to be done are the same - linting, locking, deleting, moving and banning systematic violators))), in the current state it is much like a workable PoC, though it is already useful. Tell me everything you think is wrong in it.
  3. clone https://github.com/KOLANICH/issuer . It may make sense to publish it in GitHub Marketplace. But don't expect stability.
  4. clone https://github.com/KOLANICH/OSIIssues and play around it a bit. The most importantly, make it point to your fork rather to my repo. I experiment right on my repo and force-push. Also I have a very poor cybersecurity thanks to f***ing chips vendors and common tendentions in the software development to unnecessarily bloat the software to the level it cannot be run on old hardware.
  5. then create a PR into https://github.com/open-source-ideas/open-source-ideas
FredrikAugust commented 4 years ago

@KOLANICH is there any chance you could implement this in the main repo provided that I give you write permissions? If so, please contact me on fredrik.malmo@icloud.com.

KOLANICH commented 4 years ago

is there any chance you could implement this in the main repo

Could you do it yourself? It is strictly better than if you have given me the permissions. At least someone else audited the code.

provided that I give you write permissions?

It is dangerous, I advise against it.

FredrikAugust commented 4 years ago

It is indeed dangerous, but I believe you have no ill intentions considering the fact that you've been around for quite some time and have contributed a great deal to the initiative. My schedule is also quite packed these days, so I don't have much time to tinker with technology outside uni and work.

KOLANICH commented 4 years ago

you have no ill intentions

I have no, but I cannot be sure that my devices and accounts are not compromised. In fact I am pretty sure they are, if anyone ever wanted it.

KOLANICH commented 4 years ago

@FredrikAugust, are you going to have time for that in near future? Who else having access to the org can do that?

FredrikAugust commented 4 years ago

@KOLANICH Sadly I don't really have any spare time in the foreseeable future -- especially with the current Coronavirus pandemic, making things significantly more troublesome.

The only other person that I know of who has access to the org is @mikaelbr, but I believe that he's quite busy as well.

I'd personally be happy to give you permissions to implement this yourself if you and @mikaelbr are comfortable with that.

KOLANICH commented 4 years ago

I can add it, but the tool needs supervision (that I don't risk to provide because it would require me having permanent write access). I mean it can break anytime. This has happened once when ruamel has moved his repos from bitbucket to sourceforge. This may happen again if some of libs authors broken compatibility. Once the pipeline is broken it floods with messages about it to email.