Skip to content

chore: add cross repo test #1532

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

Merged
merged 13 commits into from
Aug 13, 2025
Merged

chore: add cross repo test #1532

merged 13 commits into from
Aug 13, 2025

Conversation

mandarini
Copy link
Contributor

@mandarini mandarini commented Aug 13, 2025

What kind of change does this PR introduce?

Chore/CI enhancement - adds cross-repository testing infrastructure

What is the current behavior?

Currently, when changes are made to Supabase client library dependencies (auth-js, storage-js, realtime-js, postgrest-js, functions-js), there is no automated way to test if those changes break supabase-js before merging.

What is the new behavior?

This PR introduces a new GitHub Actions workflow (external-test.yml) that enables cross-repository testing. When a PR is opened in any of the Supabase client library dependencies with a preview release, this workflow can be triggered to:

  1. Install the preview version of the dependency in supabase-js
  2. Run the full supabase-js test suite:
    • Type checking
    • Unit tests
    • Integration tests (with local Supabase instance)
  3. Report results back to the triggering PR as a comment

The workflow provides real-time status updates and a comprehensive test report, making it easy to verify compatibility before merging changes to dependencies.

Key features:

  • Automated testing against preview packages
  • Real-time status updates via PR comments
  • Comprehensive test coverage (types, unit, integration)
  • Clear pass/fail indicators
  • Direct links to workflow runs for debugging

Additional context

This workflow enhances the development workflow for the Supabase JavaScript ecosystem by catching breaking changes early. It can be triggered via workflow_dispatch with parameters including the triggering repository, PR number, preview package URL, and other relevant metadata.

The workflow uses a GitHub App token for cross-repository communication and includes proper error handling and timeouts for all test stages.

Screenshot 2025-08-13 at 5 14 40 PM Screenshot 2025-08-13 at 5 14 45 PM

Copy link

pkg-pr-new bot commented Aug 13, 2025

Open in StackBlitz

npm i https://pkg.pr.new/@supabase/supabase-js@1532

commit: 5e810d7

@coveralls
Copy link

coveralls commented Aug 13, 2025

Pull Request Test Coverage Report for Build 16939848928

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 74.8%

Totals Coverage Status
Change from base Build 16913742507: 0.0%
Covered Lines: 122
Relevant Lines: 146

💛 - Coveralls

@mandarini mandarini marked this pull request as ready for review August 13, 2025 14:15
@mandarini mandarini requested a review from grdsdev August 13, 2025 14:16
@mandarini mandarini merged commit cb49bf9 into master Aug 13, 2025
15 checks passed
@mandarini mandarini deleted the chore/add-cross-repo-test branch August 13, 2025 14:28
mandarini added a commit to supabase/auth-js that referenced this pull request Aug 13, 2025
## What kind of change does this PR introduce?

CI/CD enhancement - Improves the preview release workflow and
cross-repository testing integration.

## What is the current behavior?

- Preview releases are created but there's no automated way to test
compatibility with downstream packages
- No cross-repository testing between `auth-js` and `supabase-js`
- Manual testing required to verify changes don't break integration
points
- Limited feedback loop for developers on cross-package compatibility

## What is the new behavior?

- **Automated Cross-Repo Testing**: Preview releases automatically
trigger compatibility tests in `supabase-js`
- **Smart Triggering**: Only runs on actual source code changes (src/,
package files, tsconfig) to avoid unnecessary builds
- **Enhanced Control**: Manual workflow dispatch with configurable
options for target branch and test triggering
- **Better UX**: PR comments show preview package URLs and test status
updates
- **Secure Integration**: Uses GitHub App authentication for
cross-repository workflow triggering

## Key Features

### 🚀 **Cross-Repository Test Integration**
- Automatically triggers `supabase-js` external tests when `auth-js`
changes are made
- Passes preview package URL and metadata to downstream tests
- Supports both PR and push-based workflows

### ⚡ **Optimized Triggering**
- **Path-based filtering**: Only triggers on meaningful changes
(`src/**`, `package.json`, etc.)
- **Label-based control**: PRs require `trigger: preview` label for
activation
- **Manual override**: Workflow dispatch with configurable target branch

### 💬 **Enhanced Feedback**
- Automated PR comments with preview package links
- Status updates on cross-repo test progress
- Clear visibility into the testing pipeline

### 🔒 **Secure Cross-Repo Access**
- GitHub App-based authentication for repository access
- Scoped permissions to `auth-js` and `supabase-js` repositories only

## Testing

This workflow enables:
- Early detection of breaking changes between `auth-js` and
`supabase-js`
- Automated compatibility verification for all preview releases  
- Faster feedback cycles for developers working on authentication
features
- Reduced risk of integration issues in production releases

## Additional context

This enhancement creates a robust CI/CD pipeline that ensures `auth-js`
changes are automatically validated against its primary consumer
(`supabase-js`), significantly improving the development workflow and
reducing integration risks.

More context: supabase/supabase-js#1532
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants