Skip to content

refactor: replace HTTP server with file-based metrics, require GitHub token#7

Merged
Garbee merged 6 commits intomainfrom
copilot/analyze-server-necessity
Feb 14, 2026
Merged

refactor: replace HTTP server with file-based metrics, require GitHub token#7
Garbee merged 6 commits intomainfrom
copilot/analyze-server-necessity

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 14, 2026

Replaces HTTP server architecture with file-based metrics storage and removes manual step marker support. GitHub token now required for automatic step tracking.

Changes

Architecture shift: HTTP → File-based

  • Removed server.ts (HTTP server on port 7777, REST endpoints for metrics/markers)
  • Added collector.ts (background process writing to temp file)
  • Metrics written to /tmp/metrics-{GITHUB_RUN_ID}-{GITHUB_JOB}.json after each collection cycle
  • Eliminates port conflicts, server readiness checks, and network stack dependency

Removed manual step markers

  • Deleted mark-step.ts CLI tool and Metrics.markStep() method
  • Removed manual marker merge logic in post action
  • Step tracking now exclusively via GitHub API

Made github-token required

  • action.yml: changed input from optional to required
  • fetchWorkflowSteps(): throws if token missing (was silent fallback to empty array)
  • Post action always uses API-fetched steps

Migration

# Before (optional token, manual markers supported)
- uses: garbee/actions-workflow-metrics@v1

# After (required token, automatic tracking only)
- uses: garbee/actions-workflow-metrics@v1
  with:
    github-token: ${{ secrets.GITHUB_TOKEN }}

Stats

  • 19 files changed: +324, -573 lines
  • Removed get-port dependency
  • Reduced bundle size ~518KB (removed mark-step bundle)
  • 29 tests passing

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits February 14, 2026 10:35
- Remove server.ts HTTP server implementation
- Add collector.ts for background metrics collection
- Add mark-step.ts helper script for manual step markers
- Update Metrics class to write to temporary file
- Update post action to read from file instead of HTTP
- All tests passing with new file-based approach

Co-authored-by: Garbee <868301+Garbee@users.noreply.github.com>
- Update README.md to reflect file-based architecture
- Update CLAUDE.md with new architecture details
- Remove server.ts and server.bundle.js
- Remove get-port dependency (no longer needed)
- Simplify test workflow (no server readiness check)
- Manual markers now documented as deprecated in favor of automatic step detection

Co-authored-by: Garbee <868301+Garbee@users.noreply.github.com>
- Add comments documenting race condition in markStep methods
- Note that manual markers are deprecated in favor of automatic detection
- Remove outdated AbortController timeout reference from CLAUDE.md
- Race condition is acceptable since manual markers are deprecated

Co-authored-by: Garbee <868301+Garbee@users.noreply.github.com>
Copilot AI changed the title [WIP] Analyze necessity of server for data handling Replace HTTP server with file-based metrics storage Feb 14, 2026
Copilot AI requested a review from Garbee February 14, 2026 10:40
- Make github-token required in action.yml
- Remove markStep() method from Metrics class
- Remove mark-step.ts script and its bundle
- Update fetchWorkflowSteps to require token and fail if not provided
- Remove manual marker merge logic from post action
- Remove test-manual-step-markers job from workflow
- Add github-token to test-basic job
- Remove markStep test cases
- Update README to remove manual markers documentation
- Update CLAUDE.md to reflect changes
- All tests passing (29/29)

Co-authored-by: Garbee <868301+Garbee@users.noreply.github.com>
Copilot AI changed the title Replace HTTP server with file-based metrics storage Remove manual step markers and require GitHub token Feb 14, 2026
Copilot AI changed the title Remove manual step markers and require GitHub token refactor!: replace HTTP server with file-based metrics, require GitHub token Feb 14, 2026
@Garbee Garbee changed the title refactor!: replace HTTP server with file-based metrics, require GitHub token refactor: replace HTTP server with file-based metrics, require GitHub token Feb 14, 2026
Added a step to start workflow telemetry with GitHub token.

Signed-off-by: Jonathan Garbee <jonathan@garbee.me>
@Garbee Garbee marked this pull request as ready for review February 14, 2026 11:00
@Garbee Garbee merged commit 0e890a8 into main Feb 14, 2026
6 checks passed
@Garbee Garbee deleted the copilot/analyze-server-necessity branch February 14, 2026 19:24
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