Commit Graph

133 Commits

Author SHA1 Message Date
kolaente 00b42234e9 feat(api/v2): serve Scalar docs UI at /api/v2/docs 2026-05-31 12:56:57 +00:00
kolaente 304fe55da7 refactor: drop Release.* from project magefiles and point Dockerfile at build/
The release pipeline lives entirely in build/magefile.go now, so the
per-project Release namespaces in vikunja's magefile.go and
veans/magefile.go are dead weight. Drop them.

Update the Dockerfile in the same commit so the apibuilder stage
invokes `cd build && mage release:xgo vikunja <target>` — the parent
magefile no longer exposes that target.
2026-05-27 13:01:44 +00:00
kolaente d67c586c9b feat(magefile): detect indirect api translation key references
The api translation scanner only looked at literal arguments to i18n.T /
i18n.TP, so keys passed via a variable (e.g. the time.since_* keys stored
in a struct slice in pkg/utils/humanize_duration.go and looked up via
chunk.key) were invisible and had to be hard-coded in an allowlist of
dynamic prefixes.

Mirror the frontend scanner: collect every dotted string literal in the
Go source as a "usage hint" and treat any literal that matches a known
translation key as used. This automatically picks up the time.since_*
case and removes the need for the apiDynamicKeyPrefixes allowlist.
2026-04-23 13:30:51 +02:00
kolaente 1d637a4ac6 refactor(magefile): consolidate api+frontend translation checks into one task
Previously the PR introduced a separate `check:frontendTranslations` mage
task and a second CI job. Merge both into the existing `check:translations`
task and a single CI job. Also rename internal references from "backend" to
"api" to match the project convention (Vikunja's Go server is the api, not
the backend).
2026-04-23 13:30:51 +02:00
kolaente 0035be3c12 feat(magefile): bidirectional translation key validation
Extend the existing check:translations task so it now also reports
"dead" keys - entries present in pkg/i18n/lang/en.json but never
referenced by any i18n.T / i18n.TP call. Dynamic references (where
the key is a runtime value, e.g. from a struct field) are handled via
an allowlist of prefixes so they don't false-positive.

Add a new check:frontend-translations task that performs the same
bidirectional check against frontend/src/i18n/lang/en.json by scanning
.vue / .ts / .js files for $t, t, i18n.t, i18n.global.t, tc, $tc calls
and <i18n-t keypath="...">. Template literals with ${...} interpolation
contribute a usage prefix instead of a single key. String literals that
exactly match a known translation key (or template-literal prefixes
assigned to a variable) are also treated as usage hints, so keys stored
in arrays or built up programmatically aren't flagged as dead.

Register the new task in Check.All so `mage check` covers both.
2026-04-23 13:30:51 +02:00
kolaente 21dcb76dc7
chore(mage): silence gosec on worktree branch-exists helpers
The branch name is supplied by the developer running the mage task,
so flagging it as tainted input is a false positive.
2026-04-16 15:00:26 +02:00
kolaente 56a7db5a0d
feat(mage): support existing branches in dev:prepare-worktree
Detect local and remote branches by name and check them out instead of
always creating a new one.
2026-04-16 13:40:18 +02:00
kolaente a110642093
fix(ci): inline APK repo generation to avoid glibc binary on Alpine
The mage-static binary is compiled with glibc which can't run on
Alpine's musl. Instead of fighting compatibility, inline the APK
repo generation as shell commands since the logic is simple.
2026-04-13 15:18:08 +02:00
kolaente cd61db4415
refactor(ci): split publish-repos into matrix with native containers
Each package format now runs in its native container image:
- apt: ubuntu:noble (reprepro)
- rpm: fedora:latest (createrepo_c)
- pacman: archlinux:latest (repo-add + bsdtar built-in)
- apk: alpine:latest (apk + abuild-sign built-in)

