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

llm-pr-writer 0.4.0 : switch to github-script for posting github comment for flexibility #680

Merged
merged 1 commit into from
Oct 24, 2024

Conversation

kalanyuz
Copy link
Collaborator

Following the patch in 0.3.1, 0.4.0 switches over to github-action scripts to update specific comment_id instead of deciding to update the last message if it's made by the script, which has low spam reduction effect in bot-busy environments.

To test the effectiveness of the script, here are 4 test cases:

@kalanyuz
Copy link
Collaborator Author

cc: @chainchad
@Tofel helped me realized that the changes introduced is still not performing well so I have stopped trying to use gh pr to update comment entirely. Also added a test case with other bot comments so this time should be more solid.

@@ -160,10 +161,11 @@ runs:
$(cat chatgpt_output.txt)
</$WORKFLOW_ID>"

# post the error report to the PR
# prepare the report message
${{ github.action_path }}/update_pr_comment.sh
Copy link
Contributor

Choose a reason for hiding this comment

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

that's a nice one, didn't know about ${{ github.action_path }}

@@ -9,21 +9,22 @@ set -euo pipefail
# - SKIP_ON_SUCCESS

# Fetch the comments on the pull request and filter for comments by github.actor
author_comments=$(gh pr view "$PR_NUMBER" --json comments --jq '.comments | map(select(.author.login == "github-actions" and (.body | contains("## AER Report:"))))')
author_comments=$(gh pr view "$PR_NUMBER" --json comments --jq '(
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe this should be renamed to last_author_comment?

@kalanyuz kalanyuz merged commit 66ebbd3 into main Oct 24, 2024
11 checks passed
@kalanyuz kalanyuz deleted the feat/llm-aer-040 branch October 24, 2024 14:45
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