Skip to content
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

feat: clean up & refactor majorly #171

Merged
merged 37 commits into from
May 19, 2024
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
a56bb15
feat: remove scripts and add then in one place ie Makefile
JaeAeich May 11, 2024
b854244
chore: restructure deployement stuff
JaeAeich May 11, 2024
2dd67a7
chore: rename src to tesk
JaeAeich May 11, 2024
eaa230c
typo
JaeAeich May 11, 2024
aea50bd
restructure tests folder
JaeAeich May 11, 2024
301bb54
rename core to service
JaeAeich May 11, 2024
5ff8a07
refactor makefile command names
JaeAeich May 11, 2024
7ef9206
restructure docs and tests
JaeAeich May 11, 2024
38a0f2c
add poetry and checks
JaeAeich May 11, 2024
5c301d9
add ruff and fix format and lint issues
JaeAeich May 12, 2024
439e9cb
add lint and format in CI and fix some stuff
JaeAeich May 12, 2024
743f073
test command
JaeAeich May 12, 2024
988009b
tests fixed a lil bit
JaeAeich May 12, 2024
e16775a
fix: console script
JaeAeich May 13, 2024
6c9d1be
chore: change dockerfile due to moving to pyproject
JaeAeich May 13, 2024
afc0b94
fix tests a lil more
JaeAeich May 13, 2024
6cedfd5
test: fix S3 filer location constraint
uniqueg May 13, 2024
d4cd1a1
test: fix test file path
uniqueg May 13, 2024
2a0b025
fix tests a lil more, only 2 failing
JaeAeich May 13, 2024
a9cd65a
tests fixed :) locally :(
JaeAeich May 14, 2024
91a9dc0
CI test fix
JaeAeich May 14, 2024
5cd4940
github actions cache, and create dep groups in pyproject for CI
JaeAeich May 14, 2024
166012e
feat: add spell-checker, code-review, fix format of image to oci, and…
JaeAeich May 16, 2024
444d3b3
feat: some CI checks
JaeAeich May 16, 2024
939d48e
fix: sourcery errors
JaeAeich May 18, 2024
868291b
fix: safety errors
JaeAeich May 18, 2024
ce82dbc
fix: bandit errors
JaeAeich May 18, 2024
e5ad07a
fix: mypy errors
JaeAeich May 18, 2024
92fce10
fix: CI
JaeAeich May 18, 2024
2b477d1
fix: remove sourcery because eww
JaeAeich May 18, 2024
2da83fb
chore: minor renaming stuff
JaeAeich May 18, 2024
b6d3e27
chore: rename to
JaeAeich May 18, 2024
9345667
fix: test ci
JaeAeich May 18, 2024
6d73f00
chore: remove coverage report
JaeAeich May 19, 2024
863ec10
chore: remove empty file
JaeAeich May 19, 2024
2dd5fc7
chore: remove helm install from CI
JaeAeich May 19, 2024
46cba22
chore: add badge
JaeAeich May 19, 2024
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
23 changes: 20 additions & 3 deletions .dockerignore
JaeAeich marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
.coverage
# cache and dot files
.eggs/
JaeAeich marked this conversation as resolved.
Show resolved Hide resolved
.venv/
.mypy_cache/
.pytest_cache/
.tox/
.coverage/
.ruff/
.ruff_cache/
.eggs/
tesk-core/containers/
.github/
.gitignore
# Docs and atifacts
./deployment
JaeAeich marked this conversation as resolved.
Show resolved Hide resolved
./docs
/images
# build
./build
JaeAeich marked this conversation as resolved.
Show resolved Hide resolved
./dist
# Scripts and tools
./scripts
Makefile
PULL_REQUEST_TEMPLATE.md
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/general-purpose.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Your issue may already be reported!
Please search on the [issue tracker](https://github.com/elixir-cloud-aai/TESK/issues) before creating one.

## Expected Behavior
<!--- If you're describing a bug, tell us what should happen -->
<!--- If you're suggesting a change/improvement, tell us how it should work -->

## Current Behavior
<!--- If describing a bug, tell us what happens instead of the expected behavior -->
<!--- If suggesting a change/improvement, explain the difference from current behavior -->

## Possible Solution
<!--- Not obligatory, but suggest a fix/reason for the bug, -->
<!--- or ideas how to implement the addition or change -->

## Steps to Reproduce (for bugs)
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
<!--- reproduce this bug. Include code to reproduce, if relevant -->
1.
2.
3.
4.

## Context
<!--- How has this issue affected you? What are you trying to accomplish? -->
<!--- Providing context helps us come up with a solution that is most useful in the real world -->

## Your Environment
<!--- Include as many relevant details about the environment you experienced the bug in -->
* Version used:
* Browser Name and version:
* Operating System and version (desktop or mobile):
* Link to your project:
58 changes: 58 additions & 0 deletions .github/workflows/code_lint_format.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Code Quality

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Install poetry
run: pipx install poetry

- name: Set up Python
uses: actions/setup-python@v5
id: cql
with:
python-version: '3.11'
cache: 'poetry'

# Install lint deps only
- name: Install dependencies
if: steps.cql.outputs.cache-hit != 'true'
run: poetry install --only=lint --no-interaction --no-root

- name: Check code quality
run: poetry run ruff check .

format:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Install poetry
run: pipx install poetry

- name: Set up Python
uses: actions/setup-python@v5
id: cqf
with:
python-version: '3.11'
cache: 'poetry'

# Install lint deps only
- name: Install dependencies
if: steps.cqf.outputs.cache-hit != 'true'
run: poetry install --only=lint --no-interaction --no-root

- name: Check code style
run: poetry run ruff format --check
45 changes: 45 additions & 0 deletions .github/workflows/code_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Code Test

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
unit-test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.11', '3.12', '3.13']
JaeAeich marked this conversation as resolved.
Show resolved Hide resolved

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Install poetry
run: pipx install poetry

# Set up python versions with matrix to test on multiple versions
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
id: ctut-${{ matrix.python-version}}
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'

# Install all test dependencies
- name: Install dependencies
if: steps.ctut-${{ matrix.python-version }}.outputs.cache-hit != 'true'
run: poetry install --only=test --no-interaction --no-root

- name: Run tests
run: poetry run pytest tests/test_unit

# # Upload coverage reports to Codecov once the tests start running 😭
# - name: Upload coverage reports to Codecov
# uses: codecov/codecov-action@v3
# env:
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
with:
context: .
push: true
file: ./containers/filer.Dockerfile
file: ./deployment/containers/filer.Dockerfile
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
with:
context: .
push: true
file: ./containers/taskmaster.Dockerfile
file: ./deployment/containers/taskmaster.Dockerfile
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: Helm Chart Testing

on:
pull_request:
branches: [master]
branches: [main]
JaeAeich marked this conversation as resolved.
Show resolved Hide resolved

jobs:
helm:
helm-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -23,19 +23,19 @@ jobs:

- name: Helm Deps
run: |
for dir in $(ls -d charts/*); do
for dir in $(ls -d deployment/charts/*); do
helm dependency update $dir;
done

- name: Helm Lint
run: |
for dir in $(ls -d charts/*); do
for dir in $(ls -d deployment/charts/*); do
helm lint $dir
done

- name: Apply Helm file
run: helm install -n tesk tesk . -f values.yaml
working-directory: charts/tesk
working-directory: deployment/charts/tesk

- name: Sleep for 30 seconds
run: sleep 30
Expand Down
54 changes: 54 additions & 0 deletions .github/workflows/pr_evaulations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: PR Evaluation

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review, edited]
branches: ['main']

jobs:
semantic_pr:
name: Semantic PR title
JaeAeich marked this conversation as resolved.
Show resolved Hide resolved
runs-on: ubuntu-latest
if: ${{ github.event.action != 'edited' || github.event.changes.title != null }}
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# Configure which types are allowed (newline-delimited).
# Default: https://github.com/commitizen/conventional-commit-types
types: |
fix
feat
docs
style
refactor
perf
test
build
ci
chore
revert
# Configure additional validation for the subject based on a regex.
# This example ensures the subject doesn't start with an uppercase character & has more than 50 chars.
subjectPattern: ^(?![A-Z])(?=.{1,50}$).+$
# If `subjectPattern` is configured, you can use this property to override
# the default error message that is shown when the pattern doesn't match.
# The variables `subject` and `title` can be used within the message.
JaeAeich marked this conversation as resolved.
Show resolved Hide resolved
subjectPatternError: |
The subject "{subject}" found in the pull request title "{title}"
didn't match the configured pattern. Please ensure that the subject
doesn't start with an uppercase character & not have more than 50 characters.

detect-unresolved-conflicts:
name: Detect unresolved merge conflicts
runs-on: ubuntu-latest
needs: semantic_pr
steps:
- uses: actions/checkout@v3
- name: List files with merge conflict markers
run: git --no-pager grep "<<<<<<<" ":(exclude).github/" || true
- name: Fail or succeed job if any files with merge conflict markers have been checked in
# Find lines containing "<<<<<<<", then count the number of lines.
# 0 matching lines results in exit code 0, i.e. success.
run: exit $(git grep "<<<<<<<" ":(exclude).github/" | wc --lines)
25 changes: 0 additions & 25 deletions .github/workflows/tox.yml

This file was deleted.

37 changes: 37 additions & 0 deletions .github/workflows/type_check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# # This workflow should work but will fail
# # as the code has no types, will add types to the
# # code and then uncomment it 👍
# name: Type Check

# on:
# push:
# branches:
# - main
# pull_request:
# branches:
# - main

# jobs:
# check-type:
# runs-on: ubuntu-latest
# steps:
# - name: Check out repository
# uses: actions/checkout@v4

# - name: Install poetry
# run: pipx install poetry

# - name: Set up python
# id: tcct
# uses: actions/setup-python@v5
# with:
# python-version: '3.11'
# cache: 'poetry'

# # Install only type check dependency
# - name: Install dependencies
# if: steps.tcct.outputs.cache-hit != 'true'
# run: poetry install --only=type --no-root

# - name: Check types
# run: poetry run mypy tesk/
1 change: 0 additions & 1 deletion MANIFEST.in

This file was deleted.

Loading
Loading