Repository navigation
fix(dispatch): log why comment-triggered dispatches are skipped #5214
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -107,6 +107,21 @@ jobs: | |
| return 1 | ||
| } | ||
|
|
||
| comment_from_user() { | ||
| if [[ "${COMMENT_USER_TYPE}" == "Bot" ]]; then | ||
| echo "::notice::Skipping dispatch for bot comment" | ||
| return 1 | ||
| fi | ||
| return 0 | ||
| } | ||
| comment_from_authorized_user() { | ||
| if ! is_authorized; then | ||
| echo "::notice::Skipping dispatch for unauthorized comment from ${COMMENT_USER_LOGIN}" | ||
| return 1 | ||
| fi | ||
| return comment_from_user | ||
| } | ||
|
Comment on lines
+117
to
+123
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 2. Bad bash return value comment_from_authorized_user() uses return comment_from_user, but return requires a numeric status, so the function errors and returns non-zero even for authorized human comments. As a result, every if comment_from_authorized_user; then ... branch is skipped and comment-triggered stages won’t dispatch. Agent Prompt
Comment on lines
+110
to
+123
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 3. Bot notice precedence wrong comment_from_authorized_user() checks is_authorized before the bot filter, so an unauthorized bot comment emits the “unauthorized comment” notice and never emits the intended bot-skip notice. This also performs an unnecessary permission check (gh api) for bot comments that could be rejected immediately. Agent Prompt
|
||
|
|
||
| # Extract the first word of the comment as the command | ||
| COMMAND="" | ||
| if [[ -n "${COMMENT_BODY:-}" ]]; then | ||
|
|
@@ -117,34 +132,34 @@ jobs: | |
| issue_comment) | ||
| case "${COMMAND}" in | ||
| /fs-triage) | ||
| if [[ "${COMMENT_USER_TYPE}" != "Bot" ]] && is_authorized; then | ||
| if comment_from_authorized_user; then | ||
| STAGE="triage" | ||
| fi | ||
| ;; | ||
| /fs-code) | ||
| if [[ "${ISSUE_HAS_PR}" == "false" ]]; then | ||
| if [[ "${COMMENT_USER_TYPE}" != "Bot" ]] && is_authorized; then | ||
| if comment_from_authorized_user; then | ||
| STAGE="code" | ||
| fi | ||
| fi | ||
| ;; | ||
| /fs-review) | ||
| if [[ "${ISSUE_HAS_PR}" == "true" ]]; then | ||
| if [[ "${COMMENT_USER_TYPE}" != "Bot" ]] && is_authorized; then | ||
| if comment_from_authorized_user; then | ||
| STAGE="review" | ||
| fi | ||
| fi | ||
| ;; | ||
| /fs-fix) | ||
| if [[ "${ISSUE_HAS_PR}" == "true" ]]; then | ||
| if [[ "${COMMENT_USER_TYPE}" != "Bot" ]] && is_authorized; then | ||
| if comment_from_authorized_user; then | ||
| STAGE="fix" | ||
| TRIGGER_SOURCE="${COMMENT_USER_LOGIN}" | ||
| fi | ||
| fi | ||
| ;; | ||
| /fs-retro|/fullsend) | ||
| if [[ "${COMMENT_USER_TYPE}" != "Bot" ]] && is_authorized; then | ||
| if comment_from_authorized_user; then | ||
| if [[ "${COMMAND}" == "/fullsend" ]]; then | ||
| SECOND_WORD="$(printf '%s\n' "${COMMENT_BODY}" | head -1 | tr -d '\r' | awk '{print $2}')" | ||
| if [[ "${SECOND_WORD}" == "retro" ]]; then | ||
|
|
@@ -156,7 +171,7 @@ jobs: | |
| fi | ||
| ;; | ||
| /fs-prioritize) | ||
| if [[ "${COMMENT_USER_TYPE}" != "Bot" ]] && is_authorized; then | ||
| if comment_from_authorized_user; then | ||
| STAGE="prioritize" | ||
| fi | ||
| ;; | ||
|
|
@@ -165,7 +180,7 @@ jobs: | |
| # re-trigger triage by providing clarification on needs-info | ||
| # issues. Full write-permission check is not required here. | ||
| if has_label "needs-info" && ! has_label "feature"; then | ||
| if [[ "${COMMENT_USER_TYPE}" != "Bot" ]]; then | ||
| if comment_from_user; then | ||
| if [[ "${COMMENT_AUTHOR_ASSOC}" != "NONE" ]] || is_issue_author; then | ||
| STAGE="triage" | ||
| fi | ||
|
|
||
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.
1. Dispatch routing checks out-of-sync
📘 Rule violation⚙ MaintainabilityAgent Prompt
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools