Skip to content

refactor(ci): add more tests, more logs#261

Merged
gregberge merged 2 commits intomainfrom
more-test-logs
Dec 15, 2025
Merged

refactor(ci): add more tests, more logs#261
gregberge merged 2 commits intomainfrom
more-test-logs

Conversation

@gregberge
Copy link
Member

No description provided.

@gregberge gregberge requested review from a team, Copilot and jsfez and removed request for a team December 15, 2025 08:11
@vercel
Copy link

vercel bot commented Dec 15, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
argos-js-sdk-reference Ready Ready Preview, Comment Dec 15, 2025 8:30am

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the GitHub Actions CI environment service by extracting GitHub API-related functionality into a separate module and adding comprehensive test coverage. The refactoring improves code organization and maintainability while adding enhanced logging for debugging.

Key Changes

  • Extracted GitHub API functions (getPullRequestFromHeadSha, getPullRequestFromPrNumber, getPRNumberFromMergeGroupBranch) from github-actions.ts into a new reusable github.ts module
  • Improved error handling with more descriptive error messages including HTTP status codes
  • Added comprehensive unit tests for the extracted GitHub functions using MSW for API mocking
  • Enhanced debug logging throughout the pull request detection logic

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
packages/core/src/ci-environment/services/github-actions.ts Refactored to extract GitHub API logic, reorganized helper functions (getBranch, getSha, getPullRequest), and added enhanced debug logging for merge group PR detection
packages/core/src/ci-environment/github.ts New module containing extracted GitHub API functions with improved error handling and dedicated GitHub token management
packages/core/src/ci-environment/github.test.ts New test file with comprehensive unit tests for GitHub API functions covering success cases, null token scenarios, and PR extraction from merge group branches
Comments suppressed due to low confidence (1)

packages/core/src/ci-environment/services/github-actions.ts:197

  • Redundant condition check: payload.pull_request is checked twice in the same conditional statement. The second check on line 196 is unnecessary and can be removed.
  if (
    "pull_request" in payload &&
    payload.pull_request &&
    payload.pull_request
  ) {

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gregberge gregberge merged commit a0e3c43 into main Dec 15, 2025
65 checks passed
@gregberge gregberge deleted the more-test-logs branch December 15, 2025 09:08
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