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

Ci/notify discussions release #302

Merged
merged 2 commits into from
Oct 16, 2024
Merged

Ci/notify discussions release #302

merged 2 commits into from
Oct 16, 2024

Conversation

ccamel
Copy link
Member

@ccamel ccamel commented Oct 15, 2024

Addresses axone-protocol/community#6.

  • Additionally, removes Discord notifications on release, as GitHub Discussions will now serve as the primary release notification channel, with optional forwarding to Discord if needed.
  • Also enables manual triggering with a specific tag input (only for the notification of release on discussions), alongside the default trigger on release. This adds flexibility for replaying the workflow when necessary.​

Summary by CodeRabbit

  • New Features

    • Introduced a manual trigger for release workflows with an optional release tag.
    • Added a new job for creating GitHub discussion announcements for releases.
  • Improvements

    • Enhanced handling of release tags and repository information for announcements.
    • Updated the update-docs job to prevent execution during manual dispatches.

We will now use GitHub Discussions as the sole channel for
release notifications and forward these to Discord if needed.
@ccamel ccamel self-assigned this Oct 15, 2024
@ccamel ccamel force-pushed the ci/notify-discussions-release branch from 5a82a19 to b2460e7 Compare October 15, 2024 13:18
Copy link

@bdeneux bdeneux left a comment

Choose a reason for hiding this comment

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

Nice 👍

One thing but I don't know if it's necessary ;)

.github/workflows/notify-release.yml Outdated Show resolved Hide resolved
@ccamel ccamel force-pushed the ci/notify-discussions-release branch from b2460e7 to 0b173a4 Compare October 16, 2024 08:30
Copy link
Contributor

coderabbitai bot commented Oct 16, 2024

Walkthrough

The pull request introduces significant updates to the workflow file .github/workflows/notify-release.yml. A new trigger, workflow_dispatch, allows manual invocation with an optional tag parameter. The job notify-discord has been renamed to set-env, focusing on setting environment variables and determining the release tag. A new job, notify-github-discussion, is added to create a discussion announcement for releases. Additionally, the update-docs job now includes conditions to prevent execution during manual dispatches, along with minor URL formatting adjustments.

Changes

File Change Summary
.github/workflows/notify-release.yml - Added workflow_dispatch trigger with optional tag input.
- Renamed job notify-discord to set-env.
- Added outputs tag and repo_name in set-env job.
- Introduced new job notify-github-discussion for creating release announcements.
- Updated logic for determining release tag.
- Added conditional execution for update-docs job.
- Minor URL formatting adjustments in update-docs.

Poem

In the meadow, changes bloom,
With tags and talks, we lift the gloom.
From Discord's call to GitHub's cheer,
Announcements now bring joy near!
A rabbit hops with glee so bright,
Celebrating workflows taking flight! 🐇✨


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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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: 0

🧹 Outside diff range and nitpick comments (2)
.github/workflows/notify-release.yml (2)

12-32: LGTM with minor suggestions: Environment setup looks good

The renaming of the job and the addition of outputs for tag and repo_name are well-implemented and align with the PR objectives. The logic for determining the release tag is correct.

However, there are some minor shellcheck warnings that we can address:

Consider applying these changes to address shellcheck warnings:

 if [ -n "$INPUT_TAG" ]; then
-  TAG="$INPUT_TAG"
+  TAG="${INPUT_TAG}"
 else
-  TAG=$(gh release view --json tagName -q '.tagName')
+  TAG="$(gh release view --json tagName -q '.tagName')"
 fi
-echo "tag=$TAG" >> $GITHUB_OUTPUT
+echo "tag=${TAG}" >> "$GITHUB_OUTPUT"

-REPO_NAME=${GITHUB_REPOSITORY#${GITHUB_REPOSITORY_OWNER}/}
-echo "repo_name=$REPO_NAME" >> $GITHUB_OUTPUT
+REPO_NAME="${GITHUB_REPOSITORY#${GITHUB_REPOSITORY_OWNER}/}"
+echo "repo_name=${REPO_NAME}" >> "$GITHUB_OUTPUT"

These changes will prevent potential issues with word splitting and globbing.

🧰 Tools
🪛 actionlint

20-20: shellcheck reported issue in this script: SC2086:info:6:20: Double quote to prevent globbing and word splitting

(shellcheck)


20-20: shellcheck reported issue in this script: SC2295:info:8:31: Expansions inside ${..} need to be quoted separately, otherwise they match as patterns

(shellcheck)


20-20: shellcheck reported issue in this script: SC2086:info:9:32: Double quote to prevent globbing and word splitting

(shellcheck)


33-76: LGTM with enhancement suggestion: GitHub Discussion notification implemented well

The new notify-github-discussion job is well-implemented and aligns perfectly with the PR objectives. It successfully creates a GitHub Discussion for release announcements with a nicely formatted message.

Consider adding a link to the GitHub Discussions page in the resources section of the announcement. This could help users easily navigate to other discussions. You can add this line after the existing resources:

🗨️ Join the discussion: <https://github.com/${{ github.repository }}/discussions>

This addition would provide a direct link for users to engage in conversations about the release.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 870d059 and 0b173a4.

📒 Files selected for processing (1)
  • .github/workflows/notify-release.yml (1 hunks)
🧰 Additional context used
🪛 actionlint
.github/workflows/notify-release.yml

20-20: shellcheck reported issue in this script: SC2086:info:6:20: Double quote to prevent globbing and word splitting

(shellcheck)


20-20: shellcheck reported issue in this script: SC2295:info:8:31: Expansions inside ${..} need to be quoted separately, otherwise they match as patterns

(shellcheck)


20-20: shellcheck reported issue in this script: SC2086:info:9:32: Double quote to prevent globbing and word splitting

(shellcheck)

🔇 Additional comments (3)
.github/workflows/notify-release.yml (3)

7-10: LGTM: Manual workflow trigger added successfully

The addition of the workflow_dispatch trigger with an optional tag input aligns well with the PR objective. This change provides the desired flexibility to manually trigger release notifications when needed.


80-80: LGTM: Appropriate updates to the docs job

The changes to the update-docs job are well-implemented:

  1. The added condition if: github.event_name != 'workflow_dispatch' ensures that the docs are not updated during manual invocations, which is appropriate.
  2. The URL formatting adjustments improve consistency in the workflow file.

These changes contribute to a more robust and maintainable workflow.

Also applies to: 85-86


Line range hint 1-95: Great job: Workflow changes align perfectly with PR objectives

The modifications to this workflow file successfully implement all the stated objectives of the PR:

  1. Discord notifications for releases have been removed.
  2. GitHub Discussions are now used as the main channel for release notifications.
  3. Manual triggering of notifications for releases has been added via the workflow_dispatch event.

The overall structure of the workflow is logical, easy to follow, and adheres to GitHub Actions best practices. The separation of concerns between the set-env, notify-github-discussion, and update-docs jobs is well-thought-out and promotes maintainability.

These changes effectively centralize release communication within the GitHub platform while providing the flexibility for manual notifications when needed. Great work on implementing these improvements!

🧰 Tools
🪛 actionlint

20-20: shellcheck reported issue in this script: SC2086:info:6:20: Double quote to prevent globbing and word splitting

(shellcheck)


20-20: shellcheck reported issue in this script: SC2295:info:8:31: Expansions inside ${..} need to be quoted separately, otherwise they match as patterns

(shellcheck)


20-20: shellcheck reported issue in this script: SC2086:info:9:32: Double quote to prevent globbing and word splitting

(shellcheck)

@ccamel ccamel merged commit 53c093c into main Oct 16, 2024
11 checks passed
@ccamel ccamel deleted the ci/notify-discussions-release branch October 16, 2024 16:49
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.

3 participants