diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..7c3ddada --- /dev/null +++ b/.dockerignore @@ -0,0 +1,61 @@ +# Version control & IDEs +.git +.gitignore +.vscode +.idea +.agents +.gemini + +# Build artifacts & compiled outputs +frontend +dist +**/dist +out-tsc +**/out-tsc +bazel-out + +# Dependencies & framework caches +node_modules +**/node_modules +.angular +**/.angular +.nx +**/.nx +.sass-cache +**/.sass-cache + +# Python virtual environments & caches +.venv +**/__pycache__ +**/.mypy_cache +**/.ruff_cache +**/.pytest_cache +*.py[cod] +*$py.class +*.egg-info + +# Testing & coverage +coverage +**/coverage +.coverage +htmlcov + +# Logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Environment & local deployment/dev files +.env* +!.env.example +ansible +deploy.sh +lint.sh +version_bump.sh +Makefile +README.md +CHANGES.md +typings +.DS_Store +Thumbs.db diff --git a/.gitignore b/.gitignore index d0130487..004d5cab 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,51 @@ +# IDEs & System Files .idea/ -frontend +.DS_Store +Thumbs.db + +# Build outputs +frontend/ +dist/ +**/dist/ +out-tsc/ +**/out-tsc/ +bazel-out/ + +# Angular & Nx caches +.angular/ +**/.angular/ +.nx/ +**/.nx/ +.sass-cache/ + +# Dependencies +node_modules/ +**/node_modules/ + +# Python & Virtual Environments +.venv/ +**/__pycache__/ +*.py[cod] +*$py.class +*.egg-info/ +.mypy_cache/ +**/.mypy_cache/ +.ruff_cache/ +**/.ruff_cache/ +.pytest_cache/ +**/.pytest_cache/ + +# Testing & Coverage +coverage/ +**/coverage/ +.coverage +htmlcov/ + +# Logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* # Ignore Pyright-generated stubs *.pyi diff --git a/.vscode/settings.json b/.vscode/settings.json index a372cad8..3d0ebd07 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -27,19 +27,36 @@ "files.exclude": { "**/__pycache__": true, "**/.mypy_cache": true, + "**/.ruff_cache": true, + "**/.pytest_cache": true, ".idea": true, "**/node_modules": true, "typings": true, + "frontend": true, + "**/.angular": true, + "**/.nx": true, + "**/out-tsc": true, + "**/dist": true, + "**/.sass-cache": true, + "**/coverage": true }, "search.exclude": { "**/__pycache__": true, "**/.mypy_cache": true, + "**/.ruff_cache": true, + "**/.pytest_cache": true, ".idea": true, "**/node_modules": true, "**/poetry.lock": true, "**/package-lock.json": true, - "/overlord/.angular/**": true, "typings": true, + "frontend/**": true, + "**/.angular/**": true, + "**/.nx/**": true, + "**/out-tsc/**": true, + "**/dist/**": true, + "**/.sass-cache/**": true, + "**/coverage/**": true }, "editor.codeActionsOnSave": { "source.fixAll.ruff": "always", diff --git a/Dockerfile b/Dockerfile index cacb5c99..0d494b6e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,7 +29,6 @@ RUN \ else echo "Lockfile not found." && exit 1; \ fi - FROM python:3.14-slim AS runner LABEL maintainer="Amritanshu " diff --git a/lint.sh b/lint.sh index 1057372e..c9eb4495 100755 --- a/lint.sh +++ b/lint.sh @@ -7,10 +7,10 @@ parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" || exit ; pwd -P ) cd "$parent_path/overlord" || exit npx prettier --write src/app npx ng lint --fix -cd "$parent_path/brewman" || exit -uvx ruff format . -uvx ruff check . # Lint all files in the current directory (and any subdirectories) -uvx bandit --recursive brewman -uvx bandit --recursive . -uvx safety check \ No newline at end of file +cd "$parent_path/brewman" || exit +uv run ruff format . +uv run ruff check . # Lint all files in the current directory (and any subdirectories) +uv run bandit --recursive brewman +uv run bandit --recursive . +uv run safety check \ No newline at end of file diff --git a/overlord/src/app/issue/issue.component.html b/overlord/src/app/issue/issue.component.html index 091279ef..b4d0278d 100644 --- a/overlord/src/app/issue/issue.component.html +++ b/overlord/src/app/issue/issue.component.html @@ -134,9 +134,9 @@ Created on {{ form.creationDate().value() | localTime }} and Last Edited on  {{ form.lastEditDate().value() | localTime }} by  {{ form.userName() }} by {{ form.userName().value().name }}. - {{ form.posted() ? 'Posted by ' + form.poster() : '' }} + {{ form.posted().value() ? 'Posted by ' + form.poster().value() : '' }} } diff --git a/overlord/src/app/issue/issue.component.ts b/overlord/src/app/issue/issue.component.ts index 2e3988d5..11d7c071 100644 --- a/overlord/src/app/issue/issue.component.ts +++ b/overlord/src/app/issue/issue.component.ts @@ -58,7 +58,7 @@ export interface IssueFormModel { posted: boolean; creationDate: string; lastEditDate: string; - userName: string; + userName: User; poster: string; } @@ -139,7 +139,7 @@ export class IssueComponent { posted: voucher.posted, creationDate: voucher.creationDate, lastEditDate: voucher.lastEditDate, - userName: voucher.user?.name ?? '', + userName: voucher.user ?? new User(), poster: voucher.poster ?? '', }; }, diff --git a/overlord/src/app/journal/journal.component.html b/overlord/src/app/journal/journal.component.html index 51ea8b5a..2de866e4 100644 --- a/overlord/src/app/journal/journal.component.html +++ b/overlord/src/app/journal/journal.component.html @@ -174,8 +174,8 @@ Created on {{ form.creationDate().value() | localTime }} and Last Edited on  {{ form.lastEditDate().value() | localTime }} by  {{ form.userName() }}. {{ form.posted() ? 'Posted by ' + form.poster() : '' }} + > by {{ form.userName().value().name }}. {{ form.posted().value() ? 'Posted by ' + form.poster().value() : '' }} } diff --git a/overlord/src/app/journal/journal.component.ts b/overlord/src/app/journal/journal.component.ts index ed4460b5..56bb7c96 100644 --- a/overlord/src/app/journal/journal.component.ts +++ b/overlord/src/app/journal/journal.component.ts @@ -26,6 +26,7 @@ import { AccountService } from '../core/account.service'; import { CostCentre } from '../core/cost-centre'; import { DbFile } from '../core/db-file'; import { Journal } from '../core/journal'; +import { User } from '../core/user'; import { Voucher } from '../core/voucher'; import { VoucherService } from '../core/voucher.service'; import { AccountingPipe } from '../shared/accounting.pipe'; @@ -64,7 +65,7 @@ export interface JournalFormModel { posted: boolean; creationDate: string; lastEditDate: string; - userName: string; + userName: User; poster: string; } @@ -194,7 +195,7 @@ export class JournalComponent { posted: voucher.posted, creationDate: voucher.creationDate, lastEditDate: voucher.lastEditDate, - userName: voucher.user?.name ?? '', + userName: voucher.user ?? new User(), poster: voucher.poster, }), }); diff --git a/overlord/src/app/payment/payment.component.html b/overlord/src/app/payment/payment.component.html index d0917563..4d5c7f4a 100644 --- a/overlord/src/app/payment/payment.component.html +++ b/overlord/src/app/payment/payment.component.html @@ -182,9 +182,9 @@ Created on {{ form.creationDate().value() | localTime }} and Last Edited on  {{ form.lastEditDate().value() | localTime }} by  {{ form.userName() }} by {{ form.userName().value().name }}. - {{ form.posted() ? 'Posted by ' + form.poster() : '' }} + {{ form.posted().value() ? 'Posted by ' + form.poster().value() : '' }} } diff --git a/overlord/src/app/payment/payment.component.ts b/overlord/src/app/payment/payment.component.ts index d073e20a..48b3a745 100644 --- a/overlord/src/app/payment/payment.component.ts +++ b/overlord/src/app/payment/payment.component.ts @@ -65,7 +65,7 @@ export interface PaymentFormModel { posted: boolean; creationDate: string; lastEditDate: string; - userName: string; + userName: User; poster: string; } @@ -153,7 +153,7 @@ export class PaymentComponent { posted: voucher.posted, creationDate: voucher.creationDate, lastEditDate: voucher.lastEditDate, - userName: voucher.user?.name ?? '', + userName: voucher.user ?? new User(), poster: voucher.poster ?? '', }; }, diff --git a/overlord/src/app/purchase-return/purchase-return.component.html b/overlord/src/app/purchase-return/purchase-return.component.html index 106518e7..7825f6e0 100644 --- a/overlord/src/app/purchase-return/purchase-return.component.html +++ b/overlord/src/app/purchase-return/purchase-return.component.html @@ -207,9 +207,9 @@ Created on {{ form.creationDate().value() | localTime }} and Last Edited on  {{ form.lastEditDate().value() | localTime }} by  {{ form.userName() }} by {{ form.userName().value().name }}. - {{ form.posted() ? 'Posted by ' + form.poster() : '' }} + {{ form.posted().value() ? 'Posted by ' + form.poster().value() : '' }} } diff --git a/overlord/src/app/purchase-return/purchase-return.component.ts b/overlord/src/app/purchase-return/purchase-return.component.ts index 45d521e1..3b056010 100644 --- a/overlord/src/app/purchase-return/purchase-return.component.ts +++ b/overlord/src/app/purchase-return/purchase-return.component.ts @@ -68,7 +68,7 @@ export interface PurchaseReturnFormModel { posted: boolean; creationDate: string; lastEditDate: string; - userName: string; + userName: User; poster: string; } @@ -157,7 +157,7 @@ export class PurchaseReturnComponent { posted: voucher.posted, creationDate: voucher.creationDate, lastEditDate: voucher.lastEditDate, - userName: voucher.user?.name ?? '', + userName: voucher.user ?? null, poster: voucher.poster ?? '', }; }, diff --git a/overlord/src/app/purchase/purchase.component.html b/overlord/src/app/purchase/purchase.component.html index e76cdc6e..27de296b 100644 --- a/overlord/src/app/purchase/purchase.component.html +++ b/overlord/src/app/purchase/purchase.component.html @@ -227,9 +227,9 @@ Created on {{ form.creationDate().value() | localTime }} and Last Edited on  {{ form.lastEditDate().value() | localTime }} by  {{ form.userName() }} by {{ form.userName().value().name }}. - {{ form.posted() ? 'Posted by ' + form.poster() : '' }} + {{ form.posted().value() ? 'Posted by ' + form.poster().value() : '' }} } diff --git a/overlord/src/app/purchase/purchase.component.ts b/overlord/src/app/purchase/purchase.component.ts index 1ba6dea1..d6b71293 100644 --- a/overlord/src/app/purchase/purchase.component.ts +++ b/overlord/src/app/purchase/purchase.component.ts @@ -73,7 +73,7 @@ export interface PurchaseFormModel { posted: boolean; creationDate: string; lastEditDate: string; - userName: string; + userName: User; poster: string; } @@ -165,7 +165,7 @@ export class PurchaseComponent { posted: voucher.posted, creationDate: voucher.creationDate, lastEditDate: voucher.lastEditDate, - userName: voucher.user?.name ?? '', + userName: voucher.user ?? null, poster: voucher.poster ?? '', }; }, diff --git a/overlord/src/app/receipt/receipt.component.html b/overlord/src/app/receipt/receipt.component.html index 14a110da..8075bbaf 100644 --- a/overlord/src/app/receipt/receipt.component.html +++ b/overlord/src/app/receipt/receipt.component.html @@ -177,8 +177,8 @@ Created on {{ form.creationDate().value() | localTime }} and Last Edited on  {{ form.lastEditDate().value() | localTime }} by  {{ form.userName() }}. {{ form.posted() ? 'Posted by ' + form.poster() : '' }} + > by {{ form.userName().value().name }}. {{ form.posted().value() ? 'Posted by ' + form.poster().value() : '' }} } diff --git a/overlord/src/app/receipt/receipt.component.ts b/overlord/src/app/receipt/receipt.component.ts index c27daa2e..c0732734 100644 --- a/overlord/src/app/receipt/receipt.component.ts +++ b/overlord/src/app/receipt/receipt.component.ts @@ -65,7 +65,7 @@ export interface ReceiptFormModel { posted: boolean; creationDate: string; lastEditDate: string; - userName: string; + userName: User; poster: string; } @@ -155,7 +155,7 @@ export class ReceiptComponent { posted: voucher.posted, creationDate: voucher.creationDate, lastEditDate: voucher.lastEditDate, - userName: voucher.user?.name ?? '', + userName: voucher.user ?? null, poster: voucher.poster ?? '', }; }, diff --git a/version_bump.sh b/version_bump.sh index eb889d5b..de142840 100755 --- a/version_bump.sh +++ b/version_bump.sh @@ -3,6 +3,12 @@ set -euo pipefail parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" || exit ; pwd -P ) cd "$parent_path" || exit +last_commit_subject=$(git log -1 --format=%s) +if [[ "$last_commit_subject" =~ ^Version\ Bump ]]; then + echo "Last commit is already a version bump (\"$last_commit_subject\"). Nothing to do." + exit 0 +fi + if [ 1 -eq "$#" ] then current_version=$(grep -m 1 '^version = ' brewman/pyproject.toml | sed -E 's/version = "([^"]+)"/\1/')