Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
209 commits
Select commit Hold shift + click to select a range
e3210f8
bump to version 0.56.0
wp99cp Nov 24, 2025
cc96bc9
chore: cleanup version checking middleware
wp99cp Nov 24, 2025
e3da785
feat: add support for foxglove preview links (#1936)
wp99cp Nov 24, 2025
761abbd
fix: fox CORS issues related to foxglove links (#1936)
wp99cp Nov 24, 2025
f6d64d2
fix: fox CORS issues related to foxglove links (#1936)
wp99cp Nov 24, 2025
4ca511c
fix: update CORS policy to use null as default value
wp99cp Nov 24, 2025
d386ab3
fix: correct typo in WAIT_BEFORE_DELETION constant
wp99cp Nov 24, 2025
1b063b9
chore(deps): bump actions/checkout from 5 to 6
dependabot[bot] Nov 24, 2025
fc44121
chore(deps-dev): bump vue from 3.5.24 to 3.5.25 in /docs
dependabot[bot] Nov 24, 2025
884c28b
chore(deps): bump @opentelemetry/instrumentation-pg
dependabot[bot] Nov 24, 2025
3576646
chore(deps-dev): bump ts-loader from 9.5.2 to 9.5.4 in /backend
dependabot[bot] Nov 24, 2025
5c8ac3d
chore(deps): bump vue from 3.5.24 to 3.5.25 in /frontend
dependabot[bot] Nov 24, 2025
0798eea
chore(deps-dev): bump vue-tsc from 3.1.1 to 3.1.5 in /frontend
dependabot[bot] Nov 24, 2025
08d23fa
chore(deps): bump class-validator from 0.14.2 to 0.14.3 in /common
dependabot[bot] Nov 24, 2025
5ef2ca3
chore(deps): bump @aws-sdk/client-sts in /backend
dependabot[bot] Nov 24, 2025
2a441f5
chore(deps-dev): bump @types/passport-github in /backend
dependabot[bot] Nov 24, 2025
116b8a2
chore(deps): bump @opentelemetry/instrumentation-pg
dependabot[bot] Nov 24, 2025
90ba967
chore(deps-dev): bump @types/dockerode in /queueConsumer
dependabot[bot] Nov 24, 2025
6a2c8cc
chore(deps-dev): bump @nestjs/cli in /queueConsumer
dependabot[bot] Nov 24, 2025
1ccbf07
Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/queueCon…
wp99cp Nov 25, 2025
3daf35f
Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/queueCon…
wp99cp Nov 25, 2025
e8f522d
Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/backend/…
wp99cp Nov 25, 2025
2891990
Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/queueCon…
wp99cp Nov 25, 2025
489b7a6
Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/backend/…
wp99cp Nov 25, 2025
740f753
Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/common/s…
wp99cp Nov 25, 2025
c56d005
Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/frontend…
wp99cp Nov 25, 2025
51f7d71
Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/frontend…
wp99cp Nov 25, 2025
78584c1
Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/backend/…
wp99cp Nov 25, 2025
aa0c0d0
Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/backend/…
wp99cp Nov 25, 2025
453c192
Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/docs/sta…
wp99cp Nov 25, 2025
5c65500
Merge remote-tracking branch 'origin/dependabot/github_actions/stagin…
wp99cp Nov 25, 2025
e76550d
fix: add fallback to headless until #1640 is fixed
wp99cp Nov 25, 2025
f87b86c
feat: implement #1935
wp99cp Nov 25, 2025
d389c12
fix: add /integrations/ to allowed endpoints for unauthenticated users
wp99cp Nov 25, 2025
479a036
fix: typo in list files by project name
wp99cp Nov 25, 2025
ecc8d2f
chore: migrate /file to /files
wp99cp Nov 25, 2025
39f9441
docs: Change project title to 'Open Robotic Data Management'
wp99cp Nov 25, 2025
91793f8
fix: build sample action with latest prod cli version (#1959)
wp99cp Nov 25, 2025
02a236a
Merge branch 'dev' of https://github.com/leggedrobotics/kleinkram int…
wp99cp Nov 25, 2025
a9b3692
fix: missed endpoint change
wp99cp Nov 26, 2025
455bdaf
chore: allow props as abbreviation
wp99cp Nov 26, 2025
417271a
feat: add endpoint to check if action template name is valid
wp99cp Nov 26, 2025
e6182c1
feat: add AppSelect and scope selection composable for project and mi…
wp99cp Nov 26, 2025
cfae431
feat: add CheckNameResponseDto
wp99cp Nov 26, 2025
c5373b5
chore: use shared selection component
wp99cp Nov 26, 2025
ed8b499
feat: first step towards new action model (#1888)
wp99cp Nov 27, 2025
de39eb3
fix: fix test cases after changes to CreateTemplateDto
wp99cp Nov 28, 2025
3e3ddb2
fix: fix minor eslint errors
wp99cp Nov 28, 2025
954364c
chore: use non-root user in frontent image
wp99cp Nov 28, 2025
285e3a7
chore: fix linting and type errors
wp99cp Nov 28, 2025
02e7363
chore: fix remaining lint issues
wp99cp Nov 28, 2025
18fa4b8
fix: cleanup design of mission / project selector in run table
wp99cp Nov 28, 2025
37919a2
fix: action run table
wp99cp Nov 28, 2025
0bf3051
feat: introduce unified search field
wp99cp Nov 28, 2025
efc2663
feat: introduce shared reload button
wp99cp Nov 28, 2025
7c46aa0
fix: remove white background
wp99cp Nov 28, 2025
2eb6161
feat: cleanup template list
wp99cp Nov 28, 2025
47f205f
feat: allign search components
wp99cp Nov 28, 2025
3c3dfd9
feat: imrpove action UX
wp99cp Nov 28, 2025
4e14612
feat: unify disabled state
wp99cp Nov 28, 2025
fdb9c9b
feat: make all columns sortable in actions view
wp99cp Nov 28, 2025
791900c
feat: further improve action UX
wp99cp Nov 28, 2025
c4b0404
fix: deletion of action
wp99cp Nov 28, 2025
73bd057
feat: context aware template modification drawer
wp99cp Nov 28, 2025
cc5fc16
fix: format files using prettier
wp99cp Nov 28, 2025
697896c
fix: fix remaining linitng errors
wp99cp Nov 28, 2025
7d745f3
feat: remove outdated bull queue
wp99cp Nov 28, 2025
b115bec
fix: running action query on dashboard
wp99cp Nov 28, 2025
475d370
fix: invalidate query after action launch
wp99cp Nov 28, 2025
ed5eaec
fix: adapt CLI to API changes
wp99cp Nov 28, 2025
377aa0c
feat: clear docs (#1759, #1964)
wp99cp Nov 29, 2025
8a9324f
fix: sample actions
wp99cp Nov 29, 2025
08c21fa
feat: improve action UX
wp99cp Nov 29, 2025
5272fc0
fix: eslint issues
wp99cp Nov 29, 2025
03d56f1
feat: use separate endpoint for action logs (#1923)
wp99cp Nov 29, 2025
d5b7720
fix: improve file hash missmatch error
wp99cp Nov 29, 2025
d5c0cce
fix: Unprocessable Action Should not Wait for Artifacts Uploading #980
wp99cp Nov 29, 2025
7be8f88
style: reformat file using black
wp99cp Nov 29, 2025
3c9f19e
fix: broken links in docs
wp99cp Nov 29, 2025
363cc80
feat: blacklist older CLI versions
wp99cp Nov 29, 2025
55181a0
feat: add warning for delete level action launch
wp99cp Nov 29, 2025
1d6a36d
feat: secure revisions endpoint
wp99cp Nov 29, 2025
0c4a471
feat: robust file events for actions
wp99cp Nov 29, 2025
05b7b8b
feat: disable button on outdated artifacts
wp99cp Nov 29, 2025
22449c4
fix: linting issues
wp99cp Nov 29, 2025
0ebbca3
feat: add file source to file upload event
wp99cp Nov 29, 2025
e9d2190
feat: hide GitHub and Google oAuth if not configured
wp99cp Nov 29, 2025
f9684d8
feat: auto login using fake oauth for dev setup
wp99cp Nov 29, 2025
536979d
feat: add workflow for CLI testing
wp99cp Nov 30, 2025
a848f25
fix: add fake oauth to testing stack
wp99cp Nov 30, 2025
4794659
fix: remove unused variables and format code
wp99cp Nov 30, 2025
7d310c3
fix: make sure that pytest is installed
wp99cp Nov 30, 2025
857a299
fix: format files
wp99cp Nov 30, 2025
a84ee39
feat: Add `/auth/available-providers` to anonymous 401 tests
wp99cp Nov 30, 2025
049c655
chore: parallelize CLI installation and application start
wp99cp Nov 30, 2025
10c7b25
fix: fix action-file-events test case
wp99cp Nov 30, 2025
a53f228
feat: add AI Agents.md (alternative to #1814)
wp99cp Nov 30, 2025
1d7faf6
fix: update AGENTS.md to launch the app in watch mode
wp99cp Nov 30, 2025
c0009c9
feat: add health check endpoint
wp99cp Nov 30, 2025
092e7bc
feat: add auto login to CLI tests
wp99cp Nov 30, 2025
d49d314
feat: autogenerate required bag files for CLI tests
wp99cp Nov 30, 2025
db8da40
feat: fix and expand test cases for API
wp99cp Dec 1, 2025
66bd7c6
fix: refetch logs on action state change
wp99cp Dec 1, 2025
7bc0a94
fix: avoid double runs of test_CLI action
wp99cp Dec 1, 2025
8cbb02e
fix: improve error handling
wp99cp Dec 1, 2025
5d0b42f
fix: drop invalid test cases
wp99cp Dec 1, 2025
04f011f
fix: correctly build sample actions
wp99cp Dec 1, 2025
897ec4e
feat: improve first impression by providing better seeding
wp99cp Dec 1, 2025
811e1de
feat: improve docs on seeding
wp99cp Dec 1, 2025
ba7b1b0
fix: sample action build in CI/CD
wp99cp Dec 1, 2025
778e515
fix: make sure to abort seeding ig data already exists
wp99cp Dec 1, 2025
d1cf2e5
feat: add warning to action details if outdated CLI was detected
wp99cp Dec 1, 2025
f19dbe5
feat: finally fix #842
wp99cp Dec 1, 2025
d9cc40e
fix: action trigger
wp99cp Dec 1, 2025
59ca6b2
fix: dead link
wp99cp Dec 1, 2025
7711fe0
fix: formating
wp99cp Dec 1, 2025
d1a10f0
fix: issues rendering long strings
wp99cp Dec 1, 2025
8671421
feat: improved preview for bag and mcap files
wp99cp Dec 2, 2025
f9fb1cc
feat: add tum preview support
wp99cp Dec 2, 2025
ccaac8d
feat: add placholder for svo2 files
wp99cp Dec 2, 2025
4709c4a
feat: add support for db3 file preview
wp99cp Dec 3, 2025
0b36787
fix: sorting triggers 500 (#1963)
wp99cp Dec 3, 2025
22b4f3d
fix: build info extraction
wp99cp Dec 3, 2025
499a585
fix: format file
wp99cp Dec 3, 2025
eeec04d
feat: configure pre-commit hooks
wp99cp Dec 3, 2025
332cc7e
fix: remove prettier plugin form eslint to speed up checking
wp99cp Dec 3, 2025
fdd5453
feat: add docs on how to run GitHub Actions locally
wp99cp Dec 3, 2025
d530949
fix: format files using pre-commit hooks
wp99cp Dec 3, 2025
48d5a4a
feat: merge yml and yaml (#1758)
wp99cp Dec 3, 2025
e8b6cfa
fix: adjust file length for black formatter
wp99cp Dec 3, 2025
8656e60
fix: file state extraction for new files (#1758)
wp99cp Dec 3, 2025
632755e
fix: add popup for renaming files while uploading (#1162)
wp99cp Dec 3, 2025
a9ca171
fix: linting errors
wp99cp Dec 3, 2025
af4febe
feat: split locally built state into override and local only
wp99cp Dec 4, 2025
9a48892
feat: split locally built state into override and local only
wp99cp Dec 4, 2025
ea9ab17
fix: make app build after restructure
wp99cp Dec 4, 2025
f3d3c1d
fix: make frontend running
wp99cp Dec 4, 2025
ef65988
fix: make app start again
wp99cp Dec 5, 2025
93789b3
fix. don't rebuild api if test files changed
wp99cp Dec 5, 2025
cf08c3e
fix: working hmr
wp99cp Dec 5, 2025
a089aa5
fix: docker socket exposing for new setup
wp99cp Dec 5, 2025
350009b
fix: test setup
wp99cp Dec 5, 2025
22412ca
fix: harden eslint rules and fix/surpress
wp99cp Dec 5, 2025
3dd11e8
fix: local dev build of docs
wp99cp Dec 6, 2025
cb8b231
feat: add base migration for local DB
wp99cp Dec 6, 2025
636a6c9
chore: ignore auto generated migration scripts from lint checks
wp99cp Dec 6, 2025
bef04bc
fix: prod and staging images
wp99cp Dec 6, 2025
d58a884
fix: GitHub actions
wp99cp Dec 6, 2025
0dad45a
chore: cleanup GitHub actions
wp99cp Dec 6, 2025
f18e018
fix: update dependencies
wp99cp Dec 6, 2025
28290c0
fix: dependencies
wp99cp Dec 6, 2025
9fc0529
fix: apply security patches
wp99cp Dec 6, 2025
4833e9c
fix: only push app docker images, don't push base layer image
wp99cp Dec 6, 2025
a6d88a9
fix: action image resolution (typo in URL)
wp99cp Dec 7, 2025
28759fa
chore: ignore node modules for hmr
wp99cp Dec 7, 2025
d7460f0
feat: bring back DB seeding
wp99cp Dec 7, 2025
0cd1c9c
feat: improve docs for first contact with local setup (#1977)
wp99cp Dec 7, 2025
59a7619
fix: typo in file name
wp99cp Dec 7, 2025
2eea970
fix: typo in file name
wp99cp Dec 7, 2025
6f96cf1
fix: unresponsive dashboard (#1733)
wp99cp Dec 7, 2025
83ec3d5
fix: typo in file path
wp99cp Dec 7, 2025
87fb1ff
fix: git branch and commit sha extraction
wp99cp Dec 7, 2025
4e89ed8
fix: ensure to only show the first 7 chars of the sha
wp99cp Dec 7, 2025
c5220a1
chore: clean up
wp99cp Dec 7, 2025
c0cf12a
fix: race condition in test cases
wp99cp Dec 7, 2025
dcedae0
feat: implement #557
wp99cp Dec 7, 2025
cacb66a
feat: implement #1088
wp99cp Dec 7, 2025
ee8d376
fix: make sure Google Drive import works without API token
wp99cp Dec 7, 2025
4e0b8cf
fix: 500 error on multi file upload if the file already exists
wp99cp Dec 7, 2025
50a8f4c
fix: make sure Google Drive upload from folder shows an error msg if …
wp99cp Dec 7, 2025
af27014
fix: make docs work again locally
wp99cp Dec 7, 2025
4f686a9
feat: add dark mode support for API docs
wp99cp Dec 7, 2025
33c5f4c
chore: add DTOs for all file endpoints
wp99cp Dec 8, 2025
fb96a3b
fix: add crane as a dependency to docker images
wp99cp Dec 8, 2025
da8d1a8
fix: api dtp definition for actions: worker may be undefined
wp99cp Dec 8, 2025
1b9d047
fix: update cli after API changes for download link
wp99cp Dec 8, 2025
f4de9fd
fix: hash re-calculation
wp99cp Dec 8, 2025
f43c7d2
feat: make actions on dashboard clickable
wp99cp Dec 8, 2025
7978019
feat: add eslint to pre-commit hooks
wp99cp Dec 8, 2025
d2457d3
fix: action runtime
wp99cp Dec 8, 2025
89da9a1
feat: print summary statistics below progress bar
wp99cp Dec 8, 2025
14d9212
fix: make sure to fist build base
wp99cp Dec 8, 2025
41c9f25
fix: increase Node.js memory limit for eslint pre-commit hook
wp99cp Dec 8, 2025
d6a52cb
chore: Update fake user comment to reflect visibility of seeded proje…
wp99cp Dec 8, 2025
e9dd1ec
fix: frontend imports from shared packages
wp99cp Dec 8, 2025
a41c0d6
feat: add MD5 hash to seeded files
wp99cp Dec 8, 2025
02f0aa6
feat: seed group membership
wp99cp Dec 8, 2025
9d47789
fix: ts issues
wp99cp Dec 8, 2025
032dbb5
fix: blank screen on inital loading
wp99cp Dec 8, 2025
fb8f2bf
fix: make sure create_build_info is available in forntend container
wp99cp Dec 8, 2025
ba9715c
fix: make sure frontend build info extraction
wp99cp Dec 8, 2025
507dd9f
feat: Implement clean migration generation script, add CI checks, int…
wp99cp Dec 9, 2025
aae147c
feat: auto generate postgres docs
wp99cp Dec 9, 2025
69a92ed
fix: make docke build on a clean system
wp99cp Dec 9, 2025
b194887
fix: dependency linking for dev conatienrs
wp99cp Dec 9, 2025
98c1228
feat: use distress base image for frontend and docs
wp99cp Dec 9, 2025
b76ee08
fix: include postgres schema in production image
wp99cp Dec 9, 2025
13341fb
feat: implement pre build of swagger specs for prod docs
wp99cp Dec 9, 2025
9739ad9
fix: don't run prettier and eslint twice in GitHub action
wp99cp Dec 10, 2025
ed70525
fix: make sure docs gen and seeding work both
wp99cp Dec 10, 2025
f62f94d
fix: remove hardcoded docs, this file is autogenerated
wp99cp Dec 10, 2025
b4ea5c0
chore: reduce docker image size by optimizing module resolution (#1965)
wp99cp Dec 10, 2025
be207c4
chore: add migration
wp99cp Dec 10, 2025
6529dff
chore: remove autogenerated file
wp99cp Dec 10, 2025
f8f2d6d
fix: check migrations workflow
wp99cp Dec 10, 2025
1318553
fix: make sure testing action builds
wp99cp Dec 10, 2025
63498cc
chore: make pytest robust to API invalid api versions returned by server
wp99cp Dec 10, 2025
34916c3
chore: fix imports for test cases
wp99cp Dec 10, 2025
af7e4c8
fix: fix test cases
wp99cp Dec 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
28 changes: 24 additions & 4 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
**/dist
**/node_modules
**/build
**/.cache
# Local dev files
node_modules
dist
.env*
.git
.gitignore
.vscode
.idea

# Tests
backend/tests
!backend/tests/actions/file-hash
packages/*/tests
**/*.test.ts
**/*.spec.ts
junit.xml
coverage

# Backend specific
backend/tsconfig.tsbuildinfo
backend/npm-debug.log*
backend/yarn-debug.log*
backend/yarn-error.log*
backend/pnpm-debug.log*
19 changes: 11 additions & 8 deletions .env
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
SERVER_PORT=3000
QUASAR_ENDPOINT=http://localhost:3000

FRONTEND_URL=http://localhost:8003
DOCS_URL=http://localhost:4000
BACKEND_URL=http://localhost:3000

MINIO_USER=minioadmin
MINIO_PASSWORD=minioadmin
Expand All @@ -13,6 +13,7 @@ MINIO_DB_BUCKET_NAME=dbdumps
MINIO_ARTIFACTS_BUCKET_NAME=artifacts
MINIO_ENDPOINT=localhost


DB_HOST=database
DEV=true
DB_DATABASE=dbname
Expand All @@ -26,18 +27,20 @@ ENTITIES=dist/**/*.entity.js
SEED=true

VITE_USE_FAKE_OAUTH_FOR_DEVELOPMENT=true
GOOGLE_KEY_FILE=grandtourdatasets-5295745f7fab.json
GOOGLE_CLIENT_ID=237481987385-av4suqf7p0qjkmvjo8bc6jdf3g6nb0u7.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=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
GOOGLE_KEY_FILE=google-service-account.json
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
JWT_SECRET=SECRET

# this should be replaced with your own oauth credentials
GITHUB_CLIENT_ID=some-client-id
GITHUB_CLIENT_SECRET=some-client-secret
GOOGLE_CLIENT_ID=237481987385-av4suqf7p0qjkmvjo8bc6jdf3g6nb0u7.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=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

# can be left empty if you don't want to use docker hub
DOCKER_HUB_USERNAME=
DOCKER_HUB_PASSWORD=
VITE_DOCKER_HUB_NAMESPACE=

ARTIFACTS_UPLOADER_IMAGE=rslethz/grandtour-datasets:artifact-uploader-latest
ARTIFACTS_UPLOADER_IMAGE=rslethz/kleinkram:artifact-uploader-latest

# Docker socket group ID (run: stat -c '%g' /var/run/docker.sock)
DOCKER_GID=984
113 changes: 113 additions & 0 deletions .github/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# AI Agent Instructions

This document provides a quick reference for AI agents working on the Kleinkram project. For detailed information, always refer to the official documentation in the `../docs/` directory.

## 🚀 Quick Start (Launch)

To launch the full application stack:

```bash
docker compose up --build --watch -d
```

**Access Points:**

- **API Server**: [http://localhost:3000](http://localhost:3000)
- **Frontend**: [http://localhost:8003](http://localhost:8003)
- **MinIO Console**: [http://localhost:9001](http://localhost:9001)
- **Documentation**: [http://localhost:4000](http://localhost:4000)

> [!NOTE]
> See [../docs/development/getting-started.md](../docs/development/getting-started.md) for detailed setup instructions.

## 🛠️ Development Workflow

### API Interaction

**IMPORTANT**: All API calls to the backend must include the `kleinkram-client-version` header matching the current app version (e.g., `0.56.0`).

```typescript
headers: {
'kleinkram-client-version': '0.56.0', // Replace with actual version from package.json
...
}
```

**Exception:** The `/api/health` endpoint does not require this header.

### Formatting & Linting

Run these commands before submitting changes:

```bash
# Format Python code
black .

# Format TypeScript/JavaScript/JSON/Markdown
yarn run prettier

# Run Linting
yarn run eslint-full:quiet
```

### Testing

**Backend Tests:**

```bash
# Run all tests
yarn test

# Run specific test file
npx jest tests/actions/action-file-events.test.ts --runInBand --detectOpenHandles --forceExit
```

**CLI/Python Tests:**

```bash
# Run pytest (ensure virtualenv is active)
pytest
```

> [!NOTE]
> See [../docs/development/testing/getting-started.md](../docs/development/testing/getting-started.md) for detailed testing guide.

## 📚 Documentation Reference

- **General Setup**: [../docs/development/getting-started.md](../docs/development/getting-started.md)
- **Testing**: [../docs/development/testing/getting-started.md](../docs/development/testing/getting-started.md)
- **Python/CLI**: [../docs/development/python/getting-started.md](../docs/development/python/getting-started.md)

## 🧪 Test Naming Conventions

To ensure consistency and readability, please adhere to the following naming conventions for test files and test cases:

### File Naming

- **Format**: `kebab-case.test.ts`
- **Location**: `tests/<component>/` or `tests/functional/`
- **Examples**:
- `user-authentication.test.ts`
- `file-upload.test.ts`
- `action-execution.test.ts`

### Test Suite Naming (`describe`)

- **Format**: Title Case or Sentence case describing the component or feature under test.
- **Examples**:
- `describe('User Authentication', ...)`
- `describe('File Upload Service', ...)`

### Test Case Naming (`test` / `it`)

- **Format**: Should start with a verb (e.g., "should", "if") and describe the expected behavior or scenario.
- **Style**:
- **"should" style**: `test('should return 200 OK when valid credentials are provided', ...)`
- **"if" style**: `test('if a user can view details of a submitted action', ...)`
- **Clarity**: Be specific about the condition and the expected result.

### General Rules

- Keep tests focused on a single behavior.
- Use descriptive variable names within tests.
- Clean up resources in `afterEach` or `afterAll` to prevent state leakage.
54 changes: 40 additions & 14 deletions .github/workflows/test.yml → .github/workflows/api-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,59 +8,85 @@ on:
- dev

jobs:
test_API:
test-api:
runs-on: [self-hosted, linux]

# Permissions reduced since we are no longer posting comments/checks
permissions:
contents: read

steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6

- uses: pnpm/action-setup@v4
with:
run_install: false

- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version: '22'
package-manager-cache: false

- name: Install yarn
run: npm install -g yarn
cache: 'pnpm'

- name: install dependencies
run: yarn install --immutable
run: pnpm install --frozen-lockfile

- name: Build workspace packages
run: pnpm -r run build

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Generate test data
run: |
pip install rosbags
python3 cli/tests/generate_test_data.py

- name: build_stack
run: docker compose -f docker-compose.testing.yml build
env:
BACKEND_URL: 'http://localhost:3000'
GIT_BRANCH: ${{ github.head_ref || github.ref_name }}
GIT_COMMIT: ${{ github.sha }}

- name: clear previous volumes
run: docker compose -f docker-compose.testing.yml down -v

- name: Pre-generate endpoints
working-directory: ./backend
run: |
mkdir -p .endpoints
npm run gen:docs -- .endpoints

- name: launch_stack
working-directory: ./backend
run: |
docker compose -f ../docker-compose.testing.yml up -d
SECONDS=0
TIMEOUT=180
while [ ! -f ./.endpoints/__generated__endpoints.json ]; do
# wait for the api to be reachable
while ! curl -s http://localhost:3000/ > /dev/null; do
if [ $SECONDS -ge $TIMEOUT ]; then
echo "Timeout reached: __generated__endpoints.json not found"
echo "Timeout reached: API not reachable"
docker logs kleinkram-api-server-test
docker compose -f ../docker-compose.testing.yml down
exit 1
fi
sleep 1
echo "waiting for endpoints"
echo "waiting for API to be reachable..."
done
echo "Endpoints found. Running tests..."

echo "API is up. Running tests..."

# This will now cause the step to fail immediately if tests fail.
yarn test --ci
pnpm test --ci

echo "Tests passed successfully."

- name: Clean up
if: always()
run: npm uninstall -g yarn
run: echo "Cleanup done"

- name: Stop Docker stack
if: always()
Expand Down
67 changes: 67 additions & 0 deletions .github/workflows/build-sample-actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Build Sample Actions

on:
workflow_dispatch:
inputs:
kleinkram_version:
description: 'Kleinkram version to install'
required: false
default: ''
workflow_run:
workflows: ['Update PyPI']
types:
- completed
push:
paths:
- 'examples/kleinkram-actions/**'

jobs:
build-and-push:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
strategy:
matrix:
action:
[
validate-data,
extract-metadata,
convert-formats,
python-template,
]
type: [dev, prod]

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Determine Tag
id: tag
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
echo "tag=dev" >> $GITHUB_OUTPUT
echo "kleinkram_version=${{ inputs.kleinkram_version }}" >> $GITHUB_OUTPUT
elif [ "${{ matrix.type }}" == "dev" ]; then
echo "tag=dev" >> $GITHUB_OUTPUT
echo "kleinkram_version=" >> $GITHUB_OUTPUT # Installs latest from PyPI which is updated by Update PyPI workflow
else
echo "tag=latest" >> $GITHUB_OUTPUT
echo "kleinkram_version=" >> $GITHUB_OUTPUT # Installs latest from PyPI
fi

- name: Build and push
uses: docker/build-push-action@v4
with:
context: examples/kleinkram-actions/${{ matrix.action }}
push: true
tags: rslethz/action:${{ matrix.action }}-${{ steps.tag.outputs.tag }}
build-args: |
KLEINKRAM_VERSION=${{ steps.tag.outputs.kleinkram_version }}
32 changes: 32 additions & 0 deletions .github/workflows/check-migrations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Check Migrations

on:
pull_request:
branches:
- main

jobs:
check-migrations:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 10

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile
working-directory: backend

- name: Check migrations
run: pnpm run migration:check
working-directory: backend
Loading