Skip to content

ci: skip e2e tests for forked repos [AIS-99]#3292

Merged
ethan ozelius (ethan-ozelius-contentful) merged 1 commit into
mainfrom
skip-e2e-tests-for-forks
Jul 9, 2026
Merged

ci: skip e2e tests for forked repos [AIS-99]#3292
ethan ozelius (ethan-ozelius-contentful) merged 1 commit into
mainfrom
skip-e2e-tests-for-forks

Conversation

@ethan-ozelius-contentful

@ethan-ozelius-contentful ethan ozelius (ethan-ozelius-contentful) commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Skip e2e tests for forked repos.

Problem statement:

  1. our repos often restrict write access 🔒  which is a good idea.  However, this requires external contributors to fork our repos.
  2. our repos have e2e tests 🧪 which are gated by a maintainer to run the e2e tests from a PR.  However these tests have env vars like: CONTENTFUL_INTEGRATION_TEST_CMA_TOKEN, CONTENTFUL_ORGANIZATION_ID  etc.
  3. those env vars are defined as repo-scoped github action secrets.
  4. PRs originating from forked repos run their github actions in their own context 🙀 so the env vars do not get injected, causing the e2e tests to fail.

Solution

👍 skip e2e tests for forked PRs
Environment-Gated Secrets
create a new github env: fork-ci
create a new fork-ci.yaml  github action to run just for PRs from forked repos, that runs in that env, by passing environment: fork-ci as an input

Description

Motivation and Context

Todos

  • Implemented feature
  • Feature with pending implementation

Screenshots (if appropriate):

Summary by Bito

This PR introduces a conditional skip mechanism to the e2e-tests job in the GitHub Actions workflow, preventing test failures for pull requests originating from forked repositories. The change addresses the issue where external contributors cannot trigger e2e tests due to repository-scoped GitHub Action secrets being unavailable in the fork's context.

Detailed Changes
  • Adds `if: github.event_name == 'push' || github.event.pull_request.head.repo.fork == false` condition to the e2e-tests job in main.yaml, ensuring tests only run for direct pushes and internal PRs.
  • Prevents e2e test failures for external contributors by skipping execution when repository-scoped GitHub Action secrets are inaccessible in the fork's context.
  • Allows maintainers to merge external contributor PRs without test failures while preserving e2e test coverage for direct pushes and internal pull requests.

@ethan-ozelius-contentful ethan ozelius (ethan-ozelius-contentful) changed the title ci: skip e2e tests for forked repos ci: skip e2e tests for forked repos [AIS-144] Jul 7, 2026
@ethan-ozelius-contentful ethan ozelius (ethan-ozelius-contentful) changed the title ci: skip e2e tests for forked repos [AIS-144] ci: skip e2e tests for forked repos [AIS-99] Jul 7, 2026
@ethan-ozelius-contentful
ethan ozelius (ethan-ozelius-contentful) marked this pull request as ready for review July 7, 2026 21:16
@bito-code-review

bito-code-review Bot commented Jul 7, 2026

Copy link
Copy Markdown

Code Review Agent Run #57ed03

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: b75da7c..b75da7c
    • .github/workflows/main.yaml
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Default Agent You can customize the agent settings here or contact your Bito workspace admin at jared.jolton@contentful.com.

Documentation & Help

AI Code Review powered by Bito Logo

@bito-code-review

bito-code-review Bot commented Jul 7, 2026

Copy link
Copy Markdown

Changelist by Bito

This pull request implements the following key changes.

Key Change Files Impacted Summary
Feature Improvement - Skip e2e tests for forked repository PRs
Adds a conditional check to the e2e-tests job to skip execution for pull requests originating from forked repositories, preventing test failures when repository-scoped secrets are unavailable.

@bito-code-review

bito-code-review Bot commented Jul 7, 2026

Copy link
Copy Markdown

Functional Validation by Bito

SourceRequirement / Code AreaStatusNotes
AIS-99Skip e2e tests for PRs originating from forked repositories✅ MetThe requirement to skip e2e tests for PRs from forked repositories is fully implemented in .github/workflows/main.yaml. The added conditional `if: github.event_name == 'push' || github.event.pull_request.head.repo.fork == false` ensures e2e tests only execute for non-fork PRs, directly addressing the issue where forked PRs lack access to repo-scoped secrets (CONTENTFUL_INTEGRATION_TEST_CMA_TOKEN, CONTENTFUL_ORGANIZATION_ID).

@bito-code-review

