Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
123 changes: 95 additions & 28 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,39 +18,106 @@ jobs:
name: Generate
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v7
- name: Check out code
uses: actions/checkout@v7

- name: Set up Go
uses: actions/setup-go@v7
with:
go-version-file: 'go.mod'
cache: false
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version-file: "go.mod"
cache: false

- name: Generate
run: make proto generate
- name: Generate
run: make proto generate

- name: Ensure Git is clean
run: |
git diff --exit-code --compact-summary
- name: Ensure Git is clean
run: |
git diff --exit-code --compact-summary

build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v7

- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 24
registry-url: https://registry.npmjs.org/

- name: Setup bun
uses: oven-sh/setup-bun@v2

- name: Install dependencies
working-directory: js
run: bun install --frozen-lockfile

- name: build
run: make build

go:
name: Go
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v7

- name: Check spelling
uses: crate-ci/typos@master

- name: Set up Go
uses: actions/setup-go@v7
with:
go-version-file: 'go.mod'
cache: false

- name: Lint
uses: golangci/golangci-lint-action@v9
with:
args: -D protogetter --timeout=5m
- name: Check out code
uses: actions/checkout@v7

- name: Check spelling
uses: crate-ci/typos@master

- name: Set up Go
uses: actions/setup-go@v7
with:
go-version-file: "go.mod"
cache: false

- name: Lint
uses: golangci/golangci-lint-action@v9
with:
args: -D protogetter --timeout=5m

python:
name: Python
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v7

- name: Set up Python 3.13
uses: actions/setup-python@v6
with:
python-version: "3.13"

- name: Make tag
run: |
[ "${GITHUB_EVENT_NAME}" == 'pull_request' ] && echo "tag=v0.0.0.dev-${{ github.event.number }}" >> $GITHUB_ENV || true
[ "${GITHUB_EVENT_NAME}" == 'release' ] && echo "tag=${GITHUB_REF##*/}" >> $GITHUB_ENV || true
[ "${GITHUB_EVENT_NAME}" == 'push' ] && echo "tag=v0.0.0-rc0" >> $GITHUB_ENV || true

- name: Package
run: |
cd python
python -m pip install build
python -m build
env:
VERSION: ${{ env.tag }}

# SKIP pypi push as not required at the moment
#
# - name: Publish to Test PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# password: ${{ secrets.test_pypi_password }}
# repository-url: https://test.pypi.org/legacy/
# skip-existing: true
# packages-dir: python/dist
# if: ${{ github.event_name != 'release' }}

# - name: Publish to PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# password: ${{ secrets.pypi_password }}
# packages-dir: python/dist
# if: ${{ github.event_name == 'release' }}
43 changes: 43 additions & 0 deletions .github/workflows/npm-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: publish-npm

on:
release:
types:
- published

permissions:
id-token: write # Required for OIDC
contents: read

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
js:
name: JavaScript
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v7

- name: setup Node.js
uses: actions/setup-node@v7
with:
node-version: 24
registry-url: https://registry.npmjs.org/

- name: setup bun
uses: oven-sh/setup-bun@v2

- name: Install dependencies
working-directory: js
run: bun install --frozen-lockfile

- name: build
run: make build

- name: Publish to npm
working-directory: js
run: bunx npm@11.8.0 publish --provenance # workaround for bun not supporting trusted publishing of npm (https://github.com/oven-sh/bun/issues/15601)
if: github.event_name == 'release'
Comment thread
vknabel marked this conversation as resolved.
81 changes: 81 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: tests

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

permissions:
contents: read

jobs:
go:
name: Go
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v7

- name: Set up Go
uses: actions/setup-go@v7
with:
go-version-file: "go.mod"
cache: false

- name: Run tests
run: make -C go test

python:
name: Python (${{ matrix.python-version }})
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
python-version: ["3.13", "3.14"]

steps:
- name: Check out code
uses: actions/checkout@v7

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}

- name: Install with test dependencies
run: |
pip install -e python
pip install werkzeug pytest
env:
VERSION: v0.0.0

- name: Run Python client tests
run: |
python -m pytest python/fits/client/tests/ -v

js:
name: JavaScript
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v7

- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: 24
registry-url: https://registry.npmjs.org/

- name: Setup bun
uses: oven-sh/setup-bun@v2

- name: Install dependencies
working-directory: js
run: bun install --frozen-lockfile

- name: Run tests
run: make -C js test
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ generate:
.PHONY: test
test:
$(MAKE) -C go test
$(MAKE) -C js test

.PHONY: build
build:
Expand Down
66 changes: 0 additions & 66 deletions doc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -278,14 +278,6 @@ <h2>Table of Contents</h2>
<a href="#fits.api.v1.Auditing"><span class="badge">E</span>Auditing</a>
</li>

<li>
<a href="#fits.api.v1.InfraRole"><span class="badge">E</span>InfraRole</a>
</li>

<li>
<a href="#fits.api.v1.MachineRole"><span class="badge">E</span>MachineRole</a>
</li>

<li>
<a href="#fits.api.v1.OptimisticLockingStrategy"><span class="badge">E</span>OptimisticLockingStrategy</a>
</li>
Expand Down Expand Up @@ -1136,64 +1128,6 @@ <h3 id="fits.api.v1.Auditing">Auditing</h3>
</tbody>
</table>

<h3 id="fits.api.v1.InfraRole">InfraRole</h3>
<p>InfraRole specifies what role a microservice needs to call this infra service</p>
<table class="enum-table">
<thead>
<tr><td>Name</td><td>Number</td><td>Description</td></tr>
</thead>
<tbody>

<tr>
<td>INFRA_ROLE_UNSPECIFIED</td>
<td>0</td>
<td><p>INFRA_ROLE_UNSPECIFIED is not specified</p></td>
</tr>

<tr>
<td>INFRA_ROLE_EDITOR</td>
<td>1</td>
<td><p>INFRA_ROLE_EDITOR a microservice needs at least editor role to call this method</p></td>
</tr>

<tr>
<td>INFRA_ROLE_VIEWER</td>
<td>2</td>
<td><p>INFRA_ROLE_VIEWER a microservice needs at least viewer role to call this method</p></td>
</tr>

</tbody>
</table>

<h3 id="fits.api.v1.MachineRole">MachineRole</h3>
<p>MachineRole specifies what role a microservice needs to call this machine service</p>
<table class="enum-table">
<thead>
<tr><td>Name</td><td>Number</td><td>Description</td></tr>
</thead>
<tbody>

<tr>
<td>MACHINE_ROLE_UNSPECIFIED</td>
<td>0</td>
<td><p>MACHINE_ROLE_UNSPECIFIED is not specified</p></td>
</tr>

<tr>
<td>MACHINE_ROLE_EDITOR</td>
<td>1</td>
<td><p>MACHINE_ROLE_EDITOR a microservice needs at least editor role to call this method</p></td>
</tr>

<tr>
<td>MACHINE_ROLE_VIEWER</td>
<td>2</td>
<td><p>MACHINE_ROLE_VIEWER a microservice needs at least viewer role to call this method</p></td>
</tr>

</tbody>
</table>

<h3 id="fits.api.v1.OptimisticLockingStrategy">OptimisticLockingStrategy</h3>
<p>OptimisticLockingStrategy defines how optimistic locking should be handled.</p><p>It defaults to client side, which requires the UpdatedAt timestamp to be provided</p>
<table class="enum-table">
Expand Down
17 changes: 3 additions & 14 deletions generate/Makefile
Original file line number Diff line number Diff line change
@@ -1,20 +1,9 @@
.PHONY: generate
generate: go-mocks
generate:
# we remove files explicitly to ensure files really get generated
rm -f ../go/permissions/servicepermissions.go
rm -f ../go/client/client.go
rm -f ../go/tests/mock_clients.go
rm -f ../python/fits/client.py
rm -f ../ts/client/client.*

go run ./generate.go

.PHONY: go-mocks
go-mocks:
# we remove files explicitly to ensure files really get generated
rm -rf ../go/tests/mocks

docker run --rm \
--user $$(id -u):$$(id -g) \
--tmpfs /.cache:uid=$$(id -u),gid=$$(id -g) \
-w /work \
-v ${PWD}:/work \
vektra/mockery:v3.7.4
Loading