ci: skip e2e tests for forked repos [AIS-99]#3292
Conversation
Code Review Agent Run #57ed03Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Changelist by BitoThis pull request implements the following key changes.
|
|
| Source | Requirement / Code Area | Status | Notes |
|---|---|---|---|
| AIS-99 | Skip e2e tests for PRs originating from forked repositories | ✅ Met | The 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). |
Impact Analysis by BitoInteraction DiagramsequenceDiagram
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
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 AnalyzedImpact: Flow: Direct Changes (Diff Files): Repository Impact: Cross-Repository Dependencies: Database/Caching Impact: API Contract Violations: Infrastructure Dependencies: Additional Insights: Testing RecommendationsFrontend Impact: Service Integration: Data Serialization: Privacy Compliance: Backward Compatibility: OAuth Functionality: Reliability Testing: Additional Insights: Analysis based on known dependency patterns and edges. Actual impact may vary. |
b75da7c to
28feb44
Compare
Code Review Agent Run #7f57ffActionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
28feb44 to
5080763
Compare
Code Review Agent Run #e5fe36Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
636b929
into
main
Summary
Skip e2e tests for forked repos.
Problem statement:
Solution
👍 skip e2e tests for forked PRs
Environment-Gated Secretscreate a new github env: fork-cicreate a new fork-ci.yaml github action to run just for PRs from forked repos, that runs in that env, by passingenvironment: fork-ci as an inputDescription
Motivation and Context
Todos
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