FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat: allow conditional skip on success and fail comments by babblebey · Pull Request #874 · semantic-release/github · GitHub

Repository navigation

feat: allow conditional skip on success and fail comments - #874

Merged
babblebey merged 79 commits into
masterfrom
feat/conditional-success-fail-comment-skip
Sep 2, 2024
Merged

babblebey merged 79 commits into
masterfrom
feat/conditional-success-fail-comment-skip

Conversation

babblebey commented Jul 10, 2024 •
edited by hearts Bot
Loading

Copy link
Copy Markdown
Member

This PR Intend to transfer the flow from semantic-release/gitlab#730 to the github plugin. It introduces the new properties into the configuration option, which are used to perform the stated function.

  • failCommentCondition - used to state the conditions by which the failComment is posted or not
  • successCommentCondition - used to state the conditions by which the successComment is posted or not and where it is posted

Changes Made

  • Added deprecation notice for failTitle, failComment and successComment set as false
  • Introduced logic to fetch more data for issues parsed from pull request body and commit messages to aid successCommentCondition filtering (more datails in feat: allow conditional skip on success and fail comments #874 (comment))
  • Introduced utility to help perform stated functionality
    • buildRelatedIssuesQuery - Builds GraphQL query for fetching PRs/Commits related Issues to a list of commit hash (sha) from parsedIssue number
    • buildAssociatedPRsQuery - Builds GraphQL query for fetching associated PRs to a list of commit hash (sha)
    • buildIssuesOrPRsFromResponseNode - Build associatedPRs or RelatedIssues object (into issue-like object with pull_request property) from the GraphQL repository response

Related Issue

Closes #360
Closes #359
Closes #666
Resolves #529

Screencast/Screenshot

  • Demo "successCommentCondition": false - Do not add Success comment to any Issue or PR
screencast-bpconcjcammlapcogcnnelfmaeghhagj-2024.3.mp4
  • Demo "successCommentCondition": "<% return issue.pull_request; %>" - Add Success comment to only Pull Requests
screencast-bpconcjcammlapcogcnnelfmaeghhagj-2024.4.mp4
  • Demo "successCommentCondition": "<% return !issue.pull_request; %>" - Add Success comment to only Issues
screencast-bpconcjcammlapcogcnnelfmaeghhagj-2024.5.mp4

Comment thread lib/success.js Outdated
Comment thread test/fail.test.js
Comment thread lib/fail.js

babblebey left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Hello @fgreinacher,

Kindly help me clarify these observations... see review comments..

…t comment on existing issues when "failCommentCondition" is disallows it`
Comment thread lib/fail.js

JonasSchubert left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

As @fgreinacher said, awesome you picked that up so quickly, @babblebey , thanks a lot! Just found a small typo in one unit test description, beside that it looks good for me.
Will you also add unit tests for success.js?

Comment thread test/fail.test.js Outdated
Co-authored-by: Jonas Schubert <jonas.schubert.projects@web.de>

babblebey commented Jul 16, 2024 •
edited by hearts Bot
Loading

Copy link
Copy Markdown
Member Author

Will you also add unit tests for success.js?

Yea, working on that 😉

Comment thread lib/success.js Outdated
Comment thread lib/fail.js Outdated
Comment thread lib/fail.js Outdated
Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com>
babblebey marked this pull request as ready for review August 30, 2024 20:33
babblebey merged commit e097d1c into master Sep 2, 2024
babblebey deleted the feat/conditional-success-fail-comment-skip branch September 2, 2024 16:46

github-actions Bot commented Sep 2, 2024

Copy link
Copy Markdown

🎉 This issue has been resolved in version 10.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

5 participants


Back | FazBrowse Home | New Git URL