Skip to content

Commit

Permalink
Merge branch 'master' into issue-1049
Browse files Browse the repository at this point in the history
  • Loading branch information
antonpirker committed Jun 19, 2023
2 parents b265aee + 4f0ab40 commit fe8787d
Show file tree
Hide file tree
Showing 269 changed files with 25,083 additions and 4,477 deletions.
4 changes: 3 additions & 1 deletion .craft.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
minVersion: 0.28.1
minVersion: 0.34.1
targets:
- name: pypi
includeNames: /^sentry[_\-]sdk.*$/
Expand All @@ -23,5 +23,7 @@ targets:
- python3.8
- python3.9
license: MIT
- name: sentry-pypi
internalPypiRepo: getsentry/pypi
changelog: CHANGELOG.md
changelogPolicy: auto
35 changes: 20 additions & 15 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
[flake8]
ignore =
E203, // Handled by black (Whitespace before ':' -- handled by black)
E266, // Handled by black (Too many leading '#' for block comment)
E501, // Handled by black (Line too long)
W503, // Handled by black (Line break occured before a binary operator)
E402, // Sometimes not possible due to execution order (Module level import is not at top of file)
E731, // I don't care (Do not assign a lambda expression, use a def)
B950, // Handled by black (Line too long by flake8-bugbear)
B011, // I don't care (Do not call assert False)
B014, // does not apply to Python 2 (redundant exception types by flake8-bugbear)
N812, // I don't care (Lowercase imported as non-lowercase by pep8-naming)
N804 // is a worse version of and conflicts with B902 (first argument of a classmethod should be named cls)
max-line-length = 80
select = N,B,C,E,F,W,T4,B9
exclude=checkouts,lol*,.tox
extend-ignore =
# Handled by black (Whitespace before ':' -- handled by black)
E203,
# Handled by black (Line too long)
E501,
# Sometimes not possible due to execution order (Module level import is not at top of file)
E402,
# I don't care (Do not assign a lambda expression, use a def)
E731,
# does not apply to Python 2 (redundant exception types by flake8-bugbear)
B014,
# I don't care (Lowercase imported as non-lowercase by pep8-naming)
N812,
# is a worse version of and conflicts with B902 (first argument of a classmethod should be named cls)
N804,
extend-exclude=checkouts,lol*
exclude =
# gRCP generated files
grpc_test_service_pb2.py
grpc_test_service_pb2_grpc.py
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ body:
1. What
2. you
3. did.
Extra points for also including the output of `pip freeze --all`.
validations:
required: true
- type: textarea
Expand Down
6 changes: 6 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
blank_issues_enabled: false
contact_links:
- name: Support Request
url: https://sentry.io/support
about: Use our dedicated support channel for paid accounts.

5 changes: 5 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,8 @@ updates:
schedule:
interval: weekly
open-pull-requests-limit: 10
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: weekly
open-pull-requests-limit: 10
163 changes: 57 additions & 106 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: ci
name: CI

on:
push:
Expand All @@ -8,39 +8,81 @@ on:

pull_request:

permissions:
contents: read

env:
BUILD_CACHE_KEY: ${{ github.sha }}
CACHED_BUILD_PATHS: |
${{ github.workspace }}/dist-serverless
jobs:
dist:
name: distribution packages
lint:
name: Lint Sources
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.11

- run: |
pip install tox
tox -e linters
check-ci-config:
name: Check CI config
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/setup-python@v2
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.9

- run: |
pip install virtualenv
make aws-lambda-layer-build
python scripts/split-tox-gh-actions/split-tox-gh-actions.py --fail-on-changes
build_lambda_layer:
name: Build Package
runs-on: ubuntu-latest
timeout-minutes: 10

- uses: actions/upload-artifact@v2
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Setup build cache
uses: actions/cache@v3
id: build_cache
with:
path: ${{ env.CACHED_BUILD_PATHS }}
key: ${{ env.BUILD_CACHE_KEY }}
- name: Build Packages
run: |
echo "Creating directory containing Python SDK Lambda Layer"
pip install virtualenv
# This will also trigger "make dist" that creates the Python packages
make aws-lambda-layer
- name: Upload Python Packages
uses: actions/upload-artifact@v3
with:
name: ${{ github.sha }}
path: |
dist/*
dist-serverless/*
docs:
timeout-minutes: 10
name: build documentation
name: Build SDK API Doc
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: 3.9

Expand All @@ -49,98 +91,7 @@ jobs:
make apidocs
cd docs/_build && zip -r gh-pages ./
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3.1.1
with:
name: ${{ github.sha }}
path: docs/_build/gh-pages.zip

lint:
timeout-minutes: 10
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.9

- run: |
pip install tox
tox -e linters
test:
continue-on-error: true
timeout-minutes: 45
runs-on: ${{ matrix.linux-version }}
strategy:
matrix:
linux-version: [ubuntu-latest]
python-version: ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10"]
include:
# GHA doesn't host the combo of python 3.4 and ubuntu-latest (which is
# currently 20.04), so run just that one under 18.04. (See
# https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json
# for a listing of supported python/os combos.)
- linux-version: ubuntu-18.04
python-version: "3.4"

services:
# Label used to access the service container
redis:
# Docker Hub image
image: redis
# Set health checks to wait until redis has started
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps port 6379 on service container to the host
- 6379:6379

postgres:
image: postgres
env:
POSTGRES_PASSWORD: sentry
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
# Maps tcp port 5432 on service container to the host
ports:
- 5432:5432

env:
SENTRY_PYTHON_TEST_POSTGRES_USER: postgres
SENTRY_PYTHON_TEST_POSTGRES_PASSWORD: sentry
SENTRY_PYTHON_TEST_POSTGRES_NAME: ci_test

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: setup
env:
PGHOST: localhost
PGPASSWORD: sentry
run: |
psql -c 'create database travis_ci_test;' -U postgres
psql -c 'create database test_travis_ci_test;' -U postgres
pip install codecov tox
- name: run tests
env:
CI_PYTHON_VERSION: ${{ matrix.python-version }}
timeout-minutes: 45
run: |
coverage erase
./scripts/runtox.sh '' --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
coverage combine .coverage*
coverage xml -i
codecov --file coverage.xml
17 changes: 12 additions & 5 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,15 @@ on:
schedule:
- cron: '18 18 * * 3'

permissions:
contents: read

jobs:
analyze:
permissions:
actions: read # for github/codeql-action/init to get workflow details
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/autobuild to send a status report
name: Analyze
runs-on: ubuntu-latest

Expand All @@ -35,11 +42,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -50,10 +57,10 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# 📚 https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
Expand All @@ -64,4 +71,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
16 changes: 16 additions & 0 deletions .github/workflows/enforce-license-compliance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Enforce License Compliance

on:
push:
branches: [master, main, release/*]
pull_request:
branches: [master, main]

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 }}
18 changes: 0 additions & 18 deletions .github/workflows/jira.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
name: "Release a new version"
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
token: ${{ secrets.GH_RELEASE_PAT }}
fetch-depth: 0
Expand Down
Loading

0 comments on commit fe8787d

Please sign in to comment.