-
Notifications
You must be signed in to change notification settings - Fork 30
fix: path to posting script #193
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
Conversation
WalkthroughThe pull request modifies the GitHub Actions workflow for posting to Mastodon upon the closure of a pull request. It updates the method of exporting the pull request title, changing it from using the release tag name to using the pull request title. Additionally, it makes the Changes
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
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: 2
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/post_to_mastodon.yml
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: testing
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: 0
🧹 Nitpick comments (2)
.github/workflows/post_to_mastodon.sh (2)
4-4
: Add error handling for PR_TITLE environment variable.The version extraction logic looks good and aligns with the PR title format. However, consider adding validation for the PR_TITLE environment variable.
+# Validate PR_TITLE +if [ -z "${PR_TITLE}" ]; then + echo "Error: PR_TITLE environment variable is not set" + exit 1 +fi + # Extract version from PR tag passed as environment variable version="${PR_TITLE##* }"
Line range hint
19-41
: Consider improving message construction for better maintainability.The hardcoded message with maintainer handles could benefit from some improvements:
- Move maintainer handles to variables for easier updates
- Use heredoc with quotes to prevent expansion issues
+# Maintainer handles +MAINTAINER1="@rupdecat@fediscience.org" +MAINTAINER2="@johanneskoester@fosstodon.org" + -read -d '\n' message << EndOfText +read -d '\n' message << 'EndOfText' Beep, Beep - I am your friendly #Snakemake release announcement bot There is a new release of the Snakemake executor for #SLURM on #HPC systems. Its version is '${version}'! -See ${changelog//\'/\\\'} for details. +See ${changelog} for details. Give us some time and you will automatically find it on #Bioconda and #Pypi. -If you want to discuss the release you will find the maintainers here on Mastodon! -@rupdecat@fediscience.org and @johanneskoester@fosstodon.org +If you want to discuss the release you will find the maintainers here on Mastodon! +${MAINTAINER1} and ${MAINTAINER2} If you find any issues, please report them on https://github.com/snakemake/snakemake-executor-plugin-slurm/issues #Snakemake #HPC #ReproducibleComputing #ReproducibleResearch #OpenScience EndOfText
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/post_to_mastodon.sh
(1 hunks).github/workflows/post_to_mastodon.yml
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- .github/workflows/post_to_mastodon.yml
🧰 Additional context used
📓 Learnings (1)
.github/workflows/post_to_mastodon.sh (1)
Learnt from: cmeesters
PR: snakemake/snakemake-executor-plugin-slurm#193
File: .github/workflows/post_to_mastodon.yml:0-0
Timestamp: 2025-01-20T09:24:03.959Z
Learning: In the snakemake-executor-plugin-slurm repository's post_to_mastodon.sh script, the version number is extracted from PR titles using the parameter expansion `${PR_TITLE##* }`, which removes everything up to the last space in the string.
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: testing
🔇 Additional comments (1)
.github/workflows/post_to_mastodon.sh (1)
Line range hint
13-13
: Verify that the version tag exists before constructing the changelog URL.The script assumes the version tag exists in the repository. Consider adding a verification step.
Run this script to verify the version tag exists:
@coderabbitai the action runner (https://github.com/snakemake/snakemake-executor-plugin-slurm/actions/runs/12868461723/job/35875172798) now returns Error: Invalid version format in PR title: script. Any idea what causes this and what a fix might be? |
Tip For best results, initiate chat on the files or code changes. @cmeesters The error occurs because the script expects a version number in the title (e.g., "v1.2.3"), but your PR title "fix: path to posting script" doesn't contain one. The script was previously triggered by releases (which have version tags) but was changed to use PR titles instead. You have a few options to fix this:
Which approach would you prefer? I can help you implement any of these solutions. |
Tip For best results, initiate chat on the files or code changes. @cmeesters I see the issue now. The workflow is currently set to run on all merged PRs, but the script is specifically designed to announce version releases. Here's the recommended fix - modify the workflow to only run on release PRs. Update the jobs:
post_to_mastodon:
if: |
github.event.pull_request.merged == true &&
(startsWith(github.event.pull_request.title, 'release') || contains(github.event.pull_request.title, ' v'))
runs-on: ubuntu-latest
# ... rest of the job configuration This way:
Would you like me to help you implement this change? 🔗 Analysis chain@cmeesters The error occurs because the post_to_mastodon.sh script expects the PR title to end with a version number (e.g., "something v1.2.3" or "release 1.2.3"), but your PR title is "fix: path to posting script". This seems to be because the workflow was converted from handling releases to handling PRs, but the version extraction logic wasn't updated. You have a few options:
Which approach would you prefer? I can help you implement any of these solutions. 🏁 Scripts executedThe following scripts were executed for the analysis: Script:
Length of output: 2167 Script:
Length of output: 767 |
🤖 I have created a release *beep* *boop* --- ## [0.14.2](v0.14.1...v0.14.2) (2025-01-20) ### Bug Fixes * ci runner ought to start now upon merge to main ([#189](#189)) ([90c6bf9](90c6bf9)) * path to access the posting script ([#191](#191)) ([d7dcbbb](d7dcbbb)) * path to posting script ([#193](#193)) ([d0fb3cd](d0fb3cd)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Summary by CodeRabbit