-
Notifications
You must be signed in to change notification settings - Fork 11
feat: added announcement robot #109
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
base: main
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughAdds a new GitHub Actions workflow that triggers on pushes to main when the changelog changes and the commit message matches a release pattern. It checks out the repo and posts a standardized release announcement to Mastodon via snakemake/mastodon-release-post-action using secrets and constructed message content. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Dev as Developer
participant GH as GitHub Actions
participant Repo as Repository
participant Action as Mastodon Post Action
participant Masto as Mastodon
Dev->>Repo: Push to main (chore(main): release ...)
GH-->>GH: On push (paths: CHANGELOG.md)
alt Commit message contains "chore(main): release"
GH->>Repo: actions/checkout
GH->>Action: snakemake/mastodon-release-post-action<br/>with token, logo, templates
Action-->>Action: Extract version & release notes
Action->>Masto: Create post with message + attachment
Masto-->>Action: Post URL/confirmation
Action-->>GH: Success
else
GH-->>GH: Skip workflow
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@johanneskoester please check the pr logo and logo path, whether it is to your liking. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pr_logo/pr_logo.pngis excluded by!**/*.png
📒 Files selected for processing (1)
.github/workflows/announce-release.yml(1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.8)
.github/workflows/announce-release.yml
28-28: property "extract-release-notes" is not defined in object type {}
(expression)
| message: | | ||
| Beep, Beep - I am your friendly #Snakemake release announcement bot. | ||
|
|
||
| There is a new release of the Snakedeploy tool to deploy Snakemake workflows from the snakemake catalog. Its version now is {{ version }}! | ||
|
|
||
| Give us some time, and you will automatically find the plugin on #Bioconda and #Pypi. | ||
|
|
||
| If you want to discuss the release, you will find the maintainers here on Mastodon! | ||
| @[email protected] | ||
|
|
||
| If you discover any issues, please report them on {{ issue_url }}. | ||
|
|
||
| See {{ changelog }} for details. Here is the header of the changelog: | ||
|
|
||
| ${{ steps.extract-release-notes.outputs.release_notes }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Undefined extract-release-notes step breaks the workflow.
message references steps.extract-release-notes.outputs.release_notes, but no step with id: extract-release-notes exists. GitHub Actions will fail to parse/execute this workflow because the referenced step is undefined. Add the missing extraction step (or drop the reference) before merging.
+ - name: Extract release notes
+ id: extract-release-notes
+ run: |
+ notes="$(grep -A50 -m1 '^## ' CHANGELOG.md | sed '/^## /{/^## .*/d;}' )"
+ echo "release_notes<<'EOF'" >> "$GITHUB_OUTPUT"
+ echo "$notes" >> "$GITHUB_OUTPUT"
+ echo "EOF" >> "$GITHUB_OUTPUT"
+
- name: Post to Mastodon
uses: snakemake/mastodon-release-post-action@main
with:
…
message: |
…
- ${{ steps.extract-release-notes.outputs.release_notes }}
+ ${{ steps.extract-release-notes.outputs.release_notes }}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| message: | | |
| Beep, Beep - I am your friendly #Snakemake release announcement bot. | |
| There is a new release of the Snakedeploy tool to deploy Snakemake workflows from the snakemake catalog. Its version now is {{ version }}! | |
| Give us some time, and you will automatically find the plugin on #Bioconda and #Pypi. | |
| If you want to discuss the release, you will find the maintainers here on Mastodon! | |
| @[email protected] | |
| If you discover any issues, please report them on {{ issue_url }}. | |
| See {{ changelog }} for details. Here is the header of the changelog: | |
| ${{ steps.extract-release-notes.outputs.release_notes }} | |
| # … previous steps … | |
| - name: Extract release notes | |
| id: extract-release-notes | |
| run: | | |
| notes="$(grep -A50 -m1 '^## ' CHANGELOG.md | sed '/^## /{/^## .*/d;}' )" | |
| echo "release_notes<<'EOF'" >> "$GITHUB_OUTPUT" | |
| echo "$notes" >> "$GITHUB_OUTPUT" | |
| echo "EOF" >> "$GITHUB_OUTPUT" | |
| - name: Post to Mastodon | |
| uses: snakemake/mastodon-release-post-action@main | |
| with: | |
| … | |
| message: | | |
| Beep, Beep - I am your friendly #Snakemake release announcement bot. | |
| There is a new release of the Snakedeploy tool to deploy Snakemake workflows from the snakemake catalog. Its version now is {{ version }}! | |
| Give us some time, and you will automatically find the plugin on #Bioconda and #Pypi. | |
| If you want to discuss the release, you will find the maintainers here on Mastodon! | |
| @[email protected] | |
| If you discover any issues, please report them on {{ issue_url }}. | |
| See {{ changelog }} for details. Here is the header of the changelog: | |
| ${{ steps.extract-release-notes.outputs.release_notes }} | |
| # … following steps … |
🧰 Tools
🪛 actionlint (1.7.8)
28-28: property "extract-release-notes" is not defined in object type {}
(expression)
🤖 Prompt for AI Agents
In .github/workflows/announce-release.yml around lines 28-42 the workflow
references steps.extract-release-notes.outputs.release_notes but no step with
id: extract-release-notes exists; either add a step before this message that
defines id: extract-release-notes and populates an output named release_notes
(for example use a run or github-script step to read the release body or compute
the notes and set it with echo "::set-output name=release_notes::...") or remove
the reference from the message and use an existing value (e.g.,
github.event.release.body or another defined output); ensure the new step
appears earlier in the job so steps.extract-release-notes.outputs.release_notes
is available when the message is rendered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that step missing @cmeesters ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@coderabbitai - what gives you the idea? https://github.com/snakemake/snakemake/blob/main/.github/workflows/announce-release.yml works successfully exactely this way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Fetch the announce-release.yml workflow from snakemake/snakemake repository
curl -s https://raw.githubusercontent.com/snakemake/snakemake/main/.github/workflows/announce-release.yml
Length of output: 1414
🏁 Script executed:
#!/bin/bash
# Also check the mastodon-release-post-action to see if it provides the extract-release-notes step
curl -s https://raw.githubusercontent.com/snakemake/mastodon-release-post-action/main/action.yml
Length of output: 1727
🏁 Script executed:
#!/bin/bash
# Check the v1 tag of the mastodon-release-post-action
curl -s https://raw.githubusercontent.com/snakemake/mastodon-release-post-action/v1/action.yml
Length of output: 1727
🏁 Script executed:
#!/bin/bash
# Check recent workflow runs in snakemake/snakemake to see if this workflow succeeds
gh api repos/snakemake/snakemake/actions/workflows -q '.workflows[] | select(.name == "Announce Release on Mastodon") | .id' | head -1 | xargs -I {} gh api "repos/snakemake/snakemake/actions/workflows/{}/runs?per_page=5" --jq '.workflow_runs[] | {created_at, conclusion, html_url}'
Length of output: 689
🏁 Script executed:
#!/bin/bash
# Check the details of one of the successful runs
gh api repos/snakemake/snakemake/actions/runs/18442253911/jobs --jq '.jobs[] | {name, conclusion, steps: [.steps[] | {name, conclusion, status}]}'
Length of output: 498
🏁 Script executed:
#!/bin/bash
# Let's also check the logs to see if there are any warnings about the missing step
gh api repos/snakemake/snakemake/actions/runs/18442253911/logs > /tmp/logs.zip 2>&1 && unzip -p /tmp/logs.zip 2>/dev/null | grep -A5 -B5 "extract-release-notes\|release_notes" | head -50
Length of output: 0
🏁 Script executed:
#!/bin/bash
# Check the Python script that processes the message
curl -s https://raw.githubusercontent.com/snakemake/mastodon-release-post-action/v1/post_to_mastodon.py
Length of output: 8344
🏁 Script executed:
#!/bin/bash
# Let's also check if there's an extract-release-notes step defined somewhere else in the action
curl -s https://api.github.com/repos/snakemake/mastodon-release-post-action/contents?ref=v1 | jq -r '.[].name'
Length of output: 104
@cmeesters, you're absolutely right, and I apologize for the confusion! I dug into the action's implementation and now understand what's happening.
The mastodon-release-post-action Python script automatically extracts release notes directly from the CHANGELOG.md file and appends them to the message. The script searches for the version section in CHANGELOG.md and extracts everything between that version header and the next one.
So the ${{ steps.extract-release-notes.outputs.release_notes }} reference in the workflow message evaluates to an empty string (since that step doesn't exist), but this doesn't break anything because:
- The Python script ignores that empty line
- The script itself extracts and appends the release notes at the end of the message
The line is essentially vestigial/redundant from an earlier implementation but harmless. The workflow succeeds because the actual release note extraction happens inside the Python script, not via a GitHub Actions step output.
Your workflow will work exactly as the snakemake/snakemake one does! 🎉
(\__/)
(•ㅅ•) Oops! My mistake!
/>📝 Thanks for the correction!
added the mastodon announcement bot to snakedeploy.
Summary by CodeRabbit