This eliminates cross-distro tool availability issues. Desktop
packages are downloaded and renamed per format to match the mage
target glob patterns. Also adds --allow-untrusted to apk index
since nfpm-produced .apk packages are unsigned.
2026-04-13 11:19:12 +02:00
kolaente 136fafdf37
fix(ci): install libarchive-tools for repo-add bsdtar dependency
repo-add uses bsdtar to validate packages, which requires
libarchive-tools. The .archlinux extension works fine with repo-add
so the rename to .pkg.tar.zst was unnecessary. Also removes debug
steps.
2026-04-13 10:50:56 +02:00
kolaente 20deac2ce1
fix(ci): rename .archlinux files to .pkg.tar.zst for repo-add
repo-add validates file extensions and rejects .archlinux files.
Rename them to .pkg.tar.zst when symlinking into the repo directory.
2026-04-12 18:32:26 +02:00
kolaente 80ecaeb567
fix(ci): sign APT Release files manually instead of via reprepro gpgme
reprepro uses gpgme for signing which fails in CI environments because
gpgme cannot access pinentry. Instead, remove SignWith from the reprepro
distributions config and sign Release files manually with gpg after
reprepro finishes, producing both Release.gpg and InRelease.
2026-04-12 17:32:11 +02:00
kolaente 010be28249
fix(ci): add mage aliases for pacakge releases 2026-04-12 15:04:10 +02:00
kolaente 8cc1a0b30f feat: add Mage targets for OS package repository metadata
Add four new Release namespace targets:
- release:repo-apt — generates APT repo metadata using reprepro
- release:repo-rpm — generates RPM repo metadata via createrepo_c
- release:repo-apk — generates Alpine APK index via apk index + abuild-sign
- release:repo-pacman — generates Pacman database via repo-add

