feat: sentry for arm
Some checks failed
Lock closed issues/PRs / lock (push) Has been cancelled
Test / Sentry self-hosted end-to-end tests (push) Has been cancelled
Test / unit tests (push) Has been cancelled
Test / Sentry upgrade test (push) Has been cancelled
Test / integration test v2.19.0 - customizations disabled (push) Has been cancelled
Test / integration test v2.19.0 - customizations enabled (push) Has been cancelled
Test / integration test v2.26.0 - customizations disabled (push) Has been cancelled
Test / integration test v2.26.0 - customizations enabled (push) Has been cancelled

Signed-off-by: 小草林(田梓萱) <xcl@xuegao-tzx.top>
This commit is contained in:
2025-01-11 23:13:34 +08:00
parent 63d12d94b7
commit 90db12dfc0
103 changed files with 5239 additions and 1 deletions

View File

@@ -0,0 +1,16 @@
name: Enforce License Compliance
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
enforce-license-compliance:
runs-on: ubuntu-latest
steps:
- name: 'Enforce License Compliance'
uses: getsentry/action-enforce-license-compliance@main
with:
fossa_api_key: ${{ secrets.FOSSA_API_KEY }}

40
.github/workflows/fast-revert.yml vendored Normal file
View File

@@ -0,0 +1,40 @@
on:
pull_request_target:
types: [labeled]
workflow_dispatch:
inputs:
pr:
required: true
description: pr number
co_authored_by:
required: true
description: '`name <email>` for triggering user'
# disable all permissions -- we use the PAT's permissions instead
permissions: {}
jobs:
revert:
runs-on: ubuntu-latest
if: |
github.event_name == 'workflow_dispatch' || github.event.label.name == 'Trigger: Revert'
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.BUMP_SENTRY_TOKEN }}
- uses: getsentry/action-fast-revert@v2.0.1
with:
pr: ${{ github.event.number || github.event.inputs.pr }}
co_authored_by: ${{ github.event.inputs.co_authored_by || format('{0} <{1}+{0}@users.noreply.github.com>', github.event.sender.login, github.event.sender.id) }}
committer_name: getsentry-bot
committer_email: bot@sentry.io
token: ${{ secrets.BUMP_SENTRY_TOKEN }}
- name: comment on failure
run: |
curl \
--silent \
-X POST \
-H 'Authorization: token ${{ secrets.BUMP_SENTRY_TOKEN }}' \
-d'{"body": "revert failed (conflict? already reverted?) -- [check the logs](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})"}' \
https://api.github.com/repositories/${{ github.event.repository.id }}/issues/${{ github.event.number || github.event.inputs.pr }}/comments
if: failure()

17
.github/workflows/lock.yml vendored Normal file
View File

@@ -0,0 +1,17 @@
name: 'Lock closed issues/PRs'
on:
schedule:
- cron: '11 3 * * *'
workflow_dispatch:
jobs:
lock:
if: github.repository_owner == 'getsentry'
runs-on: ubuntu-latest
steps:
- uses: getsentry/forked-action-lock-threads@master
with:
github-token: ${{ github.token }}
issue-lock-inactive-days: 15
issue-lock-reason: ''
pr-lock-inactive-days: 15
pr-lock-reason: ''

16
.github/workflows/pre-commit.yml vendored Normal file
View File

@@ -0,0 +1,16 @@
name: pre-commit
on:
pull_request:
push:
branches: [master]
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
- uses: pre-commit/action@v3.0.1

57
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,57 @@
name: Release
on:
workflow_dispatch:
inputs:
version:
description: Version to release (optional)
required: false
force:
description: Force a release even when there are release-blockers (optional)
required: false
schedule:
# We want the release to be at 10 or 11am Pacific Time
# We also make this an hour after all others such as Sentry,
# Snuba, and Relay to make sure their releases finish.
- cron: "0 18 15 * *"
jobs:
release:
if: github.repository_owner == 'getsentry'
runs-on: ubuntu-latest
name: "Release a new version"
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GH_RELEASE_PAT }}
fetch-depth: 0
- name: Prepare release
id: prepare-release
uses: getsentry/action-prepare-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_RELEASE_PAT }}
with:
version: ${{ github.event.inputs.version }}
force: ${{ github.event.inputs.force }}
calver: true
outputs:
release-version: ${{ env.RELEASE_VERSION }}
dogfood-release:
if: github.repository_owner == 'getsentry'
runs-on: ubuntu-latest
name: Create release on self-hosted dogfood instance
needs: release
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GH_RELEASE_PAT }}
fetch-depth: 0
- uses: getsentry/action-release@v1
env:
SENTRY_ORG: self-hosted
SENTRY_PROJECT: installer
SENTRY_URL: https://self-hosted.getsentry.net/
SENTRY_AUTH_TOKEN: ${{ secrets.SELF_HOSTED_RELEASE_TOKEN }}
with:
environment: production
version: ${{ needs.release.outputs.release-version }}
ignore_empty: true
ignore_missing: true

159
.github/workflows/test.yml vendored Normal file
View File

