-
-
Notifications
You must be signed in to change notification settings - Fork 410
docs: add mirroring documentation #8679
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
+59
−0
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| # Repository Mirroring | ||
|
|
||
| sentry-cocoa mirrors code and release artifacts to downstream repositories so consumers can depend on them via SPM without pulling unnecessary third-party dependencies. There are two distinct mechanisms: **continuous code sync** (on every push to main) and **release-time distribution** (via Craft). | ||
|
|
||
| For the motivation behind this approach, see [INTEGRATIONS.md](INTEGRATIONS.md) and [DECISIONS.md (decision #31)](DECISIONS.md#3rd-party-library-integrations). | ||
|
|
||
| ## Downstream Repositories | ||
|
|
||
| | Source in sentry-cocoa | Downstream repo | Continuous sync | Release (Craft) | | ||
| | ----------------------------------------------- | ---------------------------------------- | --------------- | --------------- | | ||
| | `3rd-party-integrations/SentrySwiftLog/` | `getsentry/sentry-apple-swift-log` | yes | yes | | ||
| | `3rd-party-integrations/SentryCocoaLumberjack/` | `getsentry/sentry-apple-cocoalumberjack` | yes | yes | | ||
| | `3rd-party-integrations/SentryPulse/` | `getsentry/sentry-apple-pulse` | yes | yes | | ||
| | `3rd-party-integrations/SentrySwiftyBeaver/` | `getsentry/sentry-apple-swiftybeaver` | yes | yes | | ||
| | `distribution/apple-binaries/` | `getsentry/sentry-apple-binaries` | no | yes | | ||
|
|
||
| ## Continuous Code Sync | ||
|
|
||
| **Workflow:** [`.github/workflows/mirror-3rd-party-integrations.yml`](../.github/workflows/mirror-3rd-party-integrations.yml) | ||
|
|
||
| Triggers on every push to `main` that touches `3rd-party-integrations/**`. For each integration in the matrix: | ||
|
|
||
| 1. Checks out sentry-cocoa and the downstream repo. | ||
| 2. Wipes the downstream repo (except `.git`). | ||
| 3. Copies the integration directory contents plus root `LICENSE.md`. | ||
| 4. Commits as `sentry-mobile-updater[bot]` and pushes. | ||
|
|
||
| This keeps downstream repos up to date between releases, so consumers on the `main` branch always have the latest code. | ||
|
|
||
| ### Authentication | ||
|
|
||
| The workflow uses the **sentry-mobile-updater** GitHub App (`SENTRY_DEPENDENCY_UPDATER_GITHUB_APP_ID` / `SENTRY_DEPENDENCY_UPDATER_GITHUB_APP_PRIVATE_KEY`) to generate a scoped token for each downstream repo. | ||
|
|
||
| ## Release-Time Distribution (Craft) | ||
|
|
||
| **Config:** [`.craft.yml`](../.craft.yml) | ||
|
|
||
| During a release, the [release workflow](../.github/workflows/release.yml): | ||
|
|
||
| 1. Builds XCFrameworks. | ||
| 2. Creates `.tgz` archives via [`scripts/create-apple-binaries-archive.sh`](../scripts/create-apple-binaries-archive.sh) and [`scripts/create-3rd-party-integration-archive.sh`](../scripts/create-3rd-party-integration-archive.sh). | ||
| 3. Craft pushes each archive to its downstream repo on the `main` branch and creates a Git tag matching the release version. | ||
|
|
||
| Craft authenticates via the GitHub org's own rules — no additional repo-level setup is needed for release pushes. | ||
|
|
||
| ## Adding a New Downstream Mirror | ||
|
|
||
| ### For 3rd-party integrations | ||
|
|
||
| 1. **Create the downstream repo** under `getsentry/` (e.g., `getsentry/sentry-apple-<name>`). | ||
| 2. **Allow sentry-mobile-updater** — in the downstream repo, go to `https://github.com/getsentry/<REPO_NAME>/settings/rules/` and add `sentry-mobile-updater` to the allowed apps section in the branch ruleset. This is required for the continuous sync workflow to push commits. | ||
| 3. **Add to the mirror workflow matrix** in [`.github/workflows/mirror-3rd-party-integrations.yml`](../.github/workflows/mirror-3rd-party-integrations.yml). | ||
| 4. **Add a Craft target** in [`.craft.yml`](../.craft.yml) with a `commit-on-git-repository` entry matching the archive name. | ||
| 5. **Add the archive mapping** in [`scripts/create-3rd-party-integration-archive.sh`](../scripts/create-3rd-party-integration-archive.sh). | ||
|
|
||
| ### For binary distribution repos (e.g., sentry-apple-binaries) | ||
|
|
||
| Only a Craft target is needed — there is no continuous sync for binary artifacts. Craft authenticates through the GitHub org's rules, so no additional repo-level permission changes are required. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.