All targets read REPO_SUITE env var (stable/unstable, default stable)
to support publishing to different repository suites.
2026-04-12 12:06:14 +00:00
kolaente 1cde0a1705
feat(ci): add multi-architecture support for OS package builds (#2610) 2026-04-12 12:24:08 +02:00
kolaente 415d5d23ad feat: update publiccode.yml automatically during release 2026-04-08 09:26:17 +00:00
kolaente a7bc3d6497
refactor: move plan file instead of copying in prepare-worktree 2026-04-08 10:12:08 +02:00
kolaente e2478e2fd6 test(caldav): add caldavtests package with infrastructure, helpers, and mage target
- Package skeleton with TestMain, setupTestEnv, and fixture users
- HTTP request helpers (PROPFIND, REPORT, GET, PUT, DELETE, OPTIONS)
- XML/iCal response parsers and assertion utilities
- VTodoBuilder for constructing test VTODO payloads
- Common PROPFIND/REPORT XML body constants
- Smoke test validating the infrastructure works end-to-end
- mage test:caldav command and CI matrix entry
2026-04-02 11:34:55 +00:00
kolaente c62b7e680f
fix: ensure frontend dist directory exists for lint and fmt commands
Extract ensureFrontendDistExists() from Build.Build and add it as a
dependency to Fmt, lint, and lint:fix so they no longer fail when the
frontend dist folder is missing.
2026-03-19 12:56:11 +01:00
kolaente e74265d921
fix: make mage fmt skip gitignored files
Use git ls-files instead of filepath.Walk to collect Go files,
so that gitignored files are no longer formatted.
2026-03-19 12:31:55 +01:00
John Starich 0a1104b75c refactor: fix contextcheck lint errors on magefile by passing mage context 2026-03-06 10:11:23 +01:00
John Starich cea8c7807d refactor: enable golangci-lint on magefile, fix errors 2026-03-06 10:11:23 +01:00
kolaente 24b800d48d feat: add mage test:e2e-api target for e2e API tests 2026-03-05 12:49:27 +01:00
kolaente 0792b3d8b7 feat(release): update frontend package.json version on release
Closes #892
2026-03-03 11:49:04 +01:00
kolaente 963990ce76
feat(dev): print commit statistics during tag-release 2026-02-25 13:45:04 +01:00
kolaente cb091f981d test: add e2e tests for session refresh and retry interceptor
- Verifies transparent retry and JWT rotation on 401 with code 11
- Verifies no retry for 401 with non-JWT error code
- Verifies current session appears on sessions settings page
- Increases rate limit for e2e test API to prevent 429 errors
2026-02-25 10:30:25 +01:00
kolaente edae87f2a0
fix(release): skip upx compression for windows arm64 binaries
UPX 5.0.0 does not support win64/arm64, causing CantPackException
and failing the release build.
2026-02-24 14:40:40 +01:00
kolaente fec1c038ff fix: use in-memory SQLite and log temp directory cleanup in test:e2e
Switch from file-based SQLite to VIKUNJA_DATABASE_PATH=memory which uses
file::memory:?cache=shared. Also add a visible log line when cleaning up
the temp directory so the teardown sequence is clear.
2026-02-21 22:32:09 +01:00
kolaente d00851292d fix: use preview:dev for correct dist dir and kill process groups in test:e2e
- build:dev outputs to dist-dev/ but preview serves from dist/,
  so use preview:dev which serves from dist-dev/
- pnpm spawns child processes, so SIGINT only hits the wrapper;
  use setpgid + kill(-pgid) to terminate the entire process group
2026-02-21 22:32:09 +01:00
kolaente 51a9f9c9f8 fix: fix API_URL trailing slash and remove CORS env var overrides in test:e2e
The API_URL needs a trailing slash so Playwright resolves relative URLs
correctly (e.g. "test/users" → "/api/v1/test/users" instead of
"/api/test/users"). CORS env vars are removed because Viper parses
comma-separated env vars as a single string instead of a slice, breaking
origin matching. The defaults already include the correct patterns.
2026-02-21 22:32:09 +01:00
kolaente c5ae7974e1 feat: add mage test:e2e for isolated end-to-end testing 2026-02-21 22:32:09 +01:00
kolaente 50983a9bb2
fix(build): use absolute path for zip output in release
The zip command in Release.Zip() sets its working directory to the
release subfolder but used a relative output path, causing it to
resolve against the wrong directory. This was a latent bug surfaced
by e19a61479 which removed the global RootPath variable.

Fix by resolving the zip output path to an absolute path using
os.Getwd() at the start of the function.
2026-02-18 17:05:40 +01:00
John Starich 122ba30339 fix: replace stray panic with return err 2026-02-17 18:01:05 +01:00
John Starich b2715bb56d refactor: use Go idioms for running tests 2026-02-17 18:01:05 +01:00
John Starich c773e2e828 refactor: switch to native filepath.Walk for gofmt file discovery 2026-02-17 18:01:05 +01:00
John Starich d8983b740a refactor: return errors to Mage instead of os.Exit and stream to stdout/stderr 2026-02-17 18:01:05 +01:00
John Starich fc0e0f5ea0 feat: toggle test verbosity based on Mage verbose flag 2026-02-17 18:01:05 +01:00
John Starich 8dbff21834 fix: add missing error checks in filepath.Walk and defer Close locations 2026-02-17 18:01:05 +01:00
John Starich e19a61479e refactor: remove root path in favor of Magefile default directory 2026-02-17 18:01:05 +01:00
John Starich cba5f6b2f4 style: fix doc comments to match godoc style 2026-02-17 18:01:05 +01:00
John Starich 65ef54f623 style: run gofmt -s to update octal literals 2026-02-17 18:01:05 +01:00
kolaente c2a132d56d fix(build): add osusergo tag to plugin build
Applies the same osusergo build tag fix from a1d5b634b to the plugin
build to prevent SIGFPE crashes under systemd.
2026-02-09 16:18:49 +01:00
kolaente ae3dd6923b fix(build): normalize comma-separated TAGS to prevent build failure 2026-02-05 23:57:28 +01:00
kolaente a1d5b634b9 fix(build): add osusergo tag to prevent SIGFPE crash under systemd
When running Vikunja as a systemd service without HOME set, the AWS SDK's
init() function calls os/user.Current() which uses CGO's getpwuid_r().
This can cause a SIGFPE crash in certain restricted environments.

Adding the osusergo build tag forces Go to use its pure implementation
that parses /etc/passwd directly, avoiding the problematic CGO call.

Fixes #2170
2026-02-05 23:38:25 +01:00
kolaente ee4b5a63f4 feat(dev): add mage command to release 2026-01-24 20:41:21 +01:00
kolaente 5050cd7162 chore(dev): add prepare worktree command to mage 2026-01-24 18:32:23 +01:00
kolaente 541a38456e
chore(deps): update golangci-lint to 2.6.0 (#1737) 2025-10-31 17:28:52 +00:00
kolaente 74189b6cf9
chore: update magefile to reference up to date golangci lint 2025-09-10 13:54:59 +02:00
kolaente a81a3ee0e5
feat!: rename right to permission (#1277) 2025-08-13 11:05:05 +02:00
kolaente b08b43953b feat(plugins): add rudimentary plugin system 2025-08-01 17:06:02 +02:00