bito-code-review Bot commented Jul 7, 2026

Copy link
Copy Markdown

Impact Analysis by Bito

Interaction Diagram
sequenceDiagram
participant GH as GitHub Events
participant WF as Main Workflow<br/>main.yaml
participant BLD as Build Job
participant CHK as Check Job
participant E2E as E2E Tests Job<br/>🔄 Updated | ●●● High
participant TE2E as Test E2E Workflow
participant REL as Release Job
participant EXT as extensibility-stack<br/>(cross-repo ref)

GH->>WF: Trigger (push or pull_request)
WF->>BLD: Execute build job
BLD-->>WF: Build artifacts
WF->>CHK: Execute check job
CHK-->>WF: Test results
alt [push event] OR [PR from non-fork]
WF->>E2E: Execute e2e-tests job
E2E->>TE2E: Call test-e2e.yaml
TE2E->>E2E: Run tests on ubuntu-latest, macos-latest
E2E-->>WF: E2E test results
WF->>REL: Execute release job
REL-->>WF: Published release
else [PR from fork repository]
Note over E2E: E2E tests SKIPPED
Note over REL: Release blocked -<br/>needs e2e-tests
    end
Note over EXT: Uses 'contentful-cli'<br/>as user-agent in tests
Loading

The e2e-tests job now conditionally skips execution for pull requests from forked repositories to prevent secret exposure while maintaining full CI for internal PRs and push events. This affects the release pipeline since release depends on successful e2e completion. Cross-repo impact is minimal - extensibility-stack only references contentful-cli in test mocks.

Code Paths Analyzed

Impact:
CI/CD workflow modification to skip e2e tests on fork PRs. No functional code changes.

Flow:
GitHub Actions workflow trigger → condition evaluation → e2e-tests job execution (skipped for fork PRs).

Direct Changes (Diff Files):
• .github/workflows/main.yaml [24] — Added conditional if-statement to e2e-tests job to prevent execution on pull requests from forked repositories.

Repository Impact:
CI/CD pipeline - e2e test execution: e2e tests will no longer run automatically on PRs from forked repositories. This affects the validation coverage for external contributions.

Cross-Repository Dependencies:
None.

Database/Caching Impact:
• None

API Contract Violations:
None.

Infrastructure Dependencies:
• GitHub Actions workflow secrets (CONTENTFUL_INTEGRATION_TEST_CMA_TOKEN, CLI_E2E_ORG_ID) are not accessible to fork PRs, necessitating this conditional skip.

Additional Insights:
External contributor experience: Contributors from forks will not see e2e test results in their PR checks. Maintainers may need to manually trigger tests or merge without e2e validation for fork PRs.

Testing Recommendations

Frontend Impact:
None.

Service Integration:
• Verify that e2e tests still execute correctly on push events to main/beta/exo branches.
• Verify that e2e tests run on PRs from non-fork branches (internal PRs).
• Verify that e2e tests are properly skipped on PRs from forked repositories.

Data Serialization:
None.

Privacy Compliance:
None.

Backward Compatibility:
None.

OAuth Functionality:
• None

Reliability Testing:
• None

Additional Insights:
• Consider documenting the fork PR limitation in CONTRIBUTING.md for external contributors.
• Evaluate if a 'safe' subset of e2e tests could run on fork PRs without requiring secrets.

Analysis based on known dependency patterns and edges. Actual impact may vary.

@bito-code-review

bito-code-review Bot commented Jul 7, 2026

Copy link
Copy Markdown

Code Review Agent Run #7f57ff

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: 28feb44..28feb44
    • .github/workflows/main.yaml
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Default Agent You can customize the agent settings here or contact your Bito workspace admin at jared.jolton@contentful.com.

Documentation & Help

AI Code Review powered by Bito Logo

@bito-code-review

bito-code-review Bot commented Jul 9, 2026

Copy link
Copy Markdown

Code Review Agent Run #e5fe36

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: 5080763..5080763
    • .github/workflows/main.yaml
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Default Agent You can customize the agent settings here or contact your Bito workspace admin at jared.jolton@contentful.com.

Documentation & Help

AI Code Review powered by Bito Logo

@ethan-ozelius-contentful
ethan ozelius (ethan-ozelius-contentful) merged commit 636b929 into main Jul 9, 2026
14 checks passed
@ethan-ozelius-contentful
ethan ozelius (ethan-ozelius-contentful) deleted the skip-e2e-tests-for-forks branch July 9, 2026 15:31
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.

3 participants