Skip to content

Commit c1c9d67

Browse files
author
josh
authored
feat: switch to Django 1.10 (#16109)
1 parent 98394f1 commit c1c9d67

File tree

5 files changed

+13
-49
lines changed

5 files changed

+13
-49
lines changed

.travis.yml

+1-35
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ env:
3434
- SENTRY_SKIP_BACKEND_VALIDATION=1
3535
- MIGRATIONS_TEST_MIGRATE=0
3636
# Use this to override the django version in the requirements file.
37-
- DJANGO_VERSION=">=1.9,<1.10"
37+
- DJANGO_VERSION=">=1.10,<1.11"
3838
# node's version is pinned by .nvmrc and is autodetected by `nvm install`.
3939
- NODE_DIR="${HOME}/.nvm/versions/node/v$(< .nvmrc)"
4040
- NODE_OPTIONS=--max-old-space-size=4096
@@ -149,18 +149,6 @@ matrix:
149149
name: 'Acceptance'
150150
env: TEST_SUITE=acceptance USE_SNUBA=1
151151

152-
- <<: *postgres_default
153-
name: '[Django 1.10] Backend with migrations [Postgres] (1/2)'
154-
env: DJANGO_VERSION=">=1.10,<1.11" TEST_SUITE=postgres DB=postgres TOTAL_TEST_GROUPS=2 TEST_GROUP=0 MIGRATIONS_TEST_MIGRATE=1
155-
156-
- <<: *postgres_default
157-
name: '[Django 1.10] Backend with migrations [Postgres] (2/2)'
158-
env: DJANGO_VERSION=">=1.10,<1.11" TEST_SUITE=postgres DB=postgres TOTAL_TEST_GROUPS=2 TEST_GROUP=1 MIGRATIONS_TEST_MIGRATE=1
159-
160-
- <<: *acceptance_default
161-
name: '[Django 1.10] Acceptance'
162-
env: DJANGO_VERSION=">=1.10,<1.11" TEST_SUITE=acceptance USE_SNUBA=1 PERCY_ENABLE=0
163-
164152
- <<: *acceptance_default
165153
name: 'Plugins'
166154
env: TEST_SUITE=plugins DB=postgres PERCY_TOKEN=${PLUGIN_PERCY_TOKEN}
@@ -226,28 +214,6 @@ matrix:
226214
before_script:
227215
- psql -c 'create database sentry;' -U postgres
228216

229-
- python: 2.7
230-
name: '[Django 1.10] Snuba Integration with migrations'
231-
env: DJANGO_VERSION=">=1.10,<1.11" TEST_SUITE=snuba USE_SNUBA=1 SENTRY_ZOOKEEPER_HOSTS=localhost:2181 SENTRY_KAFKA_HOSTS=localhost:9092 MIGRATIONS_TEST_MIGRATE=1
232-
services:
233-
- docker
234-
- memcached
235-
- redis-server
236-
- postgresql
237-
before_install:
238-
- *pip_install
239-
- docker run -d --network host --name zookeeper -e ZOOKEEPER_CLIENT_PORT=2181 confluentinc/cp-zookeeper:4.1.0
240-
- docker run -d --network host --name kafka -e KAFKA_ZOOKEEPER_CONNECT=localhost:2181 -e KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://localhost:9092 -e KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1 confluentinc/cp-kafka:4.1.0
241-
- docker run -d --network host --name clickhouse-server --ulimit nofile=262144:262144 yandex/clickhouse-server:19.11
242-
- docker run -d --network host --name snuba --env SNUBA_SETTINGS=test --env CLICKHOUSE_SERVER=localhost:9000 getsentry/snuba
243-
- docker ps -a
244-
install:
245-
- python setup.py install_egg_info
246-
- pip install -U -e ".[dev]"
247-
- pip install confluent-kafka
248-
before_script:
249-
- psql -c 'create database sentry;' -U postgres
250-
251217
# Deploy 'storybook' (component & style guide) - allowed to fail
252218
- name: 'Storybook Deploy'
253219
language: node_js

requirements-base.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ datadog>=0.15.0,<0.31.0
1212
django-crispy-forms==1.6.1
1313
django-picklefield>=0.3.0,<1.1.0
1414
django-sudo>=3.0.0,<4.0.0
15-
Django>=1.9,<1.10
15+
Django>=1.10,<1.11
1616
djangorestframework==3.4.7
1717
email-reply-parser>=0.2.0,<0.3.0
1818
enum34>=1.1.6,<1.2.0

src/sentry/runner/settings.py

+5
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ def configure(ctx, py, yaml, skip_service_validation=False):
9494

9595
warnings.filterwarnings("default", "", Warning, r"^sentry")
9696

97+
# for now, squelch Django 2 warnings so prod logs aren't clogged
98+
from django.utils.deprecation import RemovedInDjango20Warning
99+
100+
warnings.filterwarnings(action="ignore", category=RemovedInDjango20Warning)
101+
97102
# Add in additional mimetypes that are useful for our static files
98103
# which aren't common in default system registries
99104
import mimetypes

tests/sentry/api/endpoints/test_organization_searches.py

+6-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from __future__ import absolute_import
22

3-
import django
43
from django.utils import timezone
54
from exam import fixture
65

@@ -24,10 +23,9 @@ def test_simple(self):
2423
project1 = self.create_project(teams=[team], name="foo")
2524
project2 = self.create_project(teams=[team], name="bar")
2625

27-
if django.VERSION[:2] >= (1, 8):
28-
# Depending on test we run migrations in Django 1.8. This causes
29-
# extra rows to be created, so remove them to keep this test working
30-
SavedSearch.objects.filter(is_global=True).delete()
26+
# Depending on test we run migrations in Django 1.8. This causes
27+
# extra rows to be created, so remove them to keep this test working
28+
SavedSearch.objects.filter(is_global=True).delete()
3129

3230
SavedSearch.objects.create(
3331
project=project1, name="bar", query=DEFAULT_SAVED_SEARCHES[0]["query"]
@@ -71,10 +69,9 @@ def get_response(self, *args, **params):
7169
return super(OrgLevelOrganizationSearchesListTest, self).get_response(*args, **params)
7270

7371
def create_base_data(self):
74-
if django.VERSION[:2] >= (1, 8):
75-
# Depending on test we run migrations in Django 1.8. This causes
76-
# extra rows to be created, so remove them to keep this test working
77-
SavedSearch.objects.filter(is_global=True).delete()
72+
# Depending on test we run migrations in Django 1.8. This causes
73+
# extra rows to be created, so remove them to keep this test working
74+
SavedSearch.objects.filter(is_global=True).delete()
7875

7976
team = self.create_team(members=[self.user])
8077
SavedSearch.objects.create(

tests/sentry/api/endpoints/test_project_details.py

-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import mock
44
import six
55

6-
import django
76
from django.core.urlresolvers import reverse
87

98
from sentry.constants import RESERVED_PROJECT_SLUGS
@@ -82,9 +81,6 @@ def test_project_renamed_302(self):
8281
"foobar",
8382
)
8483
redirect_path = "/api/0/projects/%s/%s/" % (project.organization.slug, "foobar")
85-
if django.VERSION < (1, 9):
86-
# Django 1.9 no longer forcefully rewrites relative redirects to absolute URIs because of RFC 7231.
87-
redirect_path = "http://testserver" + redirect_path
8884
# XXX: AttributeError: 'Response' object has no attribute 'url'
8985
# (this is with self.assertRedirects(response, ...))
9086
assert response["Location"] == redirect_path

0 commit comments

Comments
 (0)