Skip to content

List every PR comment command in /help, not just the first per job - #837

Merged
kmontemayor2-sc merged 10 commits into
mainfrom
kmonte/help-text-lists-all-commands
Nov 5, 2026
Merged

kmontemayor2-sc merged 10 commits into
mainfrom
kmonte/help-text-lists-all-commands

Conversation

@kmontemayor2-sc

Copy link
Copy Markdown
Collaborator

Scope of work done

/help only listed the first contains(github.event.comment.body, ...) command in each job's if:, so /unit_test and /all_test never showed up even though they trigger jobs. get_help_text.py now collects every contains and endsWith command in the condition, deduplicates them in order, and lists them all on the job's line.

Before and after, from the repo root against all workflows under .github/workflows (excerpt):

# before
- `/unit_test_py` - Run Python Unit Tests
- `/unit_test_cpp` - Run C++ Unit Tests
- `/unit_test_scala` - Run Scala Unit Tests
- `/integration_test` - Run Integration Tests
- `/e2e_test` - Run E2E Tests
- `/lint_test` - Run Linting Tests

# after
- `/unit_test_py`, `/unit_test`, `/all_test` - Run Python Unit Tests
- `/unit_test_cpp`, `/unit_test`, `/all_test` - Run C++ Unit Tests
- `/unit_test_scala`, `/unit_test`, `/all_test` - Run Scala Unit Tests
- `/integration_test`, `/all_test` - Run Integration Tests
- `/e2e_test`, `/all_test` - Run E2E Tests
- `/lint_test`, `/all_test` - Run Linting Tests

The script no longer pre-filters on contains(github.event.comment.body,; the regex decides, so jobs that use only endsWith are also picked up. Jobs with an outputs: key are skipped: they feed other jobs (for example a plan job that builds a matrix) and are never a command, and with endsWith now matched they would show up as a bogus command. The /help usage line now says /unit_test only works as the last token of the comment (the workflows match it with endsWith). The script imports PyYAML, so run it in an environment that has it (the gh-actions dependency group).

Where is the documentation for this feature?: N/A

Did you add automated tests or write a test plan?

No test added; the repo has no existing tests for .github/scripts/. Test plan, run on the branch head:

  • python .github/scripts/get_help_text.py (the same invocation as the help job, with PyYAML installed): the output above. Diffed against the output of main's script, the only difference is the added /unit_test usage sentence plus the extra commands per job shown above.
  • Same run, output unchanged on main's workflows (the skip only matters for a job with outputs:; main has none that match a command).
  • ruff check and ruff format --check on .github/scripts examples gigl tests snapchat scripts: All checks passed, 697 files already formatted.
  • ty check on the same paths: All checks passed.

Updated Changelog.md? NO (CI helper script only; no user-facing library change)

Ready for code review?: YES

🤖 Generated with Claude Code

kmonte and others added 8 commits October 5, 2026 16:46
get_help_text.py took only the first `contains(github.event.comment.body, ...)`
match in each job's `if`, so /help showed one command per job and hid
the others. /all_test, which triggers the unit, integration, e2e and
lint jobs, never appeared at all.

Collect every match with re.findall and list them, deduplicated, on the
job's line, e.g. "`/e2e_test`, `/all_test` - Run E2E Tests".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Three jobs trigger on a comment that ends with `/unit_test`, which the
workflow expresses with endsWith rather than contains. The help text
skipped those, so the one command its footer uses as an example was
missing from the list. The regex now accepts both functions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The contains() pre-filter skipped jobs that only use endsWith, so their
commands never reached the regex. Drop it and let findall decide. Also
state that /unit_test only matches at the end of a comment, and build the
command list with an explicit join.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A job that has an outputs key feeds other jobs (for example a plan job
that builds a matrix) and is never a PR comment command. With endsWith
matched, such a job would be listed as a command, so skip it explicitly.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@yliu2-sc yliu2-sc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks!

@kmontemayor2-sc
kmontemayor2-sc marked this pull request as ready for review November 5, 2026 02:26
@kmontemayor2-sc
kmontemayor2-sc added this pull request to the merge queue Nov 5, 2026
Merged via the queue into main with commit fd92c79 Nov 5, 2026
7 checks passed
@kmontemayor2-sc
kmontemayor2-sc deleted the kmonte/help-text-lists-all-commands branch November 5, 2026 06:06
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.

4 participants