Skip to content

Conversation

@cmeesters
Copy link
Member

@cmeesters cmeesters commented Oct 14, 2025

added the mastodon announcement bot to snakedeploy.

Summary by CodeRabbit

  • Chores
    • Added automated Mastodon release announcements triggered on release commits to main.
    • Publishes a standardized post including version, release notes, links to the changelog and distribution sources, and an attached logo.
    • Ensures consistent, timely communication of new releases without manual steps.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 14, 2025

📝 Walkthrough

Walkthrough

Adds 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

Cohort / File(s) Summary
Release announcement workflow
\.github/workflows/announce-release.yml
New workflow: triggers on push to main with changelog diff and commit message filter; checks out repo; uses Mastodon post action with token secret, logo attachment, extracted release notes, and templated message linking to issue URL and changelog.

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
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title Check ❓ Inconclusive The title uses a conventional “feat:” prefix and refers to adding an announcement mechanism consistent with the PR’s objective, but the term “announcement robot” is too generic and does not clearly convey that this introduces a Mastodon release announcement GitHub Action, making it ambiguous for future readers. Please consider renaming the title to more precisely describe the change, for example “feat: add Mastodon release announcement GitHub Action,” so that it clearly indicates the platform and functionality being introduced.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/announcement_robot

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cmeesters
Copy link
Member Author

@johanneskoester please check the pr logo and logo path, whether it is to your liking.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

📥 Commits

Reviewing files that changed from the base of the PR and between d98dffd and d640a95.

⛔ Files ignored due to path filters (1)
  • pr_logo/pr_logo.png is 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)

Comment on lines +28 to +42
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 }}
Copy link
Contributor

@coderabbitai coderabbitai bot Oct 14, 2025

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

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.

Suggested change
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.

Copy link
Contributor

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 ?

Copy link
Contributor

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!

Copy link
Member Author

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.

Copy link
Contributor

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:

  1. The Python script ignores that empty line
  2. 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants