Skip to content

Add branch and run ID filtering support to logs command#814

Merged
pelikhan merged 3 commits intomainfrom
copilot/fix-7b4b57b1-0647-4621-9c5c-44cb1d2da8ad
Sep 14, 2025
Merged

Add branch and run ID filtering support to logs command#814
pelikhan merged 3 commits intomainfrom
copilot/fix-7b4b57b1-0647-4621-9c5c-44cb1d2da8ad

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Sep 13, 2025

Adds new filtering capabilities to the gh aw logs command to support filtering workflow runs by branch name and run ID ranges, addressing the requirements in the issue.

New Features

Branch Filtering

  • --branch string - Filter workflow runs by git branch name (e.g., main, feature-xyz)
  • Integrates with GitHub CLI's native --branch parameter for efficient server-side filtering

Run ID Range Filtering

  • --before-run-id int - Filter runs with database ID before specified value (exclusive)
  • --after-run-id int - Filter runs with database ID after specified value (exclusive)
  • Can be combined for range filtering: --after-run-id 1000 --before-run-id 2000

Usage Examples

# Filter by branch
gh aw logs --branch main
gh aw logs --branch feature-xyz

# Filter by run ID range
gh aw logs --after-run-id 1000        # Runs after ID 1000
gh aw logs --before-run-id 2000       # Runs before ID 2000
gh aw logs --after-run-id 1000 --before-run-id 2000  # Range filtering

# Combine with existing filters
gh aw logs --branch main --engine claude --count 10

Implementation Details

  • Branch filtering: Uses GitHub CLI's --branch parameter for server-side filtering
  • Run ID filtering: Applied as post-processing filter since GitHub CLI doesn't support database ID filtering natively
  • Backward compatibility: All existing functionality preserved, no breaking changes
  • Console formatting: Follows existing patterns with proper styled output

Testing

  • Added comprehensive unit tests for new filtering logic
  • Updated all existing tests to match new function signatures
  • All 331+ tests pass (Go + JavaScript)
  • Manual validation of CLI integration and help text

The implementation maintains the existing codebase patterns while providing the requested filtering capabilities for better workflow log analysis and debugging workflows.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api.contoso.com
    • Triggering command: /tmp/go-build3648223290/b001/cli.test -test.testlogfile=/tmp/go-build3648223290/b001/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true (dns block)
    • Triggering command: /tmp/go-build265650353/b278/cli.test -test.testlogfile=/tmp/go-build265650353/b278/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true (dns block)
    • Triggering command: /tmp/go-build2254096700/b278/cli.test -test.testlogfile=/tmp/go-build2254096700/b278/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI and others added 2 commits September 13, 2025 23:42
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…ering for logs command

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Update "logs" command to support filtering logs by branch name and by runid range (--before-run-id ...) and (--after-run-id ...) Add branch and run ID filtering support to logs command Sep 13, 2025
Copilot AI requested a review from pelikhan September 13, 2025 23:47
@pelikhan pelikhan marked this pull request as ready for review September 14, 2025 02:37
@pelikhan pelikhan merged commit 4015ed4 into main Sep 14, 2025
10 of 18 checks passed
@pelikhan pelikhan deleted the copilot/fix-7b4b57b1-0647-4621-9c5c-44cb1d2da8ad branch September 14, 2025 05:12
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.

2 participants