-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(conf): improve project configuration
- Loading branch information
1 parent
5e83a5e
commit 6a4c290
Showing
103 changed files
with
825 additions
and
407 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,4 @@ | |
.pre-commit-config.yaml | ||
.readthedocs.yml | ||
.travis.yml | ||
venv | ||
venv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- chore-improve-project-configuration | ||
|
||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup NodeJS | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 'lts/*' | ||
|
||
- name: Install requirements | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install python3.10 nodejs | ||
npm install @semantic-release/changelog @semantic-release/git conventional-changelog-conventionalcommits | ||
- name: Import GPG key | ||
uses: crazy-max/ghaction-import-gpg@v5 | ||
env: | ||
GPG_KEY: ${{ secrets.GPG_KEY }} | ||
with: | ||
git_commit_gpgsign: true | ||
git_committer_email: ${{ secrets.GIT_COMMITTER_EMAIL }} | ||
git_committer_name: ${{ secrets.GIT_COMMITTER_NAME }} | ||
git_tag_gpgsign: true | ||
git_user_signingkey: true | ||
gpg_private_key: ${{ secrets.GPG_KEY }} | ||
passphrase: ${{ secrets.GPG_KEY_PASSPHRASE }} | ||
|
||
- name: Test sign | ||
run: | | ||
echo 'Something' >> test.md | ||
git add test.md | ||
GIT_TRACE=2 git commit -m "test: commit [skip ci]" | ||
git verify-commit $( git rev-parse HEAD ) | ||
env: | ||
GPG_KEY_PASSPHRASE: ${{ secrets.GPG_KEY_PASSPHRASE }} | ||
GIT_COMMITTER_NAME: ${{ secrets.GIT_COMMITTER_NAME }} | ||
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }} | ||
GIT_AUTHOR_NAME: SomeBot | ||
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }} | ||
|
||
- name: Create a release | ||
run: npx semantic-release | ||
env: | ||
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }} | ||
GIT_AUTHOR_NAME: ${{ secrets.GIT_COMMITTER_NAME }} | ||
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }} | ||
GIT_COMMITTER_NAME: ${{ secrets.GIT_COMMITTER_NAME }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GPG_KEY_PASSPHRASE: ${{ secrets.GPG_KEY_PASSPHRASE }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
exclude: "docs|node_modules|migrations|.git|.tox" | ||
default_stages: [commit] | ||
# fail_fast: true | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.3.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: check-yaml | ||
- id: check-added-large-files | ||
|
||
- repo: https://github.com/psf/black | ||
rev: 22.6.0 | ||
hooks: | ||
- id: black | ||
|
||
- repo: https://github.com/timothycrosley/isort | ||
rev: 5.10.1 | ||
hooks: | ||
- id: isort | ||
args: ["--profile", "black"] | ||
|
||
- repo: https://gitlab.com/pycqa/flake8 | ||
rev: 3.9.2 | ||
hooks: | ||
- id: flake8 | ||
args: ["--config=tox.ini"] | ||
additional_dependencies: [flake8-isort] | ||
|
||
# sets up .pre-commit-ci.yaml to ensure pre-commit dependencies stay up to date | ||
ci: | ||
autoupdate_schedule: weekly | ||
skip: [] | ||
submodules: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
branches: ["chore-improve-project-configuration"] | ||
debug: false | ||
dryRun: false | ||
plugins: | ||
- ["@semantic-release/commit-analyzer", { | ||
parserOpts: { | ||
noteKeywords: [ "BREAKING CHANGE", "BREAKING CHANGES", "BREAKING" ], | ||
}, | ||
preset: "angular", | ||
releaseRules: [ | ||
{type: "chore", scope: "conf", release: "patch"}, | ||
{type: "chore", scope: "config", release: "patch"}, | ||
{type: "chore", scope: "core", release: "minor"}, | ||
{type: "chore", scope: "deps", release: "patch"} | ||
] | ||
} | ||
] | ||
- ["@semantic-release/release-notes-generator", { | ||
parserOpts: { | ||
noteKeywords: [ "BREAKING CHANGE", "BREAKING CHANGES", "BREAKING" ], | ||
}, | ||
preset: "conventionalcommits", | ||
presetConfig: { | ||
types: [ | ||
{ type: "chore", scope: "deps", section: "Dependency Updates" }, | ||
{ type: "chore", section: "Refactors" }, | ||
{ type: "docs", hidden: true }, | ||
{ type: "feat", section: "Features" }, | ||
{ type: "fix", section: "Bug Fixes" }, | ||
{ type: "perf", hidden: true }, | ||
{ type: "refactor", section: "Refactors" }, | ||
{ type: "style", hidden: true }, | ||
{ type: "test", hidden: true } | ||
] | ||
}, | ||
writerOpts: { | ||
commitsSort: [ "subject", "scope" ], | ||
} | ||
} | ||
] | ||
- ["@semantic-release/changelog", | ||
changelogFile: "docs/CHANGELOG.md" | ||
] | ||
- ["@semantic-release/git", { | ||
assets: [ "docs/*" ], | ||
message: "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" | ||
} | ||
] | ||
- "@semantic-release/github" | ||
tagFormat: v${version} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
# IDR Server | ||
|
||
IDR(Integrated Data Repository) Server is a service that houses metadata | ||
for/and receives extracted data from ICDR Clients. | ||
IDR(Integrated Data Repository) Server is a service that houses extract metadata | ||
for/and receives extracted data from [IDR Clients](https://github.com/savannahghi/idr-client). | ||
|
||
[![Coverage Status](https://coveralls.io/repos/github/savannahghi/idr-server/badge.svg)](https://coveralls.io/github/savannahghi/idr-server) | ||
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit) | ||
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +0,0 @@ | ||
from django.contrib import admin | ||
|
||
# Register your models here. | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +0,0 @@ | ||
from django.db import models | ||
|
||
# Create your models here. | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from django.test import TestCase | ||
# from django.test import TestCase | ||
|
||
# Create your tests here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
from django.urls import path | ||
from knox.views import LogoutView, LogoutAllView | ||
from knox.views import LogoutAllView, LogoutView | ||
|
||
from .apiviews import LoginView | ||
|
||
|
||
urlpatterns = [ | ||
path("auth/login/", LoginView.as_view(), name="api_login"), | ||
path("auth/logout/", LogoutView.as_view(), name="api_logout"), | ||
path("auth/logoutall/", LogoutAllView.as_view(), name="api_logoutall") | ||
path("auth/logoutall/", LogoutAllView.as_view(), name="api_logoutall"), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from django.shortcuts import render | ||
# from django.shortcuts import render | ||
|
||
# Create your views here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
from apps.core.models import AbstractDataSource | ||
|
||
|
||
# ============================================================================= | ||
# COMMON MODELS | ||
# ============================================================================= | ||
|
||
|
||
class GenericSource(AbstractDataSource): | ||
"""This is a generic data source.""" | ||
|
||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ | |
|
||
|
||
class GenericSourceSerializer(AuditBaseSerializer): | ||
|
||
class Meta: | ||
model = GenericSource | ||
fields = "__all__" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from django.test import TestCase | ||
# from django.test import TestCase | ||
|
||
# Create your tests here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,10 @@ | ||
from django.urls import include, path | ||
|
||
from rest_framework.routers import DefaultRouter | ||
|
||
from .apiviews import GenericSourceViewSet | ||
|
||
|
||
router = DefaultRouter() | ||
router.register("generic_sources", GenericSourceViewSet) | ||
|
||
|
||
urlpatterns = [ | ||
path("", include(router.urls)) | ||
] | ||
urlpatterns = [path("", include(router.urls))] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from django.shortcuts import render | ||
# from django.shortcuts import render | ||
|
||
# Create your views here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.