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

Générer le changelog automatiquement depuis GitHub [GEN-1526] #3952

Merged
merged 1 commit into from
Apr 25, 2024

Conversation

francoisfreitag
Copy link
Contributor

@francoisfreitag francoisfreitag commented Apr 18, 2024

🤔 Pourquoi ?

Moins de travail manuel.

🍰 Comment ?

Utilisation de l’outil en ligne de commande gh, qui est disponible par défaut sur les machines des GitHub actions.

Petite tristesse lorsque je me suis aperçu que l’API pull requests ne permet pas de filtrer par date, le script doit donc itérer sur toutes les pull requests. 😢
https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#list-pull-requests--parameters

Merci Léo, qui m’a montré l’API gh search :)

Ajout d’une action pour vérifier la cohérence des labels des pull requests.

@francoisfreitag francoisfreitag added the no-changelog Ne doit pas figurer dans le journal des changements. label Apr 18, 2024
@francoisfreitag francoisfreitag self-assigned this Apr 18, 2024
Copy link

scripts/mkchangelog Outdated Show resolved Hide resolved
@francoisfreitag francoisfreitag force-pushed the ff/gha-changelog branch 4 times, most recently from 0b3235d to f00b9e0 Compare April 18, 2024 08:37
Makefile Outdated Show resolved Hide resolved
scripts/mkchangelog Outdated Show resolved Hide resolved
@francoisfreitag francoisfreitag marked this pull request as draft April 18, 2024 08:47
@francoisfreitag francoisfreitag force-pushed the ff/gha-changelog branch 5 times, most recently from 185efa2 to edf5547 Compare April 18, 2024 09:08
@francoisfreitag

This comment was marked as outdated.

@francoisfreitag francoisfreitag force-pushed the ff/gha-changelog branch 2 times, most recently from 594ec01 to f5b635f Compare April 18, 2024 10:15
@francoisfreitag
Copy link
Contributor Author

Je viens de corriger le tri pour ignorer le markdown.

@francoisfreitag francoisfreitag marked this pull request as ready for review April 18, 2024 10:18
@francoisfreitag francoisfreitag force-pushed the ff/gha-changelog branch 4 times, most recently from 51bcf1d to 3515d81 Compare April 18, 2024 16:46
@francoisfreitag francoisfreitag added no-changelog Ne doit pas figurer dans le journal des changements. and removed no-changelog Ne doit pas figurer dans le journal des changements. labels Apr 18, 2024
@francoisfreitag francoisfreitag force-pushed the ff/gha-changelog branch 2 times, most recently from f43bf19 to 4217863 Compare April 18, 2024 17:05
)
pull_requests = json.loads(result.stdout)
if len(pull_requests) == limit:
sys.exit("Limit has been exceeded when fetching pull requests, keep up the good work!")
Copy link
Collaborator

Choose a reason for hiding this comment

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

1000 PR en une semaine, ça laisse un peu de marge ! 😄

Copy link
Contributor

Choose a reason for hiding this comment

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

Y'a eu débat sur le nombre de zéro, il faut savoir que François est ambitieux 🥲

Copy link
Collaborator

@celine-m-s celine-m-s left a comment

Choose a reason for hiding this comment

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

J'aime ! 😍

Copy link
Contributor

@leo-naeka leo-naeka left a comment

Choose a reason for hiding this comment

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

Au top 🔥

Comment on lines 9 to 16
- name: Require minimum one label
uses: mheap/github-action-required-labels@v5.4.0
with:
mode: minimum
count: 1
labels: "ajouté, modifié, supprimé, dependencies, no-changelog"

- name: Require at most one label
uses: mheap/github-action-required-labels@v5.4.0
with:
mode: maximum
count: 1
labels: "ajouté, modifié, supprimé, dependencies, no-changelog"
Copy link
Contributor

Choose a reason for hiding this comment

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

On doit pouvoir simplifier comme ça je pense

Suggested change
- name: Require minimum one label
uses: mheap/github-action-required-labels@v5.4.0
with:
mode: minimum
count: 1
labels: "ajouté, modifié, supprimé, dependencies, no-changelog"
- name: Require at most one label
uses: mheap/github-action-required-labels@v5.4.0
with:
mode: maximum
count: 1
labels: "ajouté, modifié, supprimé, dependencies, no-changelog"
- name: Require exactly one label
uses: mheap/github-action-required-labels@v5.4.0
with:
mode: exactly
count: 1
labels: "ajouté, modifié, supprimé, dependencies, no-changelog"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Bien vu, merci 👍

sprint_end = sprint_start + datetime.timedelta(days=7)

if missing := list_missing_pull_requests(sprint_start, sprint_end):
missing_pull_requests = "\n -".join(pr["url"] for pr in missing)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
missing_pull_requests = "\n -".join(pr["url"] for pr in missing)
missing_pull_requests = "\n- ".join(pr["url"] for pr in missing)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

L’œil de lynx 😁

@francoisfreitag francoisfreitag added this pull request to the merge queue Apr 25, 2024
@francoisfreitag francoisfreitag removed this pull request from the merge queue due to a manual request Apr 25, 2024
@francoisfreitag francoisfreitag added this pull request to the merge queue Apr 25, 2024
@francoisfreitag francoisfreitag removed this pull request from the merge queue due to a manual request Apr 25, 2024
@francoisfreitag francoisfreitag force-pushed the ff/gha-changelog branch 2 times, most recently from a41af0c to 89ae710 Compare April 25, 2024 09:12
@francoisfreitag
Copy link
Contributor Author

Je viens d’ajouter merge_group à la liste des évènements qui déclenche l’action require-label. Sans ça, la PR reste bloquée dans la merge queue en attente du résultat de l’action require-label.
https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-a-merge-queue#triggering-merge-group-checks-with-github-actions

@francoisfreitag francoisfreitag added this pull request to the merge queue Apr 25, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 25, 2024
@francoisfreitag
Copy link
Contributor Author

Et évidemment... mheap/github-action-required-labels#66

Use the `gh` tool, it’s available by default on GitHub actions.
@francoisfreitag francoisfreitag added this pull request to the merge queue Apr 25, 2024
Merged via the queue into master with commit a011934 Apr 25, 2024
11 checks passed
@francoisfreitag francoisfreitag deleted the ff/gha-changelog branch April 25, 2024 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog Ne doit pas figurer dans le journal des changements.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants