Skip to content

Commit

Permalink
Merge pull request #143 from VNG-Realisatie/issue/stable-merge-conflicts
Browse files Browse the repository at this point in the history
Issue/stable merge conflicts
  • Loading branch information
alextreme authored May 24, 2021
2 parents bc7166e + d2cf7a1 commit 870b7b4
Show file tree
Hide file tree
Showing 29 changed files with 2,002 additions and 4,996 deletions.
2 changes: 1 addition & 1 deletion .github/contributing.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Contributing to Zaaktypecatalogus
# Contributing to Documenten API

## Reporting issues

Expand Down
149 changes: 149 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
name: ci-build

# Run this workflow every time a new commit pushed to your repository
on:
push:
branches:
- master
- stable/1.0.x
tags:
- '*'
pull_request:
workflow_dispatch:

env:
IMAGE_NAME: vngr/gemma-drc
DJANGO_SETTINGS_MODULE: drc.conf.jenkins
SECRET_KEY: dummy
DB_USER: postgres
DB_PASSWORD: ''
DEPLOYMENT: drc

jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
postgres: ['10', '11']

name: Tests (PG ${{ matrix.postgres }})

services:
postgres:
image: postgres:${{ matrix.postgres }}
env:
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- 5432:5432

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.6'
- uses: actions/setup-node@v2-beta
with:
node-version: '12'

# - name: Install system packages
# run: sudo apt-get install libgdal-dev gdal-bin

- name: Install dependencies
run: pip install -r requirements/jenkins.txt codecov

- name: Build frontend
run: |
npm ci
npm run build
- name: Run tests
run: |
python src/manage.py collectstatic --noinput --link
coverage run src/manage.py test src
- name: Publish coverage report
uses: codecov/codecov-action@v1

docker:
runs-on: ubuntu-latest
name: Docker image build

steps:
- uses: actions/checkout@v2
- name: Determine tag/commit hash
id: vars
run: |
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name (if present at all)
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Use Docker `latest` tag convention
[ "$VERSION" == "master" ] && VERSION=latest
echo ::set-output name=tag::${VERSION}
echo ::set-output name=git_hash::${GITHUB_SHA}
- name: Build the Docker image
run: |
docker build . \
--build-arg COMMIT_HASH=${{ steps.vars.outputs.git_hash }}
# - run: docker image save -o image.tar $IMAGE_NAME:${{ steps.vars.outputs.tag }}
# - name: Store image artifact
# uses: actions/upload-artifact@v2
# with:
# name: docker-image
# path: image.tar
# retention-days: 1

publish:
needs:
- tests
- docker

name: Push Docker image
runs-on: ubuntu-latest
if: github.event_name == 'push' # exclude PRs/forks

steps:
- uses: actions/checkout@v2
# - name: Download built image
# uses: actions/download-artifact@v2
# with:
# name: docker-image
- name: Publish latest image
env: # Or as an environment variable
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
DEPLOY_BOT_TOKEN: ${{ secrets.DEPLOY_BOT_TOKEN }}
run: |
BRANCH=$(git rev-parse --abbrev-ref HEAD)
if [ "$BRANCH" == "master" ]; then
bash bin/cicd.sh latest no
fi
- name: Publish tagged image
env: # Or as an environment variable
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
DEPLOY_BOT_TOKEN: ${{ secrets.DEPLOY_BOT_TOKEN }}
run: |
TAG=$(git name-rev --tags --name-only $(git rev-parse HEAD))
if [ "$TAG" != "undefined" ]; then
bash bin/cicd.sh $TAG yes
fi
# - name: Determine tag/commit hash
# id: vars
# run: |
# # Strip git ref prefix from version
# VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# # Strip "v" prefix from tag name (if present at all)
# [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# # Use Docker `latest` tag convention
# [ "$VERSION" == "develop" ] && VERSION=latest
# echo ::set-output name=tag::${VERSION}
# - name: Load image
# run: |
# docker image load -i image.tar
# - name: Log into registry
# run: echo "${{ secrets.DOCKER_TOKEN }}" | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin

# - name: Push the Docker image
# run: docker push $IMAGE_NAME:${{ steps.vars.outputs.tag }}
43 changes: 43 additions & 0 deletions .github/workflows/code_quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Code quality checks

# Run this workflow every time a new commit pushed to your repository
on:
push:
branches:
- master
- stable/1.0.x
paths:
- '**.py'
pull_request:
paths:
- '**.py'
workflow_dispatch:

jobs:
isort:
name: Code imports
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.6'
- name: Install dependencies
run: pip install -r requirements/jenkins.txt
- name: Run isort
run: isort --check-only --diff .

black:
name: Code format
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.6'
- name: Install dependencies
run: pip install -r requirements/jenkins.txt
- name: Run black
run: black --check --diff src docs
59 changes: 0 additions & 59 deletions .travis.yml

This file was deleted.

40 changes: 40 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,46 @@
Wijzigingen
===========

1.0.2 (...)
===========

API spec changes
----------------

* Add ETag headers to the following resources (`Issue 1096`_):
- ``EnkelvoudigInformatieObject``
- ``Gebruiksrechten``
- ``ObjectInformatieObject``
* Enable uploading of large files for ``EnkelvoudigInformatieObject`` (`Issue 1078`_)
* Remove audittrail headers from ``ObjectInformatieObject`` resource
* Implement caching (conditional GET with ETag headers) (`Issue 1096`_)
* Add ``verzoek`` type to possible ``ObjectInformatieObject.object_type`` and ``kcc`` to component enum
* Change ``ObjectInformatieObject.object`` ``maxLength`` from 200 -> 1000 (`Issue 1542`_)


Implementation changes
----------------------

* Add validation for ``EnkelvoudigInformatieObject.inhoud`` type (`Issue 1530`_)
* Fix error that occurred when trying to download a deleted/nonexistent ``EnkelvoudigInformatieObject`` (`Issue 1617`_)
* Remove audittrail logging and notifications from ``ObjectInformatieObject`` resource
* Fix 406 error that occurred when trying to download ``ObjectInformatieObject.inhoud`` with ``application/octet-stream`` header (`Issue 1280`_)
* Fix documentation references in API schema description (`Issue 1552`_)
* Display API version and commit hash on component dashboard (`Issue 1706`_)

Breaking changes
----------------


.. _Issue 1530: https://github.com/VNG-Realisatie/gemma-zaken/issues/1530
.. _Issue 1552: https://github.com/VNG-Realisatie/gemma-zaken/issues/1552
.. _Issue 1617: https://github.com/VNG-Realisatie/gemma-zaken/issues/1617
.. _Issue 1078: https://github.com/VNG-Realisatie/gemma-zaken/issues/1078
.. _Issue 1280: https://github.com/VNG-Realisatie/gemma-zaken/issues/1280
.. _Issue 1096: https://github.com/VNG-Realisatie/gemma-zaken/issues/1096
.. _Issue 1542: https://github.com/VNG-Realisatie/gemma-zaken/issues/1542
.. _Issue 1706: https://github.com/VNG-Realisatie/gemma-zaken/issues/1706

1.0.1 (2019-12-16)
==================

Expand Down
Loading

0 comments on commit 870b7b4

Please sign in to comment.