Skip to content

Commit

Permalink
Merge pull request #9 from maykinmedia/feature/community-update
Browse files Browse the repository at this point in the history
Community update
  • Loading branch information
joeribekker authored May 22, 2024
2 parents 616dafa + e13fc41 commit 654fc8e
Show file tree
Hide file tree
Showing 39 changed files with 1,132 additions and 1,156 deletions.
29 changes: 29 additions & 0 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[bumpversion]
commit = False
tag = False
current_version = 0.1.0
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<pre>[a-z]+)\.(?P<build>\d+))?
serialize =
{major}.{minor}.{patch}-{pre}.{build}
{major}.{minor}.{patch}

[bumpversion:part:pre]
first_value = alpha
values =
alpha
beta
rc

[bumpversion:file:src/referentielijsten/__init__.py]

[bumpversion:file:README.rst]
search = :Version: {current_version}
replace = :Version: {new_version}

[bumpversion:file:README.EN.rst]
search = :Version: {current_version}
replace = :Version: {new_version}

[bumpversion:file:package.json]
search = "version": "{current_version}",
replace = "version": "{new_version}",
5 changes: 5 additions & 0 deletions .github/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: Ondersteuning met prioriteit / Priority support
url: https://opengem.nl/contact/
about: Neem direct contact met ons op / Contact us directly to get priority support.
File renamed without changes.
32 changes: 32 additions & 0 deletions .github/workflows/generate-postman-collection.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: generate-postman-collection

on:
push:
paths:
- "src/referentielijsten/api/v*/openapi.yaml"
- ".github/workflows/generate-postman-collection.yml"
branches:
- '**'
workflow_dispatch:

jobs:
run:
runs-on: ubuntu-latest
strategy:
matrix:
version: [ 'v1' ]

name: Run with version ${{ matrix.version }}

steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install dependencies
run: npm install -g openapi-to-postmanv2
- name: Create tests folder
run: mkdir -p ./tests/postman
- name: Generate Postman collection
run: openapi2postmanv2 -s ./src/referentielijsten/api/openapi.yaml -o ./tests/postman/collection.json --pretty
42 changes: 42 additions & 0 deletions .github/workflows/generate-sdks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: generate-sdks

on:
push:
paths:
- "src/referentielijsten/api/v*/openapi.yaml"
- ".github/workflows/generate-sdks.yml"
branches:
- '**'
workflow_dispatch:

jobs:
run:
runs-on: ubuntu-latest
strategy:
matrix:
version: [ 'v1' ]

name: Run with version ${{ matrix.version }}

steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install dependencies
run: npm install -g @openapitools/openapi-generator-cli
- name: Determing oas path
id: vars
run: echo ::set-output name=oas::./src/referentielijsten/api/openapi.yaml
- name: Validate schema
run: openapi-generator-cli validate -i ${{ steps.vars.outputs.oas }}
- name: Generate Java client
run: openapi-generator-cli generate -i ${{ steps.vars.outputs.oas }} --global-property=modelTests=false,apiTests=false,modelDocs=false,apiDocs=false \
-o ./sdks/java -g java --additional-properties=dateLibrary=java8,java8=true,optionalProjectFile=false,optionalAssemblyInfo=false
- name: Generate .NET client
run: openapi-generator-cli generate -i ${{ steps.vars.outputs.oas }} --global-property=modelTests=false,apiTests=false,modelDocs=false,apiDocs=false \
-o ./sdks/net -g csharp --additional-properties=optionalProjectFile=false,optionalAssemblyInfo=false
- name: Generate Python client
run: openapi-generator-cli generate -i ${{ steps.vars.outputs.oas }} --global-property=modelTests=false,apiTests=false,modelDocs=false,apiDocs=false \
-o ./sdks/python -g python --additional-properties=optionalProjectFile=false,optionalAssemblyInfo=false+
30 changes: 30 additions & 0 deletions .github/workflows/lint-oas.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: lint-oas

on:
push:
paths:
- "src/referentielijsten/api/v*/openapi.yaml"
- .github/workflows/lint-oas.yml
branches:
- '**'
workflow_dispatch:

jobs:
run:
runs-on: ubuntu-latest
strategy:
matrix:
version: [ 'v1' ]

name: Run with version ${{ matrix.version }}

steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install spectral
run: npm install -g @stoplight/spectral@5
- name: Run OAS linter
run: spectral lint ./src/referentielijsten/api/openapi.yaml
29 changes: 29 additions & 0 deletions .github/workflows/quick-start.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# name: quick-start

# on: [push]

