Skip to content

Conversation

@PatrickHeneise
Copy link
Member

GITHUB_TOKEN is automatically provided by GitHub Actions and cannot be declared as a secret in workflow_call as it's a reserved name.

GITHUB_TOKEN is automatically provided by GitHub Actions and cannot
be declared as a secret in workflow_call as it's a reserved name.
Copilot AI review requested due to automatic review settings October 29, 2025 17:13
Copy link
Contributor

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 simplifies the test workflow configuration by removing the GITHUB_TOKEN secret parameter and environment variable setup. The workflow will now rely on the automatically provided GitHub token instead of explicitly declaring it.

Key Changes:

  • Removed secrets block from workflow_call trigger that defined GITHUB_TOKEN as an optional parameter
  • Removed env block from the test job that set GITHUB_TOKEN environment variable

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

PatrickHeneise and others added 5 commits October 29, 2025 11:33
- Install vite and vite-plugin-graphql-loader as dev dependencies
- Create custom Node.js loader (test/gql-loader.js) to handle .gql?raw imports
- Add vite.config.js for Vite-based tooling support
- Update test script to use --experimental-loader flag
- All 44 tests now pass successfully

The code uses Vite's ?raw suffix syntax for importing GraphQL files, but
tests run directly with Node.js. The custom loader bridges this gap by
teaching Node.js how to load .gql files as string modules.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Tests were failing in CI because src/index.js was creating authentication
at module load time, which threw errors when no credentials were present.

Changes:
- Move authentication creation to lazy initialization via getGraphqlClient()
- Only create auth when functions are actually called
- Allows test imports to succeed without credentials
- Tests can now validate exports without triggering auth errors

This fixes the CI test failures where importing the module caused:
"Missing GitHub App credentials" errors even for tests that don't
need authentication.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Tests were expecting parameter validation to happen before authentication
errors. This ensures that validation errors are thrown before attempting
to create the GraphQL client.

Changes:
- Add parameter validation to all exported functions
- Validate org, repo, and other required parameters before calling getGraphqlClient()
- Ensures proper error messages for missing parameters

Fixes test: "index exports - validates parameter requirements"

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Reduced test code by ~10% (98 lines) while maintaining coverage:
- Use array iteration for checking multiple exports
- Remove redundant assertion messages
- Consolidate parameter validation tests
- Simplify mock GraphQL assertions
- Remove unnecessary async wrappers in assert.rejects

Changes:
- fetch.test.js: 93 → 51 lines (45% reduction)
- events.test.js: 213 → 159 lines (25% reduction)
- processEventsPayload.test.js: 157 → 155 lines (minor cleanup)

All 44 tests still pass with same coverage.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link
Contributor

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

Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.


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

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@PatrickHeneise PatrickHeneise merged commit 1e9dfe5 into main Oct 29, 2025
6 checks passed
@PatrickHeneise PatrickHeneise deleted the feature/enable-workflows branch October 29, 2025 20:33
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