GlueOps / github-actions-opentofu-continuous-delivery

4 stars 0 forks source link

major: update slack messages #35

Closed venkatamutyala closed 2 weeks ago

venkatamutyala commented 2 weeks ago

PR Type

enhancement


Description


Changes walkthrough ๐Ÿ“

Relevant files
Enhancement
action.yml
Enhance Slack notifications with Block Kit and structured messages

action.yml
  • Updated Slack notification messages to use Block Kit format.
  • Added structured attachments for approval, success, and failure
    notifications.
  • Changed color codes for different notification types.
  • +42/-7   

    ๐Ÿ’ก PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    codiumai-pr-agent-free[bot] commented 2 weeks ago

    PR Reviewer Guide ๐Ÿ”

    Here are some key observations to aid the review process:

    โฑ๏ธ Estimated effort to review: 2 ๐Ÿ”ต๐Ÿ”ตโšชโšชโšช
    ๐Ÿงช No relevant tests
    ๐Ÿ”’ No security concerns identified
    โšก Recommended focus areas for review

    Inconsistent Formatting
    The new Slack message format uses both "{{ github.repository }}" and "${{ github.repository }}" for variable substitution. This inconsistency might lead to rendering issues. Hardcoded Colors
    Color codes are hardcoded as strings (e.g., "dbab09", "00FF00", "FF0000"). Consider using variables or constants for better maintainability.
    codiumai-pr-agent-free[bot] commented 2 weeks ago

    PR Code Suggestions โœจ

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Score
    Maintainability
    Use environment variables for repeated values to improve maintainability and reduce redundancy ___ **Consider using environment variables for repeated values like the GitHub repository
    URL and run ID to improve maintainability and reduce redundancy.** [action.yml [153]](https://github.com/GlueOps/github-actions-opentofu-continuous-delivery/pull/35/files#diff-1243c5424efaaa19bd8e813c5e6f6da46316e63761421b3e5f5c8ced9a36e6b6R153-R153) ```diff -"pretext": "View Job/Status: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}", +"pretext": "View Job/Status: ${{ env.GITHUB_JOB_URL }}", ``` - [ ] **Apply this suggestion**
    Suggestion importance[1-10]: 8 Why: This suggestion improves maintainability by reducing redundancy and centralizing the URL construction, which can help prevent errors and make future updates easier.
    8
    Best practice
    Standardize color format across all notifications for better consistency ___ **Consider using a consistent color format across all notifications. Currently, you're
    mixing hexadecimal (e.g., "dbab09") and named colors (e.g., "00FF00"). Stick to one
    format for better consistency.** [action.yml [154-234]](https://github.com/GlueOps/github-actions-opentofu-continuous-delivery/pull/35/files#diff-1243c5424efaaa19bd8e813c5e6f6da46316e63761421b3e5f5c8ced9a36e6b6R154-R234) ```diff -"color": "dbab09", +"color": "#dbab09", ... -"color": "00FF00", +"color": "#00ff00", ... -"color": "FF0000", +"color": "#ff0000", ```
    Suggestion importance[1-10]: 7 Why: Standardizing the color format enhances consistency and readability, which is a good practice, although it does not impact functionality.
    7
    Enhancement
    Enhance notification content with more detailed workflow context information ___ **Consider adding more detailed information in the "value" field for each notification
    type, such as the branch name or commit hash, to provide more context about the
    workflow run.** [action.yml [159-239]](https://github.com/GlueOps/github-actions-opentofu-continuous-delivery/pull/35/files#diff-1243c5424efaaa19bd8e813c5e6f6da46316e63761421b3e5f5c8ced9a36e6b6R159-R239) ```diff -"value": "Approval Required: https://github.com/${{ github.repository }}/issues " +"value": "Approval Required for branch: ${{ github.ref_name }} (commit: ${{ github.sha }})" ... -"value": "SUCCESS" +"value": "SUCCESS on branch: ${{ github.ref_name }} (commit: ${{ github.sha }})" ... -"value": "FAILURE" +"value": "FAILURE on branch: ${{ github.ref_name }} (commit: ${{ github.sha }})" ```
    Suggestion importance[1-10]: 7 Why: Adding more detailed information provides better context for users, which can be valuable for debugging and understanding the workflow's status, though it is not essential for the workflow's operation.
    7
    Improve notification titles to provide clearer context for each message type ___ **Consider adding more descriptive titles for each notification type to provide
    clearer context at a glance.** [action.yml [150-230]](https://github.com/GlueOps/github-actions-opentofu-continuous-delivery/pull/35/files#diff-1243c5424efaaa19bd8e813c5e6f6da46316e63761421b3e5f5c8ced9a36e6b6R150-R230) ```diff -"text": "Workflow needs approval", +"text": "Terraform Plan: Approval Required", ... -"text": "Workflow - SUCCESS", +"text": "Terraform Apply: Successful", ... -"text": "Workflow - FAILURE", +"text": "Terraform Apply: Failed", ```
    Suggestion importance[1-10]: 6 Why: This suggestion enhances the clarity of notifications, making it easier for users to understand the context at a glance, although it is not critical for functionality.
    6

    ๐Ÿ’ก Need additional feedback ? start a PR chat