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

Add GitHub Labeler Action to manage project labels automatically #634

Merged
merged 16 commits into from
Nov 10, 2020

Conversation

oncleben31
Copy link
Contributor

@oncleben31 oncleben31 commented Oct 23, 2020

fix: #167

Design decision open for discussion:

  • I propose to not delete existing label not in YAML file to avoid bad surprises for users who could update the template and don't read the documentation.
  • I added hacktoberfest* pattern in exclude list to give an example how to manage seasons labels (perhaps other example).

To Do:

  • Update documentation
  • Add advice to users on how to construct YAML file from existing labels (I have used this gist and a JSON to YAML convertor to create initial YAML files for this PR). Listening any suggestions

@oncleben31
Copy link
Contributor Author

oncleben31 commented Oct 23, 2020

I have made some tests on the repository https://github.com/oncleben31/test-labels

You can see the logs here

@oncleben31
Copy link
Contributor Author

Failure of tests-3.9 with windows doesn't seem related to my modifications.

@oncleben31 oncleben31 force-pushed the labeler#167 branch 3 times, most recently from e19c7af to 62ca4ab Compare October 24, 2020 09:23
@oncleben31 oncleben31 marked this pull request as ready for review October 24, 2020 10:11
@cjolowicz cjolowicz added this to the 2020.11.15 milestone Oct 31, 2020
@cjolowicz cjolowicz added the enhancement New feature or request label Oct 31, 2020
@oncleben31
Copy link
Contributor Author

It seems I've missed some labels on cookiecutter GitHub project. I will check again.

@oncleben31 oncleben31 marked this pull request as draft November 1, 2020 18:14
Do be used with the GitHub Action github-labeler.
A workflow based on GA github-labeler.
* Run only on push to main or master.
* Don't remove lable not in labels.yml -> For avoiding mistake with users
  updating the template withour reading the doc.
* Fix jinja template.
Based on github-labeler GitHub Action.
@oncleben31 oncleben31 marked this pull request as ready for review November 1, 2020 19:01
@oncleben31
Copy link
Contributor Author

OK label list checked and updated. PR rebased with latest version of master branch.

Copy link
Owner

@cjolowicz cjolowicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many thanks for putting in the work to contribute this useful feature! Defining labels as code is cool!

The inline comments fix some typos and remove some options that repeat defaults. Please apply the same changes to the files in the template directory.

Documentation in this project uses semantic newlines, meaning that newlines are only used to separate sentences or phrases, not for formatting (reflowing paragraphs). This plays better with diffs and code editors IMO.

Update:

  • I agree with your decision to skip deletes.
  • I would omit instructions for generating the YAML file. Most users will be editing the file generated by Cookiecutter, right?

.github/labels.yml Outdated Show resolved Hide resolved
.github/workflows/labeler.yml Outdated Show resolved Hide resolved
.github/workflows/labeler.yml Outdated Show resolved Hide resolved
.github/workflows/labeler.yml Outdated Show resolved Hide resolved
.github/workflows/labeler.yml Outdated Show resolved Hide resolved
docs/guide.rst Outdated Show resolved Hide resolved
docs/guide.rst Outdated Show resolved Hide resolved
docs/guide.rst Outdated Show resolved Hide resolved
docs/guide.rst Outdated Show resolved Hide resolved
docs/guide.rst Outdated Show resolved Hide resolved
@oncleben31
Copy link
Contributor Author

Thank you again for your friendly and instructive review. I've learned a lot again.

Inline comments are committed and duplicated in the template.
.python-versions file is removed
and documentation is reworked trying to implement Semantic Line Breaks.

I Hope it now meets your expectations.

Copy link
Owner

@cjolowicz cjolowicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the update (especially for going through the trouble of converting this to semantic newlines, appreciated). I have one more suggestion, plus a minor fix, both marked inline.

docs/guide.rst Outdated Show resolved Hide resolved
README.rst Outdated Show resolved Hide resolved
Co-authored-by: Claudio Jolowicz <cjolowicz@gmail.com>
oncleben31 and others added 2 commits November 9, 2020 12:17
Will be accessible in User Guide

Co-authored-by: Claudio Jolowicz <cjolowicz@gmail.com>
The details of how labels management works is in the User Guide
@oncleben31
Copy link
Contributor Author

README comments taken into account.

Copy link
Owner

@cjolowicz cjolowicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! 💯

@cjolowicz cjolowicz merged commit 1d22ab3 into cjolowicz:master Nov 10, 2020
@cjolowicz cjolowicz mentioned this pull request Nov 14, 2020
TeoZosa added a commit to TeoZosa/cookiecutter-cruft-poetry-tox-pre-commit-ci-cd that referenced this pull request Jan 7, 2021
Reference implementation:
- [Add GitHub Labeler Action to manage project labels automatically #634](cjolowicz/cookiecutter-hypermodern-python#634)
TeoZosa added a commit to TeoZosa/cookiecutter-cruft-poetry-tox-pre-commit-ci-cd that referenced this pull request Jan 7, 2021
`labeler.yml` (symlink)
- Symlinked to `../../{{cookiecutter.project_slug}}/.github/workflows/labeler.yml`.

Reference implementation:
- [Add GitHub Labeler Action to manage project labels automatically #634](cjolowicz/cookiecutter-hypermodern-python#634)
TeoZosa added a commit to TeoZosa/cookiecutter-cruft-poetry-tox-pre-commit-ci-cd that referenced this pull request Jan 7, 2021
Reference implementation:
- [Add GitHub Labeler Action to manage project labels automatically #634](cjolowicz/cookiecutter-hypermodern-python#634)
TeoZosa added a commit to TeoZosa/cookiecutter-cruft-poetry-tox-pre-commit-ci-cd that referenced this pull request Jan 7, 2021
Reference implementation:
- [Add GitHub Labeler Action to manage project labels automatically #634](cjolowicz/cookiecutter-hypermodern-python#634)
TeoZosa added a commit to TeoZosa/cookiecutter-cruft-poetry-tox-pre-commit-ci-cd that referenced this pull request Jan 8, 2021
Reference implementation:
- [Add GitHub Labeler Action to manage project labels automatically #634](cjolowicz/cookiecutter-hypermodern-python#634)
paw-lu pushed a commit to paw-lu/cookiecutter-hypermodern-python that referenced this pull request Mar 8, 2021
…lowicz#634)

* Add a YAML file with project labels description

Do be used with the GitHub Action github-labeler.

* Add GitHub worflow to manage project labels

A workflow based on GA github-labeler.

* Fine tune the labeler workflow

* Run only on push to main or master.
* Don't remove lable not in labels.yml -> For avoiding mistake with users
  updating the template withour reading the doc.
* Fix jinja template.

* Add YAML file with repository labels decscription

* Add workflow to manage labels

Based on github-labeler GitHub Action.

* Fix code style error detected by pre-commit

* Update documentation in README

* Update user guide documentation

* Add missing labels for cookiecutter project

* Apply suggestions from code review

* remove .python-version file

* Duplicate code review correstion in template

Mainly typos and default value removal.

* Implement Semantic Line Breaks in documentation

* fix typo on labels file link

* Remove too detailed instructions in README

Will be accessible in User Guide

* Remove useless information in README

The details of how labels management works is in the User Guide
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add GitHub Labeler Action
2 participants