Skip to content

Commit

Permalink
Merge branch 'master' into isabellaenriquez/add-source-link-to-frame
Browse files Browse the repository at this point in the history
  • Loading branch information
isabellaenriquez authored Aug 30, 2023
2 parents f7f5129 + 4f8f554 commit 5cdd282
Show file tree
Hide file tree
Showing 617 changed files with 7,765 additions and 1,301 deletions.
72 changes: 2 additions & 70 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -230,73 +230,6 @@ jobs:
github-token: ${{ steps.token.outputs.token }}
message: ':snowflake: re-freeze requirements'

lint:
if: needs.files-changed.outputs.backend == 'true'
needs: files-changed
name: backend lint
runs-on: ubuntu-20.04
timeout-minutes: 10
steps:
- uses: getsentry/action-github-app-token@97c9e23528286821f97fba885c1b1123284b29cc # v2.0.0
id: token
continue-on-error: true
with:
app_id: ${{ vars.SENTRY_INTERNAL_APP_ID }}
private_key: ${{ secrets.SENTRY_INTERNAL_APP_PRIVATE_KEY }}

- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0

- uses: getsentry/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1
id: files
with:
# Enable listing of files matching each filter.
# Paths to files will be available in `${FILTER_NAME}_files` output variable.
# Paths will be escaped and space-delimited.
# Output is usable as command line argument list in linux shell
list-files: shell

# It doesn't make sense to lint deleted files.
# Therefore we specify we are only interested in added or modified files.
filters: |
all:
- added|modified: '**/*.py'
- added|modified: 'requirements-*.txt'
- uses: getsentry/action-setup-venv@9e3bbae3836b1b6f129955bf55a19e1d99a61c67 # v1.0.5
with:
python-version: 3.8.16
cache-dependency-path: |
requirements-dev.txt
requirements-dev-frozen.txt
install-cmd: pip install -r requirements-dev.txt -c requirements-dev-frozen.txt

- uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # v3.0.11
with:
path: ~/.cache/pre-commit
key: cache-epoch-1|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}

- name: Setup pre-commit
# We don't use make setup-git because we're only interested in installing
# requirements-dev.txt as a fast path.
# We don't need pre-commit install --install-hooks since we're just interested
# in running the hooks.
run: |
pre-commit install-hooks
- name: Run pre-commit on changed files
run: |
# Run pre-commit to lint and format check files that were changed (but not deleted) compared to master.
# XXX: there is a very small chance that it'll expand to exceed Linux's limits
# `getconf ARG_MAX` - max # bytes of args + environ for exec()
pre-commit run --files ${{ steps.files.outputs.all_files }}
- name: Apply any pre-commit fixed files
if: steps.token.outcome == 'success' && github.ref != 'refs/heads/master' && always()
uses: getsentry/action-github-commit@748c31dd78cffe76f51bef49a0be856b6effeda7 # v1.1.0
with:
github-token: ${{ steps.token.outputs.token }}
message: ':hammer_and_wrench: apply pre-commit fixes'

migration:
if: needs.files-changed.outputs.migration_lockfile == 'true'
needs: files-changed
Expand Down Expand Up @@ -527,9 +460,9 @@ jobs:
github-token: ${{ steps.token.outputs.token }}
message: ':knife: regenerate mypy module blocklist'

# This check runs once all dependant jobs have passed
# This check runs once all dependent jobs have passed
# It symbolizes that all required Backend checks have succesfully passed (Or skipped)
# This check is the only required Github check
# This step is the only required backend check
backend-required-check:
needs:
[
Expand All @@ -538,7 +471,6 @@ jobs:
backend-migration-tests,
cli,
files-changed,
lint,
requirements,
migration,
plugins,
Expand Down
83 changes: 83 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: pre-commit

on:
push:
branches:
- master
pull_request:

# Cancel in progress workflows on pull_requests.
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

defaults:
run:
# the default default is:
# bash --noprofile --norc -eo pipefail {0}
shell: bash --noprofile --norc -eo pipefail -ux {0}

# hack for https://github.com/actions/cache/issues/810#issuecomment-1222550359
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 3

jobs:
lint:
name: pre-commit lint
runs-on: ubuntu-20.04
timeout-minutes: 10
steps:
- uses: getsentry/action-github-app-token@97c9e23528286821f97fba885c1b1123284b29cc # v2.0.0
id: token
with:
app_id: ${{ vars.SENTRY_INTERNAL_APP_ID }}
private_key: ${{ secrets.SENTRY_INTERNAL_APP_PRIVATE_KEY }}
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
- name: Get changed files
id: changes
uses: getsentry/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1
with:
token: ${{ steps.token.outputs.token }}

# Enable listing of files matching each filter.
# Paths to files will be available in `${FILTER_NAME}_files` output variable.
list-files: json

# It doesn't make sense to lint deleted files.
# Therefore we specify we are only interested in added or modified files.
filters: |
all:
- added|modified: '**/*'
- uses: getsentry/action-setup-venv@9e3bbae3836b1b6f129955bf55a19e1d99a61c67 # v1.0.5
with:
python-version: 3.8.16
cache-dependency-path: |
requirements-dev.txt
requirements-dev-frozen.txt
install-cmd: pip install -r requirements-dev.txt -c requirements-dev-frozen.txt
- uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # v3.0.11
with:
path: ~/.cache/pre-commit
key: cache-epoch-1|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Setup pre-commit
# We don't use make setup-git because we're only interested in installing
# requirements-dev.txt as a fast path.
# We don't need pre-commit install --install-hooks since we're just interested
# in running the hooks.
run: |
pre-commit install-hooks
- name: Run pre-commit on PR commits
run: |
jq '.[]' --raw-output <<< '${{steps.changes.outputs.all_files}}' |
# Run pre-commit to lint and format check files that were changed (but not deleted) compared to master.
xargs pre-commit run --files
- name: Apply any pre-commit fixed files
if: startsWith(github.ref, 'refs/pull')
uses: getsentry/action-github-commit@748c31dd78cffe76f51bef49a0be856b6effeda7 # v1.1.0
with:
github-token: ${{ steps.token.outputs.token }}
message: ':hammer_and_wrench: apply pre-commit fixes'
38 changes: 0 additions & 38 deletions .github/workflows/self-hosted-e2e-tests.yml

This file was deleted.

99 changes: 99 additions & 0 deletions fixtures/backup/user-with-maximum-privileges.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
[
{
"model": "sentry.user",
"pk": 1,
"fields": {
"password": "pbkdf2_sha256$150000$iEvdIknqYjTr$+QsGn0tfIJ1FZLxQI37mVU1gL2KbL/wqjMtG/dFhsMA=",
"last_login": null,
"username": "testing@example.com",
"name": "",
"email": "testing@example.com",
"is_staff": true,
"is_active": true,
"is_superuser": true,
"is_managed": false,
"is_sentry_app": null,
"is_password_expired": false,
"last_password_change": "2023-06-22T22:59:57.023Z",
"flags": "0",
"session_nonce": null,
"date_joined": "2023-06-22T22:59:55.488Z",
"last_active": "2023-06-22T22:59:55.489Z",
"avatar_type": 0,
"avatar_url": null
}
},
{
"model": "sentry.authenticator",
"pk": 1,
"fields": {
"user": 1,
"created_at": "2023-07-27T16:30:53.325Z",
"last_used_at": null,
"type": 1,
"config": "\"\""
}
},
{
"model": "sentry.useremail",
"pk": 1,
"fields": {
"user": 1,
"email": "testing@example.com",
"validation_hash": "mCnWesSVvYQcq7qXQ36AZHwosAd6cghE",
"date_hash_added": "2023-06-22T22:59:55.521Z",
"is_verified": true
}
},
{
"model": "sentry.userip",
"pk": 1,
"fields": {
"user": 1,
"ip_address": "127.0.0.2",
"country_code": null,
"region_code": null,
"first_seen": "2012-04-05T03:29:45.000Z",
"last_seen": "2012-04-05T03:29:45.000Z"
}
},
{
"model": "sentry.useroption",
"pk": 1,
"fields": {
"user": 1,
"project_id": null,
"organization_id": null,
"key": "timezone",
"value": "\"Europe/Vienna\""
}
},
{
"model": "sentry.userpermission",
"pk": 1,
"fields": {
"user": 1,
"permission": "users.admin"
}
},
{
"model": "sentry.userrole",
"pk": 1,
"fields": {
"date_updated": "2023-06-22T23:00:00.123Z",
"date_added": "2023-06-22T22:54:27.960Z",
"name": "Super Admin",
"permissions": "['broadcasts.admin', 'users.admin', 'options.admin']"
}
},
{
"model": "sentry.userroleuser",
"pk": 1,
"fields": {
"date_updated": "2023-06-22T23:00:00.123Z",
"date_added": "2023-06-22T22:59:57.000Z",
"user": 1,
"role": 1
}
}
]
71 changes: 71 additions & 0 deletions fixtures/backup/user-with-minimum-privileges.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
[
{
"model": "sentry.user",
"pk": 1,
"fields": {
"password": "pbkdf2_sha256$150000$iEvdIknqYjTr$+QsGn0tfIJ1FZLxQI37mVU1gL2KbL/wqjMtG/dFhsMA=",
"last_login": null,
"username": "testing@example.com",
"name": "",
"email": "testing@example.com",
"is_staff": false,
"is_active": true,
"is_superuser": false,
"is_managed": false,
"is_sentry_app": null,
"is_password_expired": false,
"last_password_change": "2023-06-22T22:59:57.023Z",
"flags": "0",
"session_nonce": null,
"date_joined": "2023-06-22T22:59:55.488Z",
"last_active": "2023-06-22T22:59:55.489Z",
"avatar_type": 0,
"avatar_url": null
}
},
{
"model": "sentry.authenticator",
"pk": 1,
"fields": {
"user": 1,
"created_at": "2023-07-27T16:30:53.325Z",
"last_used_at": null,
"type": 1,
"config": "\"\""
}
},
{
"model": "sentry.useremail",
"pk": 1,
"fields": {
"user": 1,
"email": "testing@example.com",
"validation_hash": "mCnWesSVvYQcq7qXQ36AZHwosAd6cghE",
"date_hash_added": "2023-06-22T22:59:55.521Z",
"is_verified": true
}
},
{
"model": "sentry.userip",
"pk": 1,
"fields": {
"user": 1,
"ip_address": "127.0.0.2",
"country_code": null,
"region_code": null,
"first_seen": "2012-04-05T03:29:45.000Z",
"last_seen": "2012-04-05T03:29:45.000Z"
}
},
{
"model": "sentry.useroption",
"pk": 1,
"fields": {
"user": 1,
"project_id": null,
"organization_id": null,
"key": "timezone",
"value": "\"Europe/Vienna\""
}
}
]
Loading

0 comments on commit 5cdd282

Please sign in to comment.