From 89914dd57ea060ead3ed1a66a4138bad5e94017a Mon Sep 17 00:00:00 2001 From: Stefan Hynek Date: Mon, 25 May 2020 17:46:55 +0200 Subject: [PATCH 1/5] refactor(sentry): move sentry from base to production also, provide a feedback form on internal server errors --- config/settings/base.py | 18 +++--------------- config/settings/production.py | 22 ++++++++++++++++------ discuss_data/static/js/project.js | 24 ++++++++++++++++++------ discuss_data/templates/500.html | 5 +++++ requirements/base.txt | 3 --- requirements/production.txt | 5 +++++ 6 files changed, 47 insertions(+), 30 deletions(-) diff --git a/config/settings/base.py b/config/settings/base.py index c56d8bd..bb8df71 100644 --- a/config/settings/base.py +++ b/config/settings/base.py @@ -3,10 +3,7 @@ Base settings to build other settings files upon. """ import environ -import sentry_sdk -from sentry_sdk.integrations.django import DjangoIntegration -from sentry_sdk.integrations.redis import RedisIntegration ROOT_DIR = ( environ.Path(__file__) - 3 @@ -23,7 +20,8 @@ if READ_DOT_ENV_FILE: # GENERAL # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#debug -DEBUG = env.bool("DJANGO_DEBUG", False) +DEBUG = env.bool("DJANGO_DEBUG", default=False) + # Local time zone. Choices are # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name # though not all of them may be available with every OS. @@ -72,7 +70,7 @@ THIRD_PARTY_APPS = [ "actstream", "crispy_forms", "django_activeurl", - 'django_bleach', + "django_bleach", "guardian", "intercoolerjs", "rest_framework", @@ -355,13 +353,3 @@ RUNSCRIPT_SCRIPT_DIR = "djangoscripts" BLEACH_ALLOWED_TAGS = [] BLEACH_STRIP_TAGS = False BLEACH_STRIP_COMMENTS = True - -# sentry -sentry_sdk.init( - dsn="https://824e439c530d423e989185abee8c5cc2@dev2.discuss-data.net/2", - integrations=[DjangoIntegration(), RedisIntegration()], - environment=env("ENVIRONMENT", default="local"), - # If you wish to associate users to errors (assuming you are using - # django.contrib.auth) you may enable sending PII data. - send_default_pii=True -) diff --git a/config/settings/production.py b/config/settings/production.py index 4dc9c77..db60895 100644 --- a/config/settings/production.py +++ b/config/settings/production.py @@ -1,4 +1,9 @@ -from .base import * # noqa +import sentry_sdk + +from sentry_sdk.integrations.django import DjangoIntegration +from sentry_sdk.integrations.redis import RedisIntegration + +from .base import * # pylint: disable=W0401,W0614 from .base import env # GENERAL @@ -41,8 +46,7 @@ SESSION_COOKIE_SECURE = True CSRF_COOKIE_SECURE = True # https://docs.djangoproject.com/en/dev/topics/security/#ssl-https # https://docs.djangoproject.com/en/dev/ref/settings/#secure-hsts-seconds -# TODO: set this to 60 seconds first and then to 518400 once you prove the former works -SECURE_HSTS_SECONDS = 60 +SECURE_HSTS_SECONDS = 31536000 # https://docs.djangoproject.com/en/dev/ref/settings/#secure-hsts-include-subdomains SECURE_HSTS_INCLUDE_SUBDOMAINS = env.bool( "DJANGO_SECURE_HSTS_INCLUDE_SUBDOMAINS", default=True @@ -57,8 +61,6 @@ SECURE_CONTENT_TYPE_NOSNIFF = env.bool( # STATIC # ------------------------ STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage" -# MEDIA -# ------------------------------------------------------------------------------ # TEMPLATES # ------------------------------------------------------------------------------ @@ -156,5 +158,13 @@ LOGGING = { }, } -# Your stuff... +# Sentry # ------------------------------------------------------------------------------ +sentry_sdk.init( + dsn="https://824e439c530d423e989185abee8c5cc2@dev2.discuss-data.net/2", + integrations=[DjangoIntegration(), RedisIntegration()], + environment=env("ENVIRONMENT", default="local"), + # If you wish to associate users to errors (assuming you are using + # django.contrib.auth) you may enable sending PII data. + send_default_pii=True, +) diff --git a/discuss_data/static/js/project.js b/discuss_data/static/js/project.js index 576b7e0..4d65684 100644 --- a/discuss_data/static/js/project.js +++ b/discuss_data/static/js/project.js @@ -3,18 +3,30 @@ /* Initialize Sentry * see https://docs.sentry.io/platforms/javascript/ */ -Sentry.init({ dsn: 'https://824e439c530d423e989185abee8c5cc2@dev2.discuss-data.net/2' }); +Sentry.init({ dsn: 'https://824e439c530d423e989185abee8c5cc2@dev2.discuss-data.net/2', + beforeSend(event, hint) { + if (event.exception) { + Sentry.showReportDialog({ eventId: event.event_id }); + } + return event; + } + }); -/* Get token string from anchor - * using jQuery - * see ? - */ -$(function() { +$(document).ready(function(){ + /*show sentry feedback*/ + if (document.getElementById("feedback")) { + Sentry.showReportDialog({ eventId: '{{ sentry_event_id }}' }) + } + + /* Get token string from anchor + * using jQuery + */ if ((document.getElementById("tokenizer")) && (window.location.hash)) { window.location = window.location.origin + window.location.pathname + window.location.hash.substr(1); } + }); /* Dropzone configuration options diff --git a/discuss_data/templates/500.html b/discuss_data/templates/500.html index 21df606..4b07568 100644 --- a/discuss_data/templates/500.html +++ b/discuss_data/templates/500.html @@ -8,6 +8,11 @@

Looks like something went wrong!

We track these errors automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.

+ +{% if sentry_event_id %} + +{% endif %} + {% endblock content %} diff --git a/requirements/base.txt b/requirements/base.txt index 0d04f04..b7b27a5 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -48,6 +48,3 @@ WeasyPrint==51 # wagtail wagtail==2.9 wagtailmenus==3.0.1 - -#sentry -sentry-sdk==0.14.3 diff --git a/requirements/production.txt b/requirements/production.txt index 6596e86..0207265 100644 --- a/requirements/production.txt +++ b/requirements/production.txt @@ -4,6 +4,11 @@ gunicorn==20.0.4 # https://github.com/benoitc/gunicorn + +# Sentry +# ------------------------------------------------------------------------------ +sentry-sdk==0.14.4 # https://github.com/getsentry/sentry-python + # Django # ------------------------------------------------------------------------------ django-anymail[mailgun]==7.0.0 # https://github.com/anymail/django-anymail -- GitLab From 7467c5ca7fd1902ba3ccf4c27650a65b75fba2c6 Mon Sep 17 00:00:00 2001 From: Stefan Hynek Date: Tue, 26 May 2020 08:22:32 +0200 Subject: [PATCH 2/5] ci(gitlab): correct workflow to comply with new "rules" syntax breaking changes concerning only/except introduced in gitlab 13 --- .gitlab-ci.yml | 74 +++++++++++++++++++++++--------------------------- 1 file changed, 34 insertions(+), 40 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 71d2576..71da7ae 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,3 +1,9 @@ +workflow: + rules: + - if: $CI_MERGE_REQUEST_IID + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH + + image: docker:19.03 services: @@ -30,11 +36,6 @@ stages: - docker info - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY -.only-default: &only-default - only: - - branches - - merge_requests - build_production: stage: build @@ -43,19 +44,17 @@ build_production: script: - docker build -t $RELEASE_IMAGE -f compose/production/django/Dockerfile . - docker push $RELEASE_IMAGE - only: - - master + rules: + - if: '$CI_COMMIT_BRANCH == "master"' + when: always build_develop: - <<: *only-default stage: build before_script: - *docker-setup script: - docker build -t $TEST_IMAGE -f compose/local/django/Dockerfile . - docker push $TEST_IMAGE - except: - - master dive: stage: test @@ -67,11 +66,11 @@ dive: - docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v ${PWD}:/tmp wagoodman/dive --ci --json /tmp/dive-report.json $RELEASE_IMAGE artifacts: paths: [dive-report.json] - only: - - master + rules: + - if: '$CI_COMMIT_BRANCH == "master"' + when: always tests: - <<: *only-default stage: test image: docker/compose before_script: @@ -87,8 +86,6 @@ tests: - docs/_build expire_in: 5 days allow_failure: true - except: - - master code_quality: stage: test @@ -99,32 +96,26 @@ code_quality: dependency_scanning: stage: test artifacts: - paths: [gl-dependency-scanning-report.json] + reports: + dependency_scanning: gl-dependency-scanning-report.json gemnasium-python-dependency_scanning: stage: test - artifacts: - paths: [gl-dependency-scanning-report.json] before_script: - apt-get update - apt-get install -y gcc libpq-dev musl-dev python3-dev - apt-get clean - -container_scanning: - stage: test artifacts: - paths: [gl-container-scanning-report.json] - only: - - master - - develop + reports: + dependency_scanning: gl-dependency-scanning-report.json license_scanning: stage: test variables: LM_PYTHON_VERSION: 3 - only: - - master - - develop + artifacts: + reports: + license_scanning: gl-license-scanning-report.json create_release: image: node:10 @@ -132,8 +123,9 @@ create_release: script: - npm install - npx semantic-release - only: - - master + rules: + - if: '$CI_COMMIT_BRANCH == "master"' + when: always freeze_release: stage: release @@ -143,8 +135,9 @@ freeze_release: - docker pull $RELEASE_IMAGE - docker tag $RELEASE_IMAGE $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME - only: - - tags + rules: + - if: $CI_COMMIT_TAG + when: always deploy_staging: stage: deploy @@ -157,9 +150,9 @@ deploy_staging: environment: name: staging url: https://dev.discuss-data.net/ - only: - - master - when: manual + rules: + - if: '$CI_COMMIT_BRANCH == "master"' + when: manual deploy_production: stage: deploy @@ -172,9 +165,9 @@ deploy_production: environment: name: production url: https://discuss-data.net/ - only: - - master - when: manual + rules: + - if: '$CI_COMMIT_BRANCH == "master"' + when: manual pages: @@ -188,5 +181,6 @@ pages: paths: - public expire_in: 30 days - only: - - develop + rules: + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH + when: always -- GitLab From c04b5e013d736d4279e2e2dfe65840e19b377989 Mon Sep 17 00:00:00 2001 From: Stefan Hynek Date: Tue, 26 May 2020 09:02:32 +0200 Subject: [PATCH 3/5] ci(gitlab): build develop image only on build file changes --- .gitlab-ci.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 71da7ae..58be0dc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -17,7 +17,7 @@ include: - template: License-Scanning.gitlab-ci.yml variables: - TEST_IMAGE: $CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:$CI_COMMIT_SHA + TEST_IMAGE: $CI_REGISTRY_IMAGE:develop RELEASE_IMAGE: $CI_REGISTRY_IMAGE:latest DEPLOY_IMAGE: $CI_REGISTRY_IMAGE:$CI_ENVIRONMENT_SLUG DARIAH_STORAGE_TOKEN: $DH_TOKEN @@ -55,6 +55,11 @@ build_develop: script: - docker build -t $TEST_IMAGE -f compose/local/django/Dockerfile . - docker push $TEST_IMAGE + rules: + - changes: + - compose/local/**/* + - compose/production/django/entrypoint + - requirements/ dive: stage: test -- GitLab From a537d9d4dce199ca9c4a901c11b3e4bda51f4420 Mon Sep 17 00:00:00 2001 From: Stefan Hynek Date: Tue, 26 May 2020 09:27:04 +0200 Subject: [PATCH 4/5] build(docker,npm): only build images when necessary; update ci compose file also, copy package-lock.json to node image; update npm dependencies; build and push the node image --- .gitlab-ci.yml | 41 ++++-- ci.yml | 13 +- compose/local/node/Dockerfile | 2 + package-lock.json | 228 +++++++++++++++------------------- package.json | 6 +- requirements/local.txt | 2 +- 6 files changed, 140 insertions(+), 152 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 58be0dc..bb92fe7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -17,7 +17,8 @@ include: - template: License-Scanning.gitlab-ci.yml variables: - TEST_IMAGE: $CI_REGISTRY_IMAGE:develop + DJANGO_DEV_IMAGE: $CI_REGISTRY_IMAGE/django:latest + NODE_DEV_IMAGE: $CI_REGISTRY_IMAGE/node:latest RELEASE_IMAGE: $CI_REGISTRY_IMAGE:latest DEPLOY_IMAGE: $CI_REGISTRY_IMAGE:$CI_ENVIRONMENT_SLUG DARIAH_STORAGE_TOKEN: $DH_TOKEN @@ -37,29 +38,43 @@ stages: - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY -build_production: +build_django: stage: build before_script: - *docker-setup script: - - docker build -t $RELEASE_IMAGE -f compose/production/django/Dockerfile . - - docker push $RELEASE_IMAGE + - docker build -t $DJANGO_DEV_IMAGE -f compose/local/django/Dockerfile . + - docker push $DJANGO_DEV_IMAGE rules: - - if: '$CI_COMMIT_BRANCH == "master"' - when: always + - changes: + - compose/local/django/* + - compose/production/django/entrypoint + - requirements/ -build_develop: +build_node: stage: build before_script: - *docker-setup script: - - docker build -t $TEST_IMAGE -f compose/local/django/Dockerfile . - - docker push $TEST_IMAGE + - docker build -t $NODE_DEV_IMAGE -f compose/local/node/Dockerfile . + - docker push $NODE_DEV_IMAGE rules: - changes: - - compose/local/**/* - - compose/production/django/entrypoint - - requirements/ + - compose/local/node/* + - package*.json + + +build_production: + stage: build + before_script: + - *docker-setup + script: + - docker build -t $RELEASE_IMAGE -f compose/production/django/Dockerfile . + - docker push $RELEASE_IMAGE + rules: + - if: '$CI_COMMIT_BRANCH == "master"' + when: always + dive: stage: test @@ -81,7 +96,7 @@ tests: before_script: - *docker-setup script: - - echo "Composing CI setup with $TEST_IMAGE" + - echo "Composing CI setup with $DJANGO_DEV_IMAGE" - docker-compose -f ci.yml build - docker-compose -f ci.yml run --rm django /bin/sh -c "./run_pytest" coverage: "/TOTAL.+ ([0-9]{1,3}%)/" diff --git a/ci.yml b/ci.yml index 3e18f97..b70959f 100644 --- a/ci.yml +++ b/ci.yml @@ -7,7 +7,7 @@ volumes: services: django: - image: $TEST_IMAGE + image: $DJANGO_DEV_IMAGE depends_on: - postgres - mailhog @@ -22,13 +22,9 @@ services: command: /start postgres: - build: - context: . - dockerfile: ./compose/production/postgres/Dockerfile - image: discuss_data_production_postgres + image: postgres:11.3 volumes: - local_postgres_data:/var/lib/postgresql/data - - local_postgres_data_backups:/backups env_file: - ./.envs/.local/.postgres @@ -48,10 +44,7 @@ services: - "8025:8025" node: - build: - context: . - dockerfile: ./compose/local/node/Dockerfile - image: discuss_data_local_node + image: $NODE_DEV_IMAGE depends_on: - django volumes: diff --git a/compose/local/node/Dockerfile b/compose/local/node/Dockerfile index b1e4f7a..737b837 100644 --- a/compose/local/node/Dockerfile +++ b/compose/local/node/Dockerfile @@ -11,6 +11,8 @@ RUN set -eux; \ WORKDIR /app COPY ./package.json /app +COPY ./package-lock.json /app + RUN npm install && npm cache clean --force diff --git a/package-lock.json b/package-lock.json index bdba174..b7d4f96 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,23 +29,6 @@ "js-tokens": "^4.0.0" } }, - "@babel/runtime": { - "version": "7.9.2", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.9.2.tgz", - "integrity": "sha512-NE2DtOdufG7R5vnfQUTehdTfNycfUANEtCa9PssN9O/xmTzP4E08UI797ixaei6hBEVL9BI/PsdJS5x7mWoB9Q==", - "dev": true, - "requires": { - "regenerator-runtime": "^0.13.4" - }, - "dependencies": { - "regenerator-runtime": { - "version": "0.13.5", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz", - "integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA==", - "dev": true - } - } - }, "@commitlint/execute-rule": { "version": "8.3.4", "resolved": "https://registry.npmjs.org/@commitlint/execute-rule/-/execute-rule-8.3.4.tgz", @@ -161,24 +144,24 @@ } }, "@octokit/auth-token": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.4.0.tgz", - "integrity": "sha512-eoOVMjILna7FVQf96iWc3+ZtE/ZT6y8ob8ZzcqKY1ibSQCnu4O/B7pJvzMx5cyZ/RjAff6DAdEb0O0Cjcxidkg==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.4.1.tgz", + "integrity": "sha512-NB81O5h39KfHYGtgfWr2booRxp2bWOJoqbWwbyUg2hw6h35ArWYlAST5B3XwAkbdcx13yt84hFXyFP5X0QToWA==", "dev": true, "requires": { - "@octokit/types": "^2.0.0" + "@octokit/types": "^4.0.1" } }, "@octokit/core": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/@octokit/core/-/core-2.5.0.tgz", - "integrity": "sha512-uvzmkemQrBgD8xuGbjhxzJN1darJk9L2cS+M99cHrDG2jlSVpxNJVhoV86cXdYBqdHCc9Z995uLCczaaHIYA6Q==", + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-2.5.3.tgz", + "integrity": "sha512-23AHK9xBW0v79Ck8h5U+5iA4MW7aosqv+Yr6uZXolVGNzzHwryNH5wM386/6+etiKUTwLFZTqyMU9oQpIBZcFA==", "dev": true, "requires": { "@octokit/auth-token": "^2.4.0", "@octokit/graphql": "^4.3.1", "@octokit/request": "^5.4.0", - "@octokit/types": "^2.0.0", + "@octokit/types": "^4.0.1", "before-after-hook": "^2.1.0", "universal-user-agent": "^5.0.0" } @@ -194,6 +177,15 @@ "universal-user-agent": "^5.0.0" }, "dependencies": { + "@octokit/types": { + "version": "2.16.2", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-2.16.2.tgz", + "integrity": "sha512-O75k56TYvJ8WpAakWwYRN8Bgu60KrmX0z1KqFp1kNiFNkgW+JW+9EBKZ+S33PU6SLvbihqd+3drvPxKK68Ee8Q==", + "dev": true, + "requires": { + "@types/node": ">= 8" + } + }, "is-plain-object": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-3.0.0.tgz", @@ -212,34 +204,23 @@ } }, "@octokit/graphql": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.3.1.tgz", - "integrity": "sha512-hCdTjfvrK+ilU2keAdqNBWOk+gm1kai1ZcdjRfB30oA3/T6n53UVJb7w0L5cR3/rhU91xT3HSqCd+qbvH06yxA==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.5.0.tgz", + "integrity": "sha512-StJWfn0M1QfhL3NKBz31e1TdDNZrHLLS57J2hin92SIfzlOVBuUaRkp31AGkGOAFOAVtyEX6ZiZcsjcJDjeb5g==", "dev": true, "requires": { "@octokit/request": "^5.3.0", - "@octokit/types": "^2.0.0", - "universal-user-agent": "^4.0.0" - }, - "dependencies": { - "universal-user-agent": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-4.0.1.tgz", - "integrity": "sha512-LnST3ebHwVL2aNe4mejI9IQh2HfZ1RLo8Io2HugSif8ekzD1TlWpHpColOB/eh8JHMLkGH3Akqf040I+4ylNxg==", - "dev": true, - "requires": { - "os-name": "^3.1.0" - } - } + "@octokit/types": "^4.0.1", + "universal-user-agent": "^5.0.0" } }, "@octokit/plugin-paginate-rest": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.2.0.tgz", - "integrity": "sha512-KoNxC3PLNar8UJwR+1VMQOw2IoOrrFdo5YOiDKnBhpVbKpw+zkBKNMNKwM44UWL25Vkn0Sl3nYIEGKY+gW5ebw==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.2.1.tgz", + "integrity": "sha512-/tHpIF2XpN40AyhIq295YRjb4g7Q5eKob0qM3thYJ0Z+CgmNsWKM/fWse/SUR8+LdprP1O4ZzSKQE+71TCwK+w==", "dev": true, "requires": { - "@octokit/types": "^2.12.1" + "@octokit/types": "^4.0.1" } }, "@octokit/plugin-request-log": { @@ -249,24 +230,24 @@ "dev": true }, "@octokit/plugin-rest-endpoint-methods": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-3.8.0.tgz", - "integrity": "sha512-LUkTgZ53adPFC/Hw6mxvAtShUtGy3zbpcfCAJMWAN7SvsStV4p6TK7TocSv0Aak4TNmDLhbShTagGhpgz9mhYw==", + "version": "3.12.2", + "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-3.12.2.tgz", + "integrity": "sha512-QUfJ6nriHpwTxf8As99kEyDQV4AGQvypsM8Xyx5rsWi6JY7rzjOkZrleRrFq0aiNcQo7acM4bwaXq462OKTJ9w==", "dev": true, "requires": { - "@octokit/types": "^2.12.1", + "@octokit/types": "^4.0.0", "deprecation": "^2.3.1" } }, "@octokit/request": { - "version": "5.4.2", - "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.4.2.tgz", - "integrity": "sha512-zKdnGuQ2TQ2vFk9VU8awFT4+EYf92Z/v3OlzRaSh4RIP0H6cvW1BFPXq4XYvNez+TPQjqN+0uSkCYnMFFhcFrw==", + "version": "5.4.4", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.4.4.tgz", + "integrity": "sha512-vqv1lz41c6VTxUvF9nM+a6U+vvP3vGk7drDpr0DVQg4zyqlOiKVrY17DLD6de5okj+YLHKcoqaUZTBtlNZ1BtQ==", "dev": true, "requires": { "@octokit/endpoint": "^6.0.1", "@octokit/request-error": "^2.0.0", - "@octokit/types": "^2.11.1", + "@octokit/types": "^4.0.1", "deprecation": "^2.0.0", "is-plain-object": "^3.0.0", "node-fetch": "^2.3.0", @@ -292,32 +273,32 @@ } }, "@octokit/request-error": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.0.0.tgz", - "integrity": "sha512-rtYicB4Absc60rUv74Rjpzek84UbVHGHJRu4fNVlZ1mCcyUPPuzFfG9Rn6sjHrd95DEsmjSt1Axlc699ZlbDkw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.0.1.tgz", + "integrity": "sha512-5lqBDJ9/TOehK82VvomQ6zFiZjPeSom8fLkFVLuYL3sKiIb5RB8iN/lenLkY7oBmyQcGP7FBMGiIZTO8jufaRQ==", "dev": true, "requires": { - "@octokit/types": "^2.0.0", + "@octokit/types": "^4.0.1", "deprecation": "^2.0.0", "once": "^1.4.0" } }, "@octokit/rest": { - "version": "17.6.0", - "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-17.6.0.tgz", - "integrity": "sha512-knh+4hPBA26AMXflFRupTPT3u9NcQmQzeBJl4Gcuf14Gn7dUh6Loc1ICWF0Pz18A6ElFZQt+wB9tFINSruIa+g==", + "version": "17.9.2", + "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-17.9.2.tgz", + "integrity": "sha512-UXxiE0HhGQAPB3WDHTEu7lYMHH2uRcs/9f26XyHpGGiiXht8hgHWEk6fA7WglwwEvnj8V7mkJOgIntnij132UA==", "dev": true, "requires": { "@octokit/core": "^2.4.3", "@octokit/plugin-paginate-rest": "^2.2.0", "@octokit/plugin-request-log": "^1.0.0", - "@octokit/plugin-rest-endpoint-methods": "3.8.0" + "@octokit/plugin-rest-endpoint-methods": "^3.12.2" } }, "@octokit/types": { - "version": "2.12.2", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-2.12.2.tgz", - "integrity": "sha512-1GHLI/Jll3j6F0GbYyZPFTcHZMGjAiRfkTEoRUyaVVk2IWbDdwEiClAJvXzfXCDayuGSNCqAUH8lpjZtqW9GDw==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-4.0.2.tgz", + "integrity": "sha512-+4X6qfhT/fk/5FD66395NrFLxCzD6FsGlpPwfwvnukdyfYbhiZB/FJltiT1XM5Q63rGGBSf9FPaNV3WpNHm54A==", "dev": true, "requires": { "@types/node": ">= 8" @@ -405,9 +386,9 @@ "dev": true }, "@semantic-release/github": { - "version": "7.0.5", - "resolved": "https://registry.npmjs.org/@semantic-release/github/-/github-7.0.5.tgz", - "integrity": "sha512-1nJCMeomspRIXKiFO3VXtkUMbIBEreYLFNBdWoLjvlUNcEK0/pEbupEZJA3XHfJuSzv43u3OLpPhF/JBrMuv+A==", + "version": "7.0.7", + "resolved": "https://registry.npmjs.org/@semantic-release/github/-/github-7.0.7.tgz", + "integrity": "sha512-Sai2UucYQ+5rJzKVEVJ4eiZNDdoo0/CzfpValBdeU5h97uJE7t4CoBTmUWkiXlPOx46CSw1+JhI+PHC1PUxVZw==", "dev": true, "requires": { "@octokit/rest": "^17.0.0", @@ -465,9 +446,9 @@ } }, "mime": { - "version": "2.4.4", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.4.tgz", - "integrity": "sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA==", + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.5.tgz", + "integrity": "sha512-3hQhEUF027BuxZjQA3s7rIv/7VCQPa27hN9u9g87sEkWaKwQPuXOkVKtOeiyUrnWqTDiOs8Ed2rwg733mB0R5w==", "dev": true }, "universalify": { @@ -1886,54 +1867,54 @@ "dev": true }, "autoprefixer": { - "version": "9.7.6", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-9.7.6.tgz", - "integrity": "sha512-F7cYpbN7uVVhACZTeeIeealwdGM6wMtfWARVLTy5xmKtgVdBNJvbDRoCK3YO1orcs7gv/KwYlb3iXwu9Ug9BkQ==", + "version": "9.8.0", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-9.8.0.tgz", + "integrity": "sha512-D96ZiIHXbDmU02dBaemyAg53ez+6F5yZmapmgKcjm35yEe1uVDYI8hGW3VYoGRaG290ZFf91YxHrR518vC0u/A==", "dev": true, "requires": { - "browserslist": "^4.11.1", - "caniuse-lite": "^1.0.30001039", + "browserslist": "^4.12.0", + "caniuse-lite": "^1.0.30001061", "chalk": "^2.4.2", "normalize-range": "^0.1.2", "num2fraction": "^1.2.2", - "postcss": "^7.0.27", - "postcss-value-parser": "^4.0.3" + "postcss": "^7.0.30", + "postcss-value-parser": "^4.1.0" }, "dependencies": { "browserslist": { - "version": "4.11.1", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.11.1.tgz", - "integrity": "sha512-DCTr3kDrKEYNw6Jb9HFxVLQNaue8z+0ZfRBRjmCunKDEXEBajKDj2Y+Uelg+Pi29OnvaSGwjOsnRyNEkXzHg5g==", + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.12.0.tgz", + "integrity": "sha512-UH2GkcEDSI0k/lRkuDSzFl9ZZ87skSy9w2XAn1MsZnL+4c4rqbBd3e82UWHbYDpztABrPBhZsTEeuxVfHppqDg==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30001038", - "electron-to-chromium": "^1.3.390", + "caniuse-lite": "^1.0.30001043", + "electron-to-chromium": "^1.3.413", "node-releases": "^1.1.53", "pkg-up": "^2.0.0" } }, "caniuse-lite": { - "version": "1.0.30001042", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001042.tgz", - "integrity": "sha512-igMQ4dlqnf4tWv0xjaaE02op9AJ2oQzXKjWf4EuAHFN694Uo9/EfPVIPJcmn2WkU9RqozCxx5e2KPcVClHDbDw==", + "version": "1.0.30001066", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001066.tgz", + "integrity": "sha512-Gfj/WAastBtfxLws0RCh2sDbTK/8rJuSeZMecrSkNGYxPcv7EzblmDGfWQCFEQcSqYE2BRgQiJh8HOD07N5hIw==", "dev": true }, "electron-to-chromium": { - "version": "1.3.407", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.407.tgz", - "integrity": "sha512-ayDQgkwCLHq0AVmsU10t2H/8X9lq3nb1CRV9rWYsc2nTTbFMvh4Aaau48Ao0iW/L+Q8Y9bgbJ5iHyPse7DGMJw==", + "version": "1.3.452", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.452.tgz", + "integrity": "sha512-IdbjgCEqDvcU/1kUQa6C49I2NZOY3SBmU9Eus7mdFdJJBqn0Lg1Epfi/T4nqVcxTNBEGhcjwMhY1EysMBsXZrw==", "dev": true }, "node-releases": { - "version": "1.1.53", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.53.tgz", - "integrity": "sha512-wp8zyQVwef2hpZ/dJH7SfSrIPD6YoJz6BDQDpGEkcA0s3LpAQoxBIYmfIq6QAhC1DhwsyCgTaTTcONwX8qzCuQ==", + "version": "1.1.56", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.56.tgz", + "integrity": "sha512-EVo605FhWLygH8a64TjgpjyHYOihkxECwX1bHHr8tETJKWEiWS2YJjPbvsX2jFjnjTNEgBCmk9mLjKG1Mf11cw==", "dev": true }, "postcss": { - "version": "7.0.27", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.27.tgz", - "integrity": "sha512-WuQETPMcW9Uf1/22HWUWP9lgsIC+KEHg2kozMflKjbeUtw9ujvFX6QmIfozaErDkmLWS9WEnEdEe6Uo9/BNTdQ==", + "version": "7.0.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.31.tgz", + "integrity": "sha512-a937VDHE1ftkjk+8/7nj/mrjtmkn69xxzJgRETXdAUU+IgOYPQNJF17haGWbeDxSyk++HA14UA98FurvPyBJOA==", "dev": true, "requires": { "chalk": "^2.4.2", @@ -2525,9 +2506,9 @@ "dev": true }, "bootstrap": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.4.1.tgz", - "integrity": "sha512-tbx5cHubwE6e2ZG7nqM3g/FZ5PQEDMWmMGNrCUBVRPHXTJaH7CBDdsLeu3eCh3B1tzAxTnAbtmrzvWEvT2NNEA==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.5.0.tgz", + "integrity": "sha512-Z93QoXvodoVslA+PWNdk23Hze4RBYIkpb5h8I2HY2Tu2h7A0LpAgLcyrhrSUyo2/Oxm2l1fRZPs1e5hnxnliXA==", "dev": true }, "bottleneck": { @@ -5044,9 +5025,9 @@ }, "dependencies": { "cross-spawn": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.2.tgz", - "integrity": "sha512-PD6G8QG3S4FK/XCGFbEQrDqO2AnMMsy0meR7lerlIOHAAbkuavGU/pOqprrlvfTNjvowivTeBsjebAL0NSoMxw==", + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "dev": true, "requires": { "path-key": "^3.1.0", @@ -5055,9 +5036,9 @@ } }, "execa": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-4.0.0.tgz", - "integrity": "sha512-JbDUxwV3BoT5ZVXQrSVbAiaXhXUkIwvbhPIwZ0N13kX+5yCzOhUNdocxB/UQRuYOHRYYwAxKYwJYc0T4D12pDA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/execa/-/execa-4.0.2.tgz", + "integrity": "sha512-QI2zLa6CjGWdiQsmSkZoGtDx2N+cQIGb3yNolGTdjSQzydzLgYYf8LRuagp7S7fPimjcrzUDSUFd/MgzELMi4Q==", "dev": true, "requires": { "cross-spawn": "^7.0.0", @@ -8794,9 +8775,9 @@ } }, "marked": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/marked/-/marked-1.0.0.tgz", - "integrity": "sha512-Wo+L1pWTVibfrSr+TTtMuiMfNzmZWiOPeO7rZsQUY5bgsxpHesBEcIWJloWVTFnrMXnf/TL30eTFSGJddmQAng==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-1.1.0.tgz", + "integrity": "sha512-EkE7RW6KcXfMHy2PA7Jg0YJE1l8UPEZE8k45tylzmZM30/r1M1MUXWQfJlrSbsTeh7m/XTwHbWUENvAJZpp1YA==", "dev": true }, "marked-terminal": { @@ -14235,9 +14216,9 @@ } }, "postcss-value-parser": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.0.3.tgz", - "integrity": "sha512-N7h4pG+Nnu5BEIzyeaaIYWs0LI5XC40OrRh5L60z0QjFsqGWcHcbkBvpe1WYpcIS9yQ8sOi/vIPt1ejQCrMVrg==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz", + "integrity": "sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==", "dev": true }, "prepend-http": { @@ -15051,9 +15032,9 @@ } }, "semantic-release": { - "version": "17.0.7", - "resolved": "https://registry.npmjs.org/semantic-release/-/semantic-release-17.0.7.tgz", - "integrity": "sha512-F6FzJI1yiGavzCTXir4yPthK/iozZPJ4myUYndiHhSHbmOcCSJ2m7V+P6sFwVpDpQKQp1Q31M68sTJ/Q/27Bow==", + "version": "17.0.8", + "resolved": "https://registry.npmjs.org/semantic-release/-/semantic-release-17.0.8.tgz", + "integrity": "sha512-9KcdidiJ4xchrJXxPdaDQVlybgX0xTeKyVjRySYk5u9GpjibXD7E5F8cB0BvFLMDmMyrkCwcem0kFiaLD2VNPg==", "dev": true, "requires": { "@semantic-release/commit-analyzer": "^8.0.0", @@ -15151,9 +15132,9 @@ } }, "cross-spawn": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.2.tgz", - "integrity": "sha512-PD6G8QG3S4FK/XCGFbEQrDqO2AnMMsy0meR7lerlIOHAAbkuavGU/pOqprrlvfTNjvowivTeBsjebAL0NSoMxw==", + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "dev": true, "requires": { "path-key": "^3.1.0", @@ -15162,9 +15143,9 @@ } }, "execa": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-4.0.0.tgz", - "integrity": "sha512-JbDUxwV3BoT5ZVXQrSVbAiaXhXUkIwvbhPIwZ0N13kX+5yCzOhUNdocxB/UQRuYOHRYYwAxKYwJYc0T4D12pDA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/execa/-/execa-4.0.2.tgz", + "integrity": "sha512-QI2zLa6CjGWdiQsmSkZoGtDx2N+cQIGb3yNolGTdjSQzydzLgYYf8LRuagp7S7fPimjcrzUDSUFd/MgzELMi4Q==", "dev": true, "requires": { "cross-spawn": "^7.0.0", @@ -17759,13 +17740,10 @@ "dev": true }, "yaml": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.9.2.tgz", - "integrity": "sha512-HPT7cGGI0DuRcsO51qC1j9O16Dh1mZ2bnXwsi0jrSpsLz0WxOLSLXfkABVl6bZO629py3CU+OMJtpNHDLB97kg==", - "dev": true, - "requires": { - "@babel/runtime": "^7.9.2" - } + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.0.tgz", + "integrity": "sha512-yr2icI4glYaNG+KWONODapy2/jDdMSDnrONSjblABjD9B4Z5LgiircSt8m8sRZFNi08kG9Sm0uSHtEmP3zaEGg==", + "dev": true }, "yargs": { "version": "6.4.0", diff --git a/package.json b/package.json index f958a94..c3a0e41 100644 --- a/package.json +++ b/package.json @@ -13,8 +13,8 @@ "@fortawesome/fontawesome-free": "^5.13.0", "@semantic-release/gitlab-config": "^8.0.0", "@sentry/browser": "^5.15.5", - "autoprefixer": "^9.7.6", - "bootstrap": "^4.4.1", + "autoprefixer": "^9.8.0", + "bootstrap": "^4.5.0", "browser-sync": "^2.26.7", "commitizen": "^4.1.2", "cssnano": "^4.1.10", @@ -32,7 +32,7 @@ "jquery": "^3.5.1", "pixrem": "^5.0.0", "popper.js": "^1.16.0", - "semantic-release": "^17.0.7", + "semantic-release": "^17.0.8", "typeahead.js": "^0.11.1" }, "engines": { diff --git a/requirements/local.txt b/requirements/local.txt index bd092e6..3f3fe35 100644 --- a/requirements/local.txt +++ b/requirements/local.txt @@ -33,4 +33,4 @@ flake8==3.7.9 # https://github.com/PyCQA/flake8 coverage==4.5.4 # https://github.com/nedbat/coveragepy black==19.10b0 # https://github.com/psf/black pylint-django==2.0.15 # https://github.com/PyCQA/pylint-django -pre-commit==2.2.0 # https://github.com/pre-commit/pre-commit +pre-commit==2.4.0 # https://github.com/pre-commit/pre-commit -- GitLab From ed536f5ec39875e61eb7a2be45312eb9fd4c9882 Mon Sep 17 00:00:00 2001 From: Stefan Hynek Date: Tue, 26 May 2020 09:38:50 +0200 Subject: [PATCH 5/5] ci(gitlab): observe changes in `requirements` for django build; force rebuild now --- .gitlab-ci.yml | 2 +- compose/local/django/Dockerfile | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bb92fe7..abe0ded 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -49,7 +49,7 @@ build_django: - changes: - compose/local/django/* - compose/production/django/entrypoint - - requirements/ + - requirements/* build_node: stage: build diff --git a/compose/local/django/Dockerfile b/compose/local/django/Dockerfile index a066fb8..762578b 100644 --- a/compose/local/django/Dockerfile +++ b/compose/local/django/Dockerfile @@ -2,6 +2,7 @@ FROM python:3.7-alpine ENV PYTHONUNBUFFERED 1 +ENV FORCEBUILD 1 RUN apk update \ # psycopg2 dependencies -- GitLab