Skip to content

feat: switch to Django 1.10 #16109

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 9, 2020
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
36 changes: 1 addition & 35 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ env:
- SENTRY_SKIP_BACKEND_VALIDATION=1
- MIGRATIONS_TEST_MIGRATE=0
# Use this to override the django version in the requirements file.
- DJANGO_VERSION=">=1.9,<1.10"
- DJANGO_VERSION=">=1.10,<1.11"
# node's version is pinned by .nvmrc and is autodetected by `nvm install`.
- NODE_DIR="${HOME}/.nvm/versions/node/v$(< .nvmrc)"
- NODE_OPTIONS=--max-old-space-size=4096
Expand Down Expand Up @@ -149,18 +149,6 @@ matrix:
name: 'Acceptance'
env: TEST_SUITE=acceptance USE_SNUBA=1

- <<: *postgres_default
name: '[Django 1.10] Backend with migrations [Postgres] (1/2)'
env: DJANGO_VERSION=">=1.10,<1.11" TEST_SUITE=postgres DB=postgres TOTAL_TEST_GROUPS=2 TEST_GROUP=0 MIGRATIONS_TEST_MIGRATE=1

- <<: *postgres_default
name: '[Django 1.10] Backend with migrations [Postgres] (2/2)'
env: DJANGO_VERSION=">=1.10,<1.11" TEST_SUITE=postgres DB=postgres TOTAL_TEST_GROUPS=2 TEST_GROUP=1 MIGRATIONS_TEST_MIGRATE=1

- <<: *acceptance_default
name: '[Django 1.10] Acceptance'
env: DJANGO_VERSION=">=1.10,<1.11" TEST_SUITE=acceptance USE_SNUBA=1 PERCY_ENABLE=0

- <<: *acceptance_default
name: 'Plugins'
env: TEST_SUITE=plugins DB=postgres PERCY_TOKEN=${PLUGIN_PERCY_TOKEN}
Expand Down Expand Up @@ -226,28 +214,6 @@ matrix:
before_script:
- psql -c 'create database sentry;' -U postgres

- python: 2.7
name: '[Django 1.10] Snuba Integration with migrations'
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
services:
- docker
- memcached
- redis-server
- postgresql
before_install:
- *pip_install
- docker run -d --network host --name zookeeper -e ZOOKEEPER_CLIENT_PORT=2181 confluentinc/cp-zookeeper:4.1.0
- 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
- docker run -d --network host --name clickhouse-server --ulimit nofile=262144:262144 yandex/clickhouse-server:19.11
- docker run -d --network host --name snuba --env SNUBA_SETTINGS=test --env CLICKHOUSE_SERVER=localhost:9000 getsentry/snuba
- docker ps -a
install:
- python setup.py install_egg_info
- pip install -U -e ".[dev]"
- pip install confluent-kafka
before_script:
- psql -c 'create database sentry;' -U postgres

# Deploy 'storybook' (component & style guide) - allowed to fail
- name: 'Storybook Deploy'
language: node_js
Expand Down
2 changes: 1 addition & 1 deletion requirements-base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ datadog>=0.15.0,<0.31.0
django-crispy-forms==1.6.1
django-picklefield>=0.3.0,<1.1.0
django-sudo>=3.0.0,<4.0.0
Django>=1.9,<1.10
Django>=1.10,<1.11
djangorestframework==3.4.7
email-reply-parser>=0.2.0,<0.3.0
enum34>=1.1.6,<1.2.0
Expand Down
5 changes: 5 additions & 0 deletions src/sentry/runner/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ def configure(ctx, py, yaml, skip_service_validation=False):

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

# for now, squelch Django 2 warnings so prod logs aren't clogged
from django.utils.deprecation import RemovedInDjango20Warning

warnings.filterwarnings(action="ignore", category=RemovedInDjango20Warning)

# Add in additional mimetypes that are useful for our static files
# which aren't common in default system registries
import mimetypes
Expand Down
15 changes: 6 additions & 9 deletions tests/sentry/api/endpoints/test_organization_searches.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from __future__ import absolute_import

import django
from django.utils import timezone
from exam import fixture

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

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

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

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

team = self.create_team(members=[self.user])
SavedSearch.objects.create(
Expand Down
4 changes: 0 additions & 4 deletions tests/sentry/api/endpoints/test_project_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import mock
import six

import django
from django.core.urlresolvers import reverse

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