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 action to populate the change log from PR titles triggered by @multiqc-bot changelog #2025

Merged
merged 32 commits into from Sep 27, 2023

Conversation

vladsavelyev
Copy link
Member

@vladsavelyev vladsavelyev commented Sep 4, 2023

Following the discussion.

Add a CI action triggered when a PR is approved.

A new line will be added either under "MultiQC updates", "New Modules", or "Module updates", so it pretty much keeps the existing structure, in it's simplest form (i.e. not separating between classes of core updates). That new line will be committed into the same branch.

I decided not to use any of the existing actions on the marketplace, as configuring them gets too hacky and/or puts too much restrictions.

Updated on 24 Sep 2023:

Triggering a workflow on review approval is not working for forks. Unfortunately such event is triggered on the PR merge branch, so the secrets are not available to the workflow for safety. So working around this by triggering the workflow on a comment. The idea is to support a @multiqc-bot changelog command. The command can take an optional argument. It will trigger a workflow that:

  • Determines the section where the entry should go.
    • If the PR title starts with "New module:" and a single module was added, the change will go into "New modules"
    • If a single module was altered and the PR title starts with this module's name, it will go into "Module updates"
    • Otherwise, it will go into general "MultiQC updates".
  • Checks if an entry is already added in the changelog (a comment always contains the link to the PR), and adds or replaces an entry based on this.
  • If additional section was specified (@multiqc-bot changelog An amazing change), it will take it as a description; otherwise, takes a changelog entry from the PR title.

Copy link
Member

@ewels ewels left a comment

Choose a reason for hiding this comment

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

Amazing stuff 🤩

Bonus points in the workflow YAML:

  • Don't run if CHANGELOG.md has been modified within the pull request (?)
  • Add a comment on the PR with the stderr output from the script, saying what happened
    • This will alert us to errors, as otherwise we'd need to go in and check the actions logs manually I think
    • If we include the git commit hash of the pushed commit, it will make it easy to quickly view the diff of the automated update, for sanity checking

.github/workflows/changelog.py Outdated Show resolved Hide resolved
.github/workflows/changelog.py Show resolved Hide resolved
.github/workflows/changelog.py Show resolved Hide resolved
@ewels ewels added the core: infrastructure Something to do with the MultiQC infra label Sep 4, 2023
@vladsavelyev vladsavelyev changed the title CI to automatically populate the change log from PR titles Add action to populate the change log from PR titles triggered by /changelog Sep 24, 2023
@vladsavelyev vladsavelyev marked this pull request as ready for review September 24, 2023 17:44
@vladsavelyev vladsavelyev changed the title Add action to populate the change log from PR titles triggered by /changelog Add action to populate the change log from PR titles triggered by @multiqc-bot changelog Sep 24, 2023
@vladsavelyev
Copy link
Member Author

Alright, it works now. Tested here vladsavelyev#21 :)

@vladsavelyev vladsavelyev added this to the MultiQC v1.17 milestone Sep 24, 2023
@vladsavelyev vladsavelyev added the awaits-review Awaiting final review and merge. label Sep 25, 2023
Copy link
Member

@ewels ewels left a comment

Choose a reason for hiding this comment

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

Looks like a couple of lines in the Changelog got messed with in this PR

Copy link
Member

@ewels ewels left a comment

Choose a reason for hiding this comment

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

It would be good to document how this works for the developer in https://multiqc.info/docs/development/contributing/

Copy link
Member

@ewels ewels left a comment

Choose a reason for hiding this comment

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

LGTM once we have some docs 👍🏻

@github-actions
Copy link
Contributor

github-actions bot commented Sep 26, 2023

🚀 Deployed on https://mqc-pr-2025--multiqc.netlify.app

@vladsavelyev vladsavelyev merged commit a31bf04 into master Sep 27, 2023
14 checks passed
@ewels ewels deleted the changelog-ci branch September 27, 2023 08:07
a-frantz added a commit to a-frantz/MultiQC that referenced this pull request Oct 2, 2023
* master:
  Just run CI on the oldest + newest supported Python versions (MultiQC#2074)
  Picard: fix parsing mixed strings/numbers, account for trailing tab (MultiQC#2083)
  FastQC: add top overrepresented sequences table (MultiQC#2075)
  Add GitHub Actions bot workflow to fix code linting from a PR comment (MultiQC#2082)
  Use custom exception type instead of `UserWarning` when no samples are found. (MultiQC#2049)
  Lint modules for missing `self.add_software_version` (MultiQC#2081)
  Changelog bot: Update docs (MultiQC#2077)
  Changelog action: remove `.capitalize()`, add changelog entry (MultiQC#2080)
  Add action to populate the change log from PR titles triggered by `@multiqc-bot changelog` (MultiQC#2025)

# Conflicts:
#	CHANGELOG.md
#	multiqc/modules/ngsderive/ngsderive.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaits-review Awaiting final review and merge. core: infrastructure Something to do with the MultiQC infra
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants