Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
# shellcheck disable=SC1091
if [[ -f .env ]]; then
dotenv .env
fi

if [ ! -d .venv ]; then
echo "warning: creating virtualenv for the first time"
make setup
source python/.venv/bin/activate
else
source python/.venv/bin/activate
unset PS1
fi
33 changes: 7 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ jobs:
- uses: swatinem/rust-cache@v2

- name: Run Rustfmt
run: cargo fmt --all -- --check
run: make style

- name: Run Clippy
run: cargo clippy --workspace --all-features --tests -- -D clippy::all
run: make lint

test:
name: Tests (ubuntu)
Expand All @@ -38,27 +38,14 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Checkout sentry
uses: actions/checkout@v4
with:
repository: getsentry/sentry
path: sentry
- name: Install Python Dependencies
run: |
make install-py-dev

- name: Setup steps
- name: Start services
id: setup
run: |
# We cannot execute actions that are not placed under .github of the main repo
mkdir -p .github/actions
cp -r sentry/.github/actions/* .github/actions

- name: Setup Sentry
id: setup-sentry
uses: ./.github/actions/setup-sentry
with:
workdir: sentry
snuba: false
kafka: true
clickhouse: false
devservices up

- name: Install protoc
uses: arduino/setup-protoc@v3
Expand All @@ -79,12 +66,6 @@ jobs:
command: test
args: --all

- name: Install Python Dependencies
run: |
python -m venv python/.venv
. python/.venv/bin/activate
pip install -r python/requirements-dev.txt

- name: Run Python Integration Tests
run: |
export PYTEST_ADDOPTS=""
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Development
setup: setup-git ## run setup tasks to create and configure a development environment
setup: setup-git install-py-dev ## run setup tasks to create and configure a development environment
.PHONY: setup

setup-git: .git/hooks/pre-commit ## Setup git-hooks
Expand Down Expand Up @@ -27,7 +27,7 @@ style: ## Run style checking tools (cargo-fmt)

lint: ## Run linting tools (cargo-clippy)
@rustup component add clippy 2> /dev/null
cargo clippy --workspace --all-targets --all-features --no-deps --allow-dirty -- -D warnings
cargo clippy --workspace --all-targets --all-features --no-deps -- -D warnings
.PHONY: format

format: ## Run autofix mode for formatting and lint
Expand Down
2 changes: 1 addition & 1 deletion config/config-sentry-dev.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
upkeep_task_interval_ms: 2000
kafka_cluster: sentry_kafka:9093
kafka_cluster: 127.0.0.1:9092
19 changes: 19 additions & 0 deletions devservices/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Ignored by docker compose, used by devservices
x-sentry-service-config:
version: 0.1
service_name: taskbroker
dependencies:
kafka:
description: Shared instance of kafka used by sentry services
remote:
repo_name: sentry-shared-kafka
branch: main
repo_link: https://github.com/getsentry/sentry-shared-kafka
modes:
default: [kafka]
containerized: [kafka]

networks:
devservices:
name: devservices
external: true
6 changes: 3 additions & 3 deletions python/integration_tests/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def check_topic_exists(topic_name: str) -> bool:
check_topic_cmd = [
"docker",
"exec",
"sentry_kafka",
"kafka-kafka-1",
"kafka-topics",
"--bootstrap-server",
"localhost:9092",
Expand All @@ -37,7 +37,7 @@ def create_topic(topic_name: str, num_partitions: int) -> None:
create_topic_cmd = [
"docker",
"exec",
"sentry_kafka",
"kafka-kafka-1",
"kafka-topics",
"--bootstrap-server",
"localhost:9092",
Expand All @@ -59,7 +59,7 @@ def update_topic_partitions(topic_name: str, num_partitions: int) -> None:
create_topic_cmd = [
"docker",
"exec",
"sentry_kafka",
"kafka-kafka-1",
"kafka-topics",
"--bootstrap-server",
"localhost:9092",
Expand Down
1 change: 1 addition & 0 deletions python/requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
confluent_kafka>=2.3.0
devservices==1.0.5
orjson>=3.10.10
protobuf>=5.28.3
pytest>=8.3.3
Expand Down
Loading