# jobs:
# run:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: Download docker-compose file
# run: wget https://raw.githubusercontent.com/maykinmedia/referentielijsten/master/docker-compose.yml -O docker-compose-qs.yml
# - name: Overwrite the docker-compose file to get the "current" one
# run: cp docker-compose-qs.yml docker-compose.yml
# - name: Start docker containers
# run: docker-compose up -d --no-build
# - name: Wait until DB container starts
# run: sleep 10
# # - name: Load fixtures
# # run: docker-compose exec -T web src/manage.py loaddata demodata
# - name: Create superuser
# run: docker-compose exec -T web src/manage.py createsuperuser --username admin --email admin@admin.nl --no-input
# - name: Check main page
# run: |
# curl_status=$(curl -w '%{http_code}' -o /dev/null -s http://localhost:8000/)
# if [[ $curl_status != 200 ]]; then
# printf "Index page responds with ${curl_status} status.\r\n\r\n" >&2
# curl -i http://localhost:8000
# exit 1
# fi
2 changes: 1 addition & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ Change history
0.1.0
=====

*<month, day year>*
*tbd*

* Initial release.
73 changes: 73 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to make participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies within all project spaces, and it also applies when
an individual is representing the project or its community in public spaces.
Examples of representing a project or community include using an official
project e-mail address, posting via an official social media account, or acting
as an appointed representative at an online or offline event. Representation of
a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at `support@maykinmedia.nl`. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org
76 changes: 76 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Contribution guidelines

If you want to contribute, we ask you to follow these guidelines.

## Reporting bugs

If you have encountered a bug in this project, please check if an issue already
exists in the list of existing [issues][issues]. If such an issue does not
exist, you can create a [new issue][new_issue]. When writing the bug report,
try to add a clear example that shows how to reproduce said bug.

## Adding new features

Before making making changes to the code, we advise you to first check the list
of existing [issues][issues] for this project to see if an issue for the
suggested changes already exists. If such an issue does not exist, you can
create a [new issue][new_issue]. Creating an issue gives an opportunity for
other developers to give tips even before you start coding.

### Code style

To keep the code clean and readable, this project uses:

- [`isort`](https://github.com/timothycrosley/isort) to order the imports
- [`black`](https://github.com/psf/black) to format the code and keep diffs for
pull requests small
- [`flake8`](https://github.com/PyCQA/flake8) to clean up code (removing unused
imports, etc.)

Whenever a branch is pushed or a pull request is made, the code will be checked
in CI by the tools mentioned above, so make sure to install these tools and run
them locally before pushing branches/making pull requests.

This project aims to meet the criteria of the
[Standard for Public Code][Standard_for_Public_Code]. Please make sure that
your pull requests are compliant, that will make the reviews quicker.

### Forking the repository

In order to implement changes to this project when you do not have rights for
this [repository][repository], you must first fork the repository. Once the
repository is forked, you can clone it to your local machine.

### Making the changes

On your local machine, create a new branch, and name it like:
- `feature/some-new-feature`, if the changes implement a new feature
- `issue/some-issue`, if the changes fix an issue

Once you have made changes or additions to the code, you can commit them (try
to keep the commit message descriptive but short). If an issue already exists
in the list of existing [issues][issues] for the changes you made, be sure to
format your commit message like
`:gitmoji: Fixes #<issue_id> -- description of changes made`, where
`<issue_id>` corresponds to the number of the issue on GitHub. To demonstrate
that the changes implement the new feature/fix the issue, make sure to also add
tests to the existing Django testsuite.

### Making a pull request

If all changes have been committed, you can push the branch to your fork of the
repository and create a pull request to the `master` branch of this project's
repository. Your pull request will be reviewed, if applicable, feedback will be
given and if everything is approved, it will be merged.

### Reviews on releases

All pull requests will be reviewed by a project member before they are merged
to a release branch.


[issues]: https://github.com/maykinmedia/referentielijsten/issues
[new_issue]: https://github.com/maykinmedia/referentielijsten/issues/new/choose
[mailinglist]: t.b.d.
[Standard_for_Public_Code]: https://standard.publiccode.net
[repository]: https://github.com/maykinmedia/referentielijsten
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ ENV RELEASE=${RELEASE} \
ARG SECRET_KEY=dummy

LABEL org.label-schema.vcs-ref=$COMMIT_HASH \
org.label-schema.vcs-url="https://bitbucket.org/maykinmedia/referentielijsten" \
org.label-schema.vcs-url="https://github.com/maykinmedia/referentielijsten" \
org.label-schema.version=$RELEASE \
org.label-schema.name="referentielijsten"

Expand Down
Loading

0 comments on commit 654fc8e

Please sign in to comment.