@@ -0,0 +1,159 @@
name: Test
on:
# Run CI on all pushes to the master and release/** branches, and on all new
# pull requests, and on all pushes to pull requests (even if a pull request
# is not against master).
push:
branches:
- "master"
- "release/**"
pull_request:
schedule:
- cron: "0 0,12 * * *"
defaults:
run:
shell: bash
jobs:
e2e-test:
if: github.repository_owner == 'getsentry'
runs-on: ubuntu-22.04
name: "Sentry self-hosted end-to-end tests"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: self-hosted
- name: End to end tests
uses: getsentry/action-self-hosted-e2e-tests@main
with:
project_name: self-hosted
unit-test:
if: github.repository_owner == 'getsentry'
runs-on: ubuntu-22.04
name: "unit tests"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Unit Tests
run: ./unit-test.sh
upgrade-test:
if: github.repository_owner == 'getsentry'
runs-on: ubuntu-22.04
name: "Sentry upgrade test"
env:
REPORT_SELF_HOSTED_ISSUES: 0
steps:
- name: Get latest self-hosted release version
run: |
LATEST_TAG=$(curl -s https://api.github.com/repos/getsentry/self-hosted/releases/latest | jq -r '.tag_name')
echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_ENV
- name: Checkout latest release
uses: actions/checkout@v4
with:
ref: ${{ env.LATEST_TAG }}
- name: Get Compose
run: |
# Docker Compose v1 is installed here, remove it
sudo rm -f "/usr/local/bin/docker-compose"
sudo rm -f "/usr/local/lib/docker/cli-plugins/docker-compose"
sudo mkdir -p "/usr/local/lib/docker/cli-plugins"
sudo curl -L https://github.com/docker/compose/releases/download/v2.26.0/docker-compose-`uname -s`-`uname -m` -o "/usr/local/lib/docker/cli-plugins/docker-compose"
sudo chmod +x "/usr/local/lib/docker/cli-plugins/docker-compose"
- name: Install ${{ env.LATEST_TAG }}
run: ./install.sh
- name: Checkout current ref
uses: actions/checkout@v4
- name: Install current ref
run: ./install.sh
integration-test:
if: github.repository_owner == 'getsentry'
runs-on: ubuntu-22.04
name: integration test ${{ matrix.compose_version }} - customizations ${{ matrix.customizations }}
strategy:
fail-fast: false
matrix:
customizations: ["disabled", "enabled"]
compose_version: ["v2.19.0", "v2.26.0"]
include:
- compose_version: "v2.19.0"
compose_path: "/usr/local/lib/docker/cli-plugins"
- compose_version: "v2.26.0"
compose_path: "/usr/local/lib/docker/cli-plugins"
env:
COMPOSE_PROJECT_NAME: self-hosted-${{ strategy.job-index }}
REPORT_SELF_HOSTED_ISSUES: 0
SELF_HOSTED_TESTING_DSN: ${{ vars.SELF_HOSTED_TESTING_DSN }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup dev environment
run: |
pip install -r requirements-dev.txt
echo "PY_COLORS=1" >> "$GITHUB_ENV"
### pytest-sentry configuration ###
if [ "$GITHUB_REPOSITORY" = "getsentry/self-hosted" ]; then
echo "PYTEST_SENTRY_DSN=$SELF_HOSTED_TESTING_DSN" >> $GITHUB_ENV
echo "PYTEST_SENTRY_TRACES_SAMPLE_RATE=0" >> $GITHUB_ENV
# This records failures on master to sentry in order to detect flakey tests, as it's
# expected that people have failing tests on their PRs
if [ "$GITHUB_REF" = "refs/heads/master" ]; then
echo "PYTEST_SENTRY_ALWAYS_REPORT=1" >> $GITHUB_ENV
fi
fi
- name: Get Compose
run: |
# Always remove `docker compose` support as that's the newer version
# and comes installed by default nowadays.
sudo rm -f "/usr/local/lib/docker/cli-plugins/docker-compose"
# Docker Compose v1 is installed here, remove it
sudo rm -f "/usr/local/bin/docker-compose"
sudo rm -f "${{ matrix.compose_path }}/docker-compose"
sudo mkdir -p "${{ matrix.compose_path }}"
sudo curl -L https://github.com/docker/compose/releases/download/${{ matrix.compose_version }}/docker-compose-`uname -s`-`uname -m` -o "${{ matrix.compose_path }}/docker-compose"
sudo chmod +x "${{ matrix.compose_path }}/docker-compose"
- name: Install self-hosted
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
max_attempts: 3
command: ./install.sh
- name: Integration Test
run: |
if [ "${{ matrix.compose_version }}" = "v2.19.0" ]; then
pytest --reruns 3 --cov --junitxml=junit.xml _integration-test/ --customizations=${{ matrix.customizations }}
else
pytest --cov --junitxml=junit.xml _integration-test/ --customizations=${{ matrix.customizations }}
fi
- name: Inspect failure
if: failure()
run: |
docker compose ps
docker compose logs
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: getsentry/self-hosted
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}