-
-
Notifications
You must be signed in to change notification settings - Fork 0
ci: replace separate workflows with unified Sentinel Gate #115
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
base: master
Are you sure you want to change the base?
Conversation
- Remove fix-php-code-style-issues.yml - Remove phpstan.yml - Remove run-tests.yml - Add gate.yml with 100% coverage requirement This consolidates CI into a single gate check. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Warning Rate limit exceeded@jordanpartridge has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 26 minutes and 43 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (58)
📝 WalkthroughWalkthroughRemoves three existing CI workflows (PHP code style, PHPStan, run-tests), adds a new "Sentinel Gate" workflow, and introduces a large set of new PHPUnit/Pest request tests under tests/Requests covering various GitHub API request classes. Changes
Sequence Diagram(s)(omitted) Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
📊 Coverage Report
Files Below Threshold
🏆 Synapse Sentinel Gate |
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.
Actionable comments posted: 3
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
.github/workflows/fix-php-code-style-issues.yml.github/workflows/gate.yml.github/workflows/phpstan.yml.github/workflows/run-tests.yml
💤 Files with no reviewable changes (3)
- .github/workflows/run-tests.yml
- .github/workflows/fix-php-code-style-issues.yml
- .github/workflows/phpstan.yml
🔇 Additional comments (4)
.github/workflows/gate.yml (4)
1-7: LGTM!The workflow name and trigger configuration are appropriate for a unified gate workflow.
9-12: LGTM!Job configuration is standard and appropriate.
18-19: LGTM!Standard checkout action usage is correct.
13-17: Remove unnecessaryissues: writepermission.The
synapse-sentinel/gateaction'saction.ymlexplicitly documents that it requireschecks: writefor creating check runs. Thecontents: writeandpull-requests: writepermissions are necessary for auto-merge functionality. However,issues: writedoes not appear in the action's documented inputs or requirements and should be removed to follow the principle of least privilege.
| - uses: synapse-sentinel/gate@v1 | ||
| with: | ||
| check: certify | ||
| coverage-threshold: 100 | ||
| auto-merge: true | ||
| coverage-comment: true | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} |
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.
🧩 Analysis chain
🌐 Web query:
synapse-sentinel/gate GitHub action
💡 Result:
I couldn't find a GitHub repository or published Action named "synapse-sentinel/gate" on GitHub. Could you paste a link or give more context (owner, exact repo name, or where you saw it)?
🏁 Script executed:
# Check if the gate.yml file exists and view the full workflow
git ls-files ".github/workflows/*.yml" | grep -i gateRepository: jordanpartridge/github-client
Length of output: 99
🌐 Web query:
synapse sentinel GitHub action gate checks
💡 Result:
Do you mean:
- Azure Synapse (workspace) GitHub Action gate checks (CI/CD pre-deploy validations),
- Azure Sentinel content repository GitHub Actions (policy/PR gate checks for Sentinel rules/workbooks), or
- a specific GitHub Action named "synapse-sentinel" or "synapse sentinel"?
Tell me which one and your goal (e.g., run schema/KQL validation, block PR merges, run ARM/Bicep validation, deploy approvals), and I’ll fetch examples and config snippets.
🏁 Script executed:
# Read the full gate.yml workflow file
cat -n .github/workflows/gate.ymlRepository: jordanpartridge/github-client
Length of output: 790
🏁 Script executed:
# Check if there are custom actions defined in the repository
find .github/actions -type f -name "*.yml" -o -name "*.yaml" 2>/dev/null | head -20Repository: jordanpartridge/github-client
Length of output: 55
🏁 Script executed:
# Search for "synapse-sentinel" anywhere in the repository
rg "synapse-sentinel" --type yaml --type ymlRepository: jordanpartridge/github-client
Length of output: 100
🏁 Script executed:
# Search for synapse-sentinel anywhere in repo without type restriction
rg "synapse-sentinel"Repository: jordanpartridge/github-client
Length of output: 55
🏁 Script executed:
# Check if custom actions directory exists
ls -la .github/ | grep -E "^d"Repository: jordanpartridge/github-client
Length of output: 298
🏁 Script executed:
# If custom actions exist, list them
if [ -d ".github/actions" ]; then find .github/actions -type f; else echo "No .github/actions directory"; fiRepository: jordanpartridge/github-client
Length of output: 101
The synapse-sentinel/gate@v1 action does not exist and will cause workflow failures.
This action cannot be found as a published GitHub Action, and there are no custom actions defined in the repository. The workflow will fail immediately when GitHub Actions attempts to resolve this action. Either replace it with a real, maintained action or create a custom action with the required functionality. Additionally, the auto-merge: true setting combined with write permissions creates a security risk—merge decisions should require human review.
🤖 Prompt for AI Agents
.github/workflows/gate.yml lines 20-26: the workflow references a non-existent
action synapse-sentinel/gate@v1 which will cause resolution failures and also
enables risky auto-merge; replace this entry with a real, maintained action (or
implement a local composite/custom action in .github/actions and reference it)
that provides the intended certify/check/coverage features, update any input
names to match the chosen action's documented inputs (e.g., coverage-threshold,
coverage-comment), and remove or disable auto-merge (or set it to false) so
merges require human review; also ensure the workflow's token and permissions
are set minimally (no unnecessary write/merge rights) and validate the corrected
workflow by running a dry-run or linting it.
| - uses: synapse-sentinel/gate@v1 | ||
| with: | ||
| check: certify | ||
| coverage-threshold: 100 |
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.
100% coverage threshold may be too restrictive.
Requiring 100% test coverage can be impractical and may block legitimate PRs. Consider whether this strict threshold aligns with your development workflow, especially for:
- Generated code or boilerplate
- Defensive error handling
- Edge cases with diminishing returns
A threshold of 90-95% is more commonly used in production environments.
🤖 Prompt for AI Agents
In .github/workflows/gate.yml at line 23 the coverage-threshold is set to 100
which is overly strict; update the value to a more practical threshold (e.g.,
95) or replace the hard-coded number with a reusable variable (e.g.,
${COVERAGE_THRESHOLD}) and document/update CI env or repo settings so the
threshold can be adjusted without editing the workflow.
| with: | ||
| check: certify | ||
| coverage-threshold: 100 | ||
| auto-merge: true |
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.
Auto-merge with write permissions poses security risks.
Enabling auto-merge: true combined with broad write permissions means PRs will merge automatically when checks pass, without human review. This can be risky because:
- Code quality issues not caught by automated checks
- Security vulnerabilities may slip through
- Breaking changes to APIs or behavior
- Compromised dependencies could be merged
Consider requiring manual approval for merges, especially for a repository with write access to contents and pull requests.
🤖 Prompt for AI Agents
.github/workflows/gate.yml around line 24: the workflow enables auto-merge
(auto-merge: true) which allows PRs to merge automatically when checks pass and
poses security risks; update the workflow to disable auto-merge by removing or
setting auto-merge to false, and/or add a requirement for manual approval by
configuring branch protection or a required reviewers step (e.g., require at
least one approver or restrict merge permissions to maintainers) so merges
cannot occur solely based on passing checks.
Add 226 tests covering all 41 request classes in src/Requests/: - Actions: ListWorkflows, GetWorkflowRuns, TriggerWorkflow - Commits: Get, Index - Files: Index - Issues: Index, RepoIndex, Get, Create, Update, Comments, CreateComment, GetComment, UpdateComment, DeleteComment - Pulls: Index, IndexWithSummaryDTO, Get, GetWithDetailDTO, Create, Update, Merge, Comments, CommentsWithFilters, GetComment, CreateComment, UpdateComment, DeleteComment, Files, Reviews, CreateReview - Releases: Index, Get, Latest - RateLimit: Get - Repos: Index, Get, Delete, Search - User Tests verify: - HTTP method configuration - Endpoint resolution - Query parameter handling and filtering - Request body construction - Parameter validation (per_page ranges, SHA formats, ID validation) - DTO response method existence 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.
Actionable comments posted: 2
🧹 Nitpick comments (8)
tests/Requests/ActionsRequestsTest.php (1)
19-23: Consider extracting reflection helpers to reduce duplication.The reflection pattern for accessing protected properties and methods is repeated throughout the test file. Extracting helper methods would improve maintainability.
🔎 Example refactor with helper methods
Add these helper functions at the top of the test file or in a shared test trait:
function getProtectedProperty(object $object, string $propertyName): mixed { $reflection = new ReflectionClass($object); $property = $reflection->getProperty($propertyName); $property->setAccessible(true); return $property->getValue($object); } function invokeProtectedMethod(object $object, string $methodName, array $args = []): mixed { $reflection = new ReflectionClass($object); $method = $reflection->getMethod($methodName); $method->setAccessible(true); return $method->invoke($object, ...$args); }Then simplify tests like:
it('uses GET method', function () { $request = new ListWorkflows('owner', 'repo'); - - $reflection = new ReflectionClass($request); - $property = $reflection->getProperty('method'); - $property->setAccessible(true); - - expect($property->getValue($request))->toBe(Method::GET); + expect(getProtectedProperty($request, 'method'))->toBe(Method::GET); });it('accepts pagination parameters', function () { $request = new ListWorkflows('owner', 'repo', per_page: 50, page: 2); - - $reflection = new ReflectionClass($request); - $method = $reflection->getMethod('defaultQuery'); - $method->setAccessible(true); - $query = $method->invoke($request); - + $query = invokeProtectedMethod($request, 'defaultQuery'); expect($query)->toBe(['per_page' => 50, 'page' => 2]); });Also applies to: 29-32, 40-43, 76-80, 95-98, 112-115, 172-176, 183-186
tests/Requests/UserRequestsTest.php (2)
14-22: Consider extracting the HTTP method reflection pattern into a helper function.This reflection pattern is repeated extensively across all request test files. Extracting it would reduce duplication and improve maintainability.
🔎 Suggested helper function
Create a test helper file (e.g.,
tests/Helpers/RequestTestHelpers.php):<?php namespace Tests\Helpers; use ReflectionClass; use Saloon\Enums\Method; function assertRequestMethod(object $request, Method $expectedMethod): void { $reflection = new ReflectionClass($request); $property = $reflection->getProperty('method'); $property->setAccessible(true); expect($property->getValue($request))->toBe($expectedMethod); }Then use it in tests:
it('uses GET method', function () { $request = new User(); - - $reflection = new ReflectionClass($request); - $property = $reflection->getProperty('method'); - $property->setAccessible(true); - - expect($property->getValue($request))->toBe(Method::GET); + assertRequestMethod($request, Method::GET); });
33-38: Consider whether this idempotency test adds value.Testing that
resolveEndpoint()returns the same value on repeated calls is appropriate if there's potential for stateful behavior. However, for a simple deterministic method, this test may be redundant. Consider removing unless there's a specific concern about state management.tests/Requests/RateLimitRequestsTest.php (1)
14-22: Same HTTP method reflection pattern as other test files.This is the same reflection pattern noted in UserRequestsTest.php. Consider using the suggested helper function to reduce duplication across all test files.
tests/Requests/ReleasesRequestsTest.php (1)
26-35: Consider extracting the query parameter reflection pattern into a helper function.Similar to the HTTP method reflection pattern, this query inspection logic is repeated across multiple test files. Extracting it would improve maintainability.
🔎 Suggested helper function
Add to the test helpers:
function getDefaultQuery(object $request): array { $reflection = new ReflectionClass($request); $method = $reflection->getMethod('defaultQuery'); $method->setAccessible(true); return $method->invoke($request); }Then use it:
it('accepts pagination parameters', function () { $request = new Index('owner', 'repo', per_page: 50, page: 2); - - $reflection = new ReflectionClass($request); - $method = $reflection->getMethod('defaultQuery'); - $method->setAccessible(true); - $query = $method->invoke($request); - + $query = getDefaultQuery($request); expect($query)->toBe(['per_page' => 50, 'page' => 2]); });tests/Requests/IssuesRequestsTest.php (1)
183-206: Consider extracting the body parameter reflection pattern into a helper function.Similar to the query parameter pattern, this body inspection logic using
defaultBodyis repeated multiple times. A helper function would reduce duplication.🔎 Suggested helper function
Add to test helpers:
function getDefaultBody(object $request): array { $reflection = new ReflectionClass($request); $method = $reflection->getMethod('defaultBody'); $method->setAccessible(true); return $method->invoke($request); }Then use throughout the file:
it('includes all body parameters when provided', function () { $request = new Create( 'owner', 'repo', 'Test Issue', bodyText: 'Issue body', assignees: ['user1', 'user2'], milestone: 1, labels: ['bug', 'priority'], ); - - $reflection = new ReflectionClass($request); - $method = $reflection->getMethod('defaultBody'); - $method->setAccessible(true); - $body = $method->invoke($request); - + $body = getDefaultBody($request); expect($body)->toBe([ 'title' => 'Test Issue', 'body' => 'Issue body', 'assignees' => ['user1', 'user2'], 'milestone' => 1, 'labels' => ['bug', 'priority'], ]); });tests/Requests/ReposRequestsTest.php (1)
14-264: Excellent comprehensive test coverage for Repos requests.This test suite thoroughly validates endpoint resolution, HTTP methods, parameter handling, boundary conditions, and DTO creation across all Repos request classes (Index, Get, Delete, Search). The structure is clear and follows consistent patterns.
Optional: Consider extracting reflection helpers to reduce duplication
The reflection pattern for accessing private properties and methods is repeated throughout the test suite. You could extract these into helper functions to improve maintainability:
function getPrivateProperty(object $object, string $propertyName): mixed { $reflection = new ReflectionClass($object); $property = $reflection->getProperty($propertyName); $property->setAccessible(true); return $property->getValue($object); } function invokePrivateMethod(object $object, string $methodName, ...$args): mixed { $reflection = new ReflectionClass($object); $method = $reflection->getMethod($methodName); $method->setAccessible(true); return $method->invoke($object, ...$args); }This would simplify tests like:
-$reflection = new ReflectionClass($request); -$property = $reflection->getProperty('method'); -$property->setAccessible(true); -expect($property->getValue($request))->toBe(Method::GET); +expect(getPrivateProperty($request, 'method'))->toBe(Method::GET);This applies across all three test files in this PR.
tests/Requests/PullsRequestsTest.php (1)
22-641: Extensive and thorough test coverage for all Pulls request classes.This test suite provides comprehensive validation for 15 different Pulls-related request classes, covering endpoint resolution, HTTP methods (GET, POST, PATCH, PUT, DELETE), parameter validation, body construction, and DTO creation. The tests are well-organized with clear describe blocks and validate important constraints like positive comment IDs, non-empty bodies, and repo name formats.
Notable strengths:
- Thorough merge method testing (default behavior and all method types)
- Proper per_page limiting validation (caps at 100)
- Comprehensive parameter validation across all request types
The optional refactor suggestion for extracting reflection helpers (mentioned in ReposRequestsTest.php) would be particularly beneficial here, as the reflection pattern is repeated 40+ times throughout this file.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (9)
tests/Requests/ActionsRequestsTest.phptests/Requests/CommitsRequestsTest.phptests/Requests/FilesRequestsTest.phptests/Requests/IssuesRequestsTest.phptests/Requests/PullsRequestsTest.phptests/Requests/RateLimitRequestsTest.phptests/Requests/ReleasesRequestsTest.phptests/Requests/ReposRequestsTest.phptests/Requests/UserRequestsTest.php
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2024-11-26T04:43:58.337Z
Learnt from: jordanpartridge
Repo: jordanpartridge/github-client PR: 11
File: src/Requests/Commits/Get.php:26-26
Timestamp: 2024-11-26T04:43:58.337Z
Learning: In the `Get` class (`src/Requests/Commits/Get.php`), the `repo_name` parameter includes both the owner and the repository name in the format 'owner/repo'.
Applied to files:
tests/Requests/CommitsRequestsTest.php
📚 Learning: 2024-11-02T00:16:07.967Z
Learnt from: jordanpartridge
Repo: jordanpartridge/github-client PR: 5
File: src/Resources/RepoResource.php:61-0
Timestamp: 2024-11-02T00:16:07.967Z
Learning: In the `RepoResource` class (`src/Resources/RepoResource.php`), the `all()` method correctly throws `\InvalidArgumentException` and `\TypeError` as documented when invalid parameter values are provided, due to PHP's strict type hinting and validations within the request.
Applied to files:
tests/Requests/CommitsRequestsTest.phptests/Requests/IssuesRequestsTest.phptests/Requests/FilesRequestsTest.phptests/Requests/ReposRequestsTest.phptests/Requests/PullsRequestsTest.php
📚 Learning: 2024-11-02T00:18:45.602Z
Learnt from: jordanpartridge
Repo: jordanpartridge/github-client PR: 5
File: src/Resources/RepoResource.php:85-0
Timestamp: 2024-11-02T00:18:45.602Z
Learning: Input validation for parameters like `$per_page` and `$page` is handled in the request classes (e.g., `src/Requests/Repos/Repos.php`), so it's not necessary to duplicate this validation in the resource methods such as `RepoResource::all()`.
Applied to files:
tests/Requests/ReposRequestsTest.php
🧬 Code graph analysis (5)
tests/Requests/UserRequestsTest.php (1)
src/Requests/User.php (1)
User(8-22)
tests/Requests/CommitsRequestsTest.php (1)
src/Exceptions/ValidationException.php (1)
getValue(38-41)
tests/Requests/ActionsRequestsTest.php (3)
src/Requests/Actions/GetWorkflowRuns.php (1)
GetWorkflowRuns(9-72)src/Requests/Actions/ListWorkflows.php (1)
ListWorkflows(9-42)src/Requests/Actions/TriggerWorkflow.php (1)
TriggerWorkflow(11-49)
tests/Requests/ReleasesRequestsTest.php (1)
src/Requests/Releases/Latest.php (1)
Latest(10-32)
tests/Requests/ReposRequestsTest.php (3)
src/Requests/Repos/Delete.php (1)
Delete(9-21)src/Requests/Repos/Search.php (1)
Search(13-66)src/ValueObjects/Repo.php (2)
Repo(7-91)fromFullName(14-19)
🔇 Additional comments (7)
tests/Requests/ActionsRequestsTest.php (3)
9-64: LGTM! Comprehensive test coverage for ListWorkflows.The test suite thoroughly validates endpoint construction, HTTP method, pagination parameters, null filtering, and boundary conditions. All assertions correctly match the implementation.
66-160: LGTM! Excellent coverage of GetWorkflowRuns with exhaustive validation.This test suite excels at validating all optional parameters, proper filtering, and comprehensive enum value testing. The valid status and conclusion lists correctly match the implementation, ensuring all allowed values are tested.
162-212: LGTM! Thorough validation testing for TriggerWorkflow.The test suite properly validates the POST method, required
reffield, type checking forinputs, and both presence and absence of optional parameters. Edge cases like empty strings are appropriately covered.tests/Requests/ReleasesRequestsTest.php (1)
49-63: Excellent boundary testing for pagination validation.The tests comprehensively cover both invalid cases (0 and 101) and valid boundaries (1 and 100), ensuring the validation logic is robust.
tests/Requests/FilesRequestsTest.php (1)
31-48: Good SHA validation test coverage.The tests appropriately validate SHA format requirements (40 hex characters) with both negative cases (invalid, short, non-hex) and positive cases (lowercase, uppercase).
tests/Requests/IssuesRequestsTest.php (1)
366-374: Good edge case validation for whitespace-only input.Testing that whitespace-only strings are properly rejected ensures robust validation. This is a good defensive programming practice.
tests/Requests/CommitsRequestsTest.php (1)
8-132: Well-structured tests for Commits requests with thorough SHA validation.The test suite comprehensively covers endpoint construction, HTTP method verification, pagination handling, and SHA format validation. The SHA validation tests are particularly thorough, checking 40-character hex requirements, rejecting invalid/short/non-hex formats, and accepting both lowercase and uppercase hex characters.
| it('constructs with valid repo name and commit sha', function () { | ||
| $sha = 'a' . str_repeat('0', 39); | ||
| $request = new Index('owner/repo', $sha); | ||
|
|
||
| expect($request->resolveEndpoint())->toBe('repos/owner/repo/commits/' . $sha . '/files'); | ||
| }); |
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.
Missing leading slash in endpoint expectation.
The expected endpoint is missing a leading slash. Line 12 expects 'repos/owner/repo/commits/...' but should expect '/repos/owner/repo/commits/...'. This is inconsistent with all other endpoint tests in the PR (User: '/user', RateLimit: '/rate_limit', Releases: '/repos/...') and likely incorrect.
🔎 Proposed fix
it('constructs with valid repo name and commit sha', function () {
$sha = 'a' . str_repeat('0', 39);
$request = new Index('owner/repo', $sha);
- expect($request->resolveEndpoint())->toBe('repos/owner/repo/commits/' . $sha . '/files');
+ expect($request->resolveEndpoint())->toBe('/repos/owner/repo/commits/' . $sha . '/files');
});🤖 Prompt for AI Agents
In tests/Requests/FilesRequestsTest.php around lines 8 to 13, the expected
endpoint string is missing the leading slash; update the expectation on line 12
to include a leading '/' so it reads '/repos/owner/repo/commits/{sha}/files' to
match the rest of the tests and the API endpoint format.
| it('constructs endpoint correctly with different repo names', function () { | ||
| $sha = 'a' . str_repeat('0', 39); | ||
| $request = new Index('my-org/my-project', $sha); | ||
|
|
||
| expect($request->resolveEndpoint())->toBe('repos/my-org/my-project/commits/' . $sha . '/files'); | ||
| }); |
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.
Missing leading slash in endpoint expectation (duplicate issue).
Same issue as lines 8-13. The endpoint expectation on Line 61 is missing a leading slash.
🔎 Proposed fix
it('constructs endpoint correctly with different repo names', function () {
$sha = 'a' . str_repeat('0', 39);
$request = new Index('my-org/my-project', $sha);
- expect($request->resolveEndpoint())->toBe('repos/my-org/my-project/commits/' . $sha . '/files');
+ expect($request->resolveEndpoint())->toBe('/repos/my-org/my-project/commits/' . $sha . '/files');
});📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| it('constructs endpoint correctly with different repo names', function () { | |
| $sha = 'a' . str_repeat('0', 39); | |
| $request = new Index('my-org/my-project', $sha); | |
| expect($request->resolveEndpoint())->toBe('repos/my-org/my-project/commits/' . $sha . '/files'); | |
| }); | |
| it('constructs endpoint correctly with different repo names', function () { | |
| $sha = 'a' . str_repeat('0', 39); | |
| $request = new Index('my-org/my-project', $sha); | |
| expect($request->resolveEndpoint())->toBe('/repos/my-org/my-project/commits/' . $sha . '/files'); | |
| }); |
🤖 Prompt for AI Agents
In tests/Requests/FilesRequestsTest.php around lines 57 to 62, the expected
endpoint string is missing the leading slash; update the expectation to include
a leading '/' so it asserts '/repos/my-org/my-project/commits/{sha}/files'
instead of 'repos/...', ensuring consistency with the other test (and adjust any
duplicate expectation at lines 8-13 if present).
Add 223 new tests covering all 27 DTO files in src/Data/ directory: Commits DTOs: - CommitAuthorDataTest.php (3 tests) - CommitStatsDataTest.php (3 tests) - CommitFileDataTest.php (3 tests) - CommitDetailsDataTest.php (4 tests) - CommitDataTest.php (6 tests) Issues DTOs: - IssueDTOTest.php (7 tests) - IssueCommentDTOTest.php (4 tests) - LabelDTOTest.php (5 tests) Pulls DTOs: - PullRequestDTOTest.php (6 tests) - PullRequestCommentDTOTest.php (6 tests) - PullRequestFileDTOTest.php (27 tests) - PullRequestReviewDTOTest.php (7 tests) - CommentMetadataTest.php (19 tests) - MergeResponseDTOTest.php (4 tests) - PullRequestSummaryDTOTest.php (6 tests) - PullRequestDetailDTOTest.php (23 tests) - PullRequestDTOFactoryTest.php (9 tests) - ParamsTest.php (7 tests) Repos DTOs: - RepoDataTest.php (12 tests, moved and enhanced) - LicenseDataTest.php (4 tests) - SearchRepositoriesDataTest.php (6 tests) Releases DTOs: - ReleaseDataTest.php (11 tests) Root-level DTOs: - FileDTOTest.php (7 tests) - TreeDataTest.php (4 tests) - VerificationDataTest.php (6 tests) - RateLimitDTOTest.php (14 tests) - GitUserDataTest.php (9 additional tests) All 668 tests pass with 1856 assertions. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add comprehensive tests for: - All Enum classes (Direction, Sort, MergeMethod, Visibility) - Nested Enums (Issues/Sort, Issues/State, Pulls/Sort, Pulls/State, Repos/State, Repos/Type) - All Resource classes (ActionsResource, BaseResource, CommentsResource, CommitResource, FileResource, IssuesResource, PullRequestResource, PullRequestResourceEnhanced, ReleasesResource, RepoResource) Tests cover: - Enum case values and validation - from/tryFrom methods with valid and invalid inputs - Match expression compatibility - Array function compatibility - Type safety and comparisons Resource tests cover: - All public methods with complete mock data - Parameter validation - Pagination handling - Error handling scenarios - DTO conversion and type checking 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add 189 tests covering 11 files in src/Auth/ and src/Exceptions/: Auth tests: - TokenAuthentication: validation, headers, refresh behavior - TokenResolver: multi-source token resolution, env isolation - GithubOAuth: authorization URL generation, token exchange - GitHubAppAuthentication: JWT generation, installation tokens Exception tests: - GithubClientException: context management, inheritance - AuthenticationException: factory methods, error types - GithubAuthException: backward compatibility - ApiException: response parsing, error details - ValidationException: field/value tracking - RateLimitException: reset time calculations - NetworkException: timeout/connection errors Coverage achieved: - Auth/AuthenticationStrategy: 100% - Auth/GitHubAppAuthentication: 97.8% - Auth/GithubOAuth: 100% - Auth/TokenAuthentication: 100% - Auth/TokenResolver: 97.6% - All Exceptions: 100% 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Summary
This consolidates CI into a single gate check. Let's see how far off we are from passing.
Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit
Chores
Tests
✏️ Tip: You can customize this high-level summary in your review settings.