From aee86e85a5d39d23b4745f211f0cac94df03e56e Mon Sep 17 00:00:00 2001 From: OliverTrautvetter <66372584+OliverTrautvetter@users.noreply.github.com> Date: Tue, 14 Oct 2025 09:56:04 +0200 Subject: [PATCH 01/13] feat (docs): Add auto generation of license and docs --- .github/workflows/cli-build_test.yml | 3 + .github/workflows/go-lint.yml | 3 + .github/workflows/service-build_test.yml | 3 + .github/workflows/tag-release.yml | 3 + .../workflows/update-docs-and-licenses.yml | 27 ++++++++ hack/update-docs-and-licenses.sh | 63 +++++++++++++++++++ internal/portal/api_key.go | 3 + internal/util/mocks.go | 3 +- internal/util/required_flag.go | 3 + 9 files changed, 109 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/update-docs-and-licenses.yml create mode 100755 hack/update-docs-and-licenses.sh diff --git a/.github/workflows/cli-build_test.yml b/.github/workflows/cli-build_test.yml index ea4d33c1..242e8818 100644 --- a/.github/workflows/cli-build_test.yml +++ b/.github/workflows/cli-build_test.yml @@ -1,3 +1,6 @@ +# Copyright (c) Codesphere Inc. +# SPDX-License-Identifier: Apache-2.0 + # This workflow will build a golang project # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go diff --git a/.github/workflows/go-lint.yml b/.github/workflows/go-lint.yml index 14e37f2a..29e0d01b 100644 --- a/.github/workflows/go-lint.yml +++ b/.github/workflows/go-lint.yml @@ -1,3 +1,6 @@ +# Copyright (c) Codesphere Inc. +# SPDX-License-Identifier: Apache-2.0 + name: golangci-lint on: push: diff --git a/.github/workflows/service-build_test.yml b/.github/workflows/service-build_test.yml index 101190b1..e1d95753 100644 --- a/.github/workflows/service-build_test.yml +++ b/.github/workflows/service-build_test.yml @@ -1,3 +1,6 @@ +# Copyright (c) Codesphere Inc. +# SPDX-License-Identifier: Apache-2.0 + # This workflow will build a golang project # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml index d17de3a6..4aab3d22 100644 --- a/.github/workflows/tag-release.yml +++ b/.github/workflows/tag-release.yml @@ -1,3 +1,6 @@ +# Copyright (c) Codesphere Inc. +# SPDX-License-Identifier: Apache-2.0 + name: Tag on: diff --git a/.github/workflows/update-docs-and-licenses.yml b/.github/workflows/update-docs-and-licenses.yml new file mode 100644 index 00000000..d111ebf8 --- /dev/null +++ b/.github/workflows/update-docs-and-licenses.yml @@ -0,0 +1,27 @@ +# Copyright (c) Codesphere Inc. +# SPDX-License-Identifier: Apache-2.0 + +name: 'Auto-Update Docs & Licenses' + +on: + pull_request: + types: [opened, synchronize] + +jobs: + update-files: + runs-on: ubuntu-latest + steps: + - name: Checkout PR Code + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.ref }} + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Update docs & licenses + run: | + ./hack/update-docs-and-licenses.sh + + - name: Commit and push changes + uses: EndBug/add-and-commit@v9 + with: + message: "auto(docs): update docs and licenses" \ No newline at end of file diff --git a/hack/update-docs-and-licenses.sh b/hack/update-docs-and-licenses.sh new file mode 100755 index 00000000..c9b01837 --- /dev/null +++ b/hack/update-docs-and-licenses.sh @@ -0,0 +1,63 @@ +#!/usr/bin/env bash +# Copyright (c) Codesphere Inc. +# SPDX-License-Identifier: Apache-2.0 + +set -euo pipefail +IFS=$'\n\t' + +here=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +root=$(cd "$here/.." && pwd) + +echo "Working directory: $root" + +cd "$root" + +echo "1/2: Generating docs" + +if command -v go >/dev/null 2>&1; then + go run ./hack/gendocs/main.go + echo "Docs generated into: $root/docs" +else + echo "ERROR: 'go' binary not found in PATH. Install Go and retry." >&2 + exit 2 +fi + +echo "2/2: Updating licenses" + +echo "Checking license tooling: go-licenses + addlicense" + +export GOBIN="$(go env GOBIN 2>/dev/null || echo "$HOME/go/bin")" +export PATH="$GOBIN:$PATH" + +need_install=() +if ! command -v go-licenses >/dev/null 2>&1; then + need_install+=("github.com/google/go-licenses@latest") +fi +if ! command -v addlicense >/dev/null 2>&1; then + need_install+=("github.com/google/addlicense@latest") +fi + +if [ ${#need_install[@]} -ne 0 ]; then + echo "Installing missing tools: ${need_install[*]}" + for pkg in "${need_install[@]}"; do + if command -v go >/dev/null 2>&1; then + go install "$pkg" + else + echo "ERROR: 'go' binary not found; cannot install $pkg" >&2 + exit 2 + fi + done +fi + +echo "Generating NOTICE via go-licenses" +if command -v go-licenses >/dev/null 2>&1; then + + if ! go-licenses report --template .NOTICE.template ./... > NOTICE 2> >(grep -v "module .* has empty version, defaults to HEAD" >&2); then + echo "go-licenses report failed" >&2 + fi + echo "NOTICE generated/updated" +else + echo "go-licenses not available; skipping NOTICE generation" >&2 +fi + +echo "Done." diff --git a/internal/portal/api_key.go b/internal/portal/api_key.go index 20de7892..1d7d161e 100644 --- a/internal/portal/api_key.go +++ b/internal/portal/api_key.go @@ -1,3 +1,6 @@ +// Copyright (c) Codesphere Inc. +// SPDX-License-Identifier: Apache-2.0 + package portal import "time" diff --git a/internal/util/mocks.go b/internal/util/mocks.go index c9fcabf6..23487339 100644 --- a/internal/util/mocks.go +++ b/internal/util/mocks.go @@ -5,10 +5,9 @@ package util import ( - "os" - "github.com/jedib0t/go-pretty/v6/table" mock "github.com/stretchr/testify/mock" + "os" ) // NewMockFileIO creates a new instance of MockFileIO. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. diff --git a/internal/util/required_flag.go b/internal/util/required_flag.go index 600c1e62..e9109b84 100644 --- a/internal/util/required_flag.go +++ b/internal/util/required_flag.go @@ -1,3 +1,6 @@ +// Copyright (c) Codesphere Inc. +// SPDX-License-Identifier: Apache-2.0 + package util import ( From 4b0ba307a9e1762ed66ad7b4ce6a88c1d7c1b21f Mon Sep 17 00:00:00 2001 From: OliverTrautvetter <66372584+OliverTrautvetter@users.noreply.github.com> Date: Tue, 14 Oct 2025 10:11:48 +0200 Subject: [PATCH 02/13] fix: prevent new workflow from doing loops and ignoring merges --- .github/workflows/update-docs-and-licenses.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/update-docs-and-licenses.yml b/.github/workflows/update-docs-and-licenses.yml index d111ebf8..9e694692 100644 --- a/.github/workflows/update-docs-and-licenses.yml +++ b/.github/workflows/update-docs-and-licenses.yml @@ -3,18 +3,27 @@ name: 'Auto-Update Docs & Licenses' +permissions: + contents: write + on: pull_request: types: [opened, synchronize] + push: + branches: + - main jobs: update-files: + # skip runs triggered by the bot's own commit to avoid loops + if: github.actor != 'github-actions[bot]' runs-on: ubuntu-latest steps: - - name: Checkout PR Code + - name: Checkout Code uses: actions/checkout@v4 with: - ref: ${{ github.event.pull_request.head.ref }} + # on push to main, use main; on PR, check out the PR head + ref: ${{ github.event.pull_request.head.ref || github.ref }} token: ${{ secrets.GITHUB_TOKEN }} - name: Update docs & licenses @@ -24,4 +33,4 @@ jobs: - name: Commit and push changes uses: EndBug/add-and-commit@v9 with: - message: "auto(docs): update docs and licenses" \ No newline at end of file + message: "auto(docs): update docs and licenses" From f026b7e91a435fc243a0bccf1493b272f67fe095 Mon Sep 17 00:00:00 2001 From: OliverTrautvetter Date: Tue, 14 Oct 2025 08:15:13 +0000 Subject: [PATCH 03/13] auto(docs): update docs and licenses --- docs/oms.md | 7 ++++-- docs/oms_beta.md | 21 ++++++++++++++++++ docs/oms_beta_extend.md | 20 +++++++++++++++++ docs/oms_beta_extend_baseimage.md | 30 +++++++++++++++++++++++++ docs/oms_download.md | 6 +---- docs/oms_download_package.md | 6 ++--- docs/oms_list.md | 3 ++- docs/oms_list_api-keys.md | 23 +++++++++++++++++++ docs/oms_list_packages.md | 2 +- docs/oms_register.md | 27 ++++++++++++++++++++++ docs/oms_revoke.md | 21 ++++++++++++++++++ docs/oms_revoke_api-key.md | 24 ++++++++++++++++++++ docs/oms_update.md | 9 +++++--- docs/oms_update_api-key.md | 25 +++++++++++++++++++++ docs/oms_update_oms.md | 23 +++++++++++++++++++ docs/oms_update_package.md | 37 +++++++++++++++++++++++++++++++ docs/oms_version.md | 2 +- 17 files changed, 270 insertions(+), 16 deletions(-) create mode 100644 docs/oms_beta.md create mode 100644 docs/oms_beta_extend.md create mode 100644 docs/oms_beta_extend_baseimage.md create mode 100644 docs/oms_list_api-keys.md create mode 100644 docs/oms_register.md create mode 100644 docs/oms_revoke.md create mode 100644 docs/oms_revoke_api-key.md create mode 100644 docs/oms_update_api-key.md create mode 100644 docs/oms_update_oms.md create mode 100644 docs/oms_update_package.md diff --git a/docs/oms.md b/docs/oms.md index c90fac99..b1478448 100644 --- a/docs/oms.md +++ b/docs/oms.md @@ -17,9 +17,12 @@ like downloading new versions. ### SEE ALSO +* [oms beta](oms_beta.md) - Commands for early testing * [oms download](oms_download.md) - Download resources available through OMS * [oms list](oms_list.md) - List resources available through OMS -* [oms update](oms_update.md) - Update Codesphere OMS +* [oms register](oms_register.md) - Register a new API key +* [oms revoke](oms_revoke.md) - Revoke resources available through OMS +* [oms update](oms_update.md) - Update OMS related resources * [oms version](oms_version.md) - Print version -###### Auto generated by spf13/cobra on 19-Sep-2025 +###### Auto generated by spf13/cobra on 14-Oct-2025 diff --git a/docs/oms_beta.md b/docs/oms_beta.md new file mode 100644 index 00000000..97fb981a --- /dev/null +++ b/docs/oms_beta.md @@ -0,0 +1,21 @@ +## oms beta + +Commands for early testing + +### Synopsis + +OMS CLI commands for early adoption and testing. +Be aware that that usage and behavior may change as the features are developed. + +### Options + +``` + -h, --help help for beta +``` + +### SEE ALSO + +* [oms](oms.md) - Codesphere Operations Management System (OMS) +* [oms beta extend](oms_beta_extend.md) - Extend Codesphere ressources such as base images. + +###### Auto generated by spf13/cobra on 14-Oct-2025 diff --git a/docs/oms_beta_extend.md b/docs/oms_beta_extend.md new file mode 100644 index 00000000..7f598058 --- /dev/null +++ b/docs/oms_beta_extend.md @@ -0,0 +1,20 @@ +## oms beta extend + +Extend Codesphere ressources such as base images. + +### Synopsis + +Extend Codesphere ressources such as base images to customize them for your needs. + +### Options + +``` + -h, --help help for extend +``` + +### SEE ALSO + +* [oms beta](oms_beta.md) - Commands for early testing +* [oms beta extend baseimage](oms_beta_extend_baseimage.md) - Extend Codesphere's workspace base image for customization + +###### Auto generated by spf13/cobra on 14-Oct-2025 diff --git a/docs/oms_beta_extend_baseimage.md b/docs/oms_beta_extend_baseimage.md new file mode 100644 index 00000000..704dd207 --- /dev/null +++ b/docs/oms_beta_extend_baseimage.md @@ -0,0 +1,30 @@ +## oms beta extend baseimage + +Extend Codesphere's workspace base image for customization + +### Synopsis + +Loads the baseimage from Codesphere package and generates a Dockerfile based on it. +This enables you to extend Codesphere's base image with specific dependencies. + +To use the custom base image, you need to push the resulting image to your container registry and +reference it in your install-config for the Codesphere installation process to pick it up and include it in Codesphere + +``` +oms beta extend baseimage [flags] +``` + +### Options + +``` + -d, --dockerfile string Output Dockerfile to generate for extending the base image (default "Dockerfile") + -f, --force Enforce package extraction + -h, --help help for baseimage + -p, --package string Package file (e.g. codesphere-v1.2.3-installer.tar.gz) to load base image from +``` + +### SEE ALSO + +* [oms beta extend](oms_beta_extend.md) - Extend Codesphere ressources such as base images. + +###### Auto generated by spf13/cobra on 14-Oct-2025 diff --git a/docs/oms_download.md b/docs/oms_download.md index 29728ade..1eedf18e 100644 --- a/docs/oms_download.md +++ b/docs/oms_download.md @@ -7,10 +7,6 @@ Download resources available through OMS Download resources managed by or available for OMS, e.g. available Codesphere packages -``` -oms download [flags] -``` - ### Options ``` @@ -22,4 +18,4 @@ oms download [flags] * [oms](oms.md) - Codesphere Operations Management System (OMS) * [oms download package](oms_download_package.md) - Download a codesphere package -###### Auto generated by spf13/cobra on 19-Sep-2025 +###### Auto generated by spf13/cobra on 14-Oct-2025 diff --git a/docs/oms_download_package.md b/docs/oms_download_package.md index de640c62..4dc5fceb 100644 --- a/docs/oms_download_package.md +++ b/docs/oms_download_package.md @@ -15,10 +15,10 @@ oms download package [flags] ``` # Download Codesphere version 1.55.0 -$ /var/folders/h2/qdn9mcsx32j2384qdrqyqlkw0000gn/T/go-build3505592854/b001/exe/main download package --version 1.55.0 +$ /tmp/go-build2765864964/b001/exe/main download package --version codesphere-v1.55.0 # Download lite package of Codesphere version 1.55.0 -$ /var/folders/h2/qdn9mcsx32j2384qdrqyqlkw0000gn/T/go-build3505592854/b001/exe/main download package --version 1.55.0 --file installer-lite.tar.gz +$ /tmp/go-build2765864964/b001/exe/main download package --version codesphere-v1.55.0 --file installer-lite.tar.gz ``` ### Options @@ -34,4 +34,4 @@ $ /var/folders/h2/qdn9mcsx32j2384qdrqyqlkw0000gn/T/go-build3505592854/b001/exe/m * [oms download](oms_download.md) - Download resources available through OMS -###### Auto generated by spf13/cobra on 19-Sep-2025 +###### Auto generated by spf13/cobra on 14-Oct-2025 diff --git a/docs/oms_list.md b/docs/oms_list.md index f92c44b4..84a56737 100644 --- a/docs/oms_list.md +++ b/docs/oms_list.md @@ -16,6 +16,7 @@ eg. available Codesphere packages ### SEE ALSO * [oms](oms.md) - Codesphere Operations Management System (OMS) +* [oms list api-keys](oms_list_api-keys.md) - List API keys * [oms list packages](oms_list_packages.md) - List available packages -###### Auto generated by spf13/cobra on 19-Sep-2025 +###### Auto generated by spf13/cobra on 14-Oct-2025 diff --git a/docs/oms_list_api-keys.md b/docs/oms_list_api-keys.md new file mode 100644 index 00000000..3e3b4950 --- /dev/null +++ b/docs/oms_list_api-keys.md @@ -0,0 +1,23 @@ +## oms list api-keys + +List API keys + +### Synopsis + +List API keys registered in the OMS portal. + +``` +oms list api-keys [flags] +``` + +### Options + +``` + -h, --help help for api-keys +``` + +### SEE ALSO + +* [oms list](oms_list.md) - List resources available through OMS + +###### Auto generated by spf13/cobra on 14-Oct-2025 diff --git a/docs/oms_list_packages.md b/docs/oms_list_packages.md index e61d1880..f61569b1 100644 --- a/docs/oms_list_packages.md +++ b/docs/oms_list_packages.md @@ -20,4 +20,4 @@ oms list packages [flags] * [oms list](oms_list.md) - List resources available through OMS -###### Auto generated by spf13/cobra on 19-Sep-2025 +###### Auto generated by spf13/cobra on 14-Oct-2025 diff --git a/docs/oms_register.md b/docs/oms_register.md new file mode 100644 index 00000000..d015c8d3 --- /dev/null +++ b/docs/oms_register.md @@ -0,0 +1,27 @@ +## oms register + +Register a new API key + +### Synopsis + +Register a new API key for accessing the OMS portal. + +``` +oms register [flags] +``` + +### Options + +``` + -e, --expires string Expiration date of the new API key. Default is 1 year from now. Format: RFC3339 (e.g., 2024-12-31T23:59:59Z) + -h, --help help for register + -g, --organization string Organization of the new API key + -o, --owner string Owner of the new API key + -r, --role string Role of the new API key. Available roles: Admin, Dev, Ext (default "Ext") +``` + +### SEE ALSO + +* [oms](oms.md) - Codesphere Operations Management System (OMS) + +###### Auto generated by spf13/cobra on 14-Oct-2025 diff --git a/docs/oms_revoke.md b/docs/oms_revoke.md new file mode 100644 index 00000000..064f605b --- /dev/null +++ b/docs/oms_revoke.md @@ -0,0 +1,21 @@ +## oms revoke + +Revoke resources available through OMS + +### Synopsis + +Revoke resources managed by or available for OMS, +eg. api keys. + +### Options + +``` + -h, --help help for revoke +``` + +### SEE ALSO + +* [oms](oms.md) - Codesphere Operations Management System (OMS) +* [oms revoke api-key](oms_revoke_api-key.md) - Revoke an API key + +###### Auto generated by spf13/cobra on 14-Oct-2025 diff --git a/docs/oms_revoke_api-key.md b/docs/oms_revoke_api-key.md new file mode 100644 index 00000000..f18f2228 --- /dev/null +++ b/docs/oms_revoke_api-key.md @@ -0,0 +1,24 @@ +## oms revoke api-key + +Revoke an API key + +### Synopsis + +Revoke an OMS portal API key. + +``` +oms revoke api-key [flags] +``` + +### Options + +``` + -h, --help help for api-key + -i, --id string API key id to revoke +``` + +### SEE ALSO + +* [oms revoke](oms_revoke.md) - Revoke resources available through OMS + +###### Auto generated by spf13/cobra on 14-Oct-2025 diff --git a/docs/oms_update.md b/docs/oms_update.md index 1d05476a..306be3bf 100644 --- a/docs/oms_update.md +++ b/docs/oms_update.md @@ -1,10 +1,10 @@ ## oms update -Update Codesphere OMS +Update OMS related resources ### Synopsis -Updates the OMS to the latest release from OMS Portal. +Updates resources, e.g. OMS or OMS API keys. ``` oms update [flags] @@ -19,5 +19,8 @@ oms update [flags] ### SEE ALSO * [oms](oms.md) - Codesphere Operations Management System (OMS) +* [oms update api-key](oms_update_api-key.md) - Update an API key's expiration date +* [oms update oms](oms_update_oms.md) - Update the OMS CLI +* [oms update package](oms_update_package.md) - Download a codesphere package -###### Auto generated by spf13/cobra on 19-Sep-2025 +###### Auto generated by spf13/cobra on 14-Oct-2025 diff --git a/docs/oms_update_api-key.md b/docs/oms_update_api-key.md new file mode 100644 index 00000000..57d2b6f4 --- /dev/null +++ b/docs/oms_update_api-key.md @@ -0,0 +1,25 @@ +## oms update api-key + +Update an API key's expiration date + +### Synopsis + +Updates the expiration date for a given API key using the --id and --valid-to flags. + +``` +oms update api-key [flags] +``` + +### Options + +``` + -h, --help help for api-key + -i, --id string The ID of the API key to update + -v, --valid-to string The new expiration date in RFC3339 format (e.g., "2025-12-31T23:59:59Z") +``` + +### SEE ALSO + +* [oms update](oms_update.md) - Update OMS related resources + +###### Auto generated by spf13/cobra on 14-Oct-2025 diff --git a/docs/oms_update_oms.md b/docs/oms_update_oms.md new file mode 100644 index 00000000..4a70fac0 --- /dev/null +++ b/docs/oms_update_oms.md @@ -0,0 +1,23 @@ +## oms update oms + +Update the OMS CLI + +### Synopsis + +Updates the OMS CLI to the latest release from OMS Portal. + +``` +oms update oms [flags] +``` + +### Options + +``` + -h, --help help for oms +``` + +### SEE ALSO + +* [oms update](oms_update.md) - Update OMS related resources + +###### Auto generated by spf13/cobra on 14-Oct-2025 diff --git a/docs/oms_update_package.md b/docs/oms_update_package.md new file mode 100644 index 00000000..baeb37c7 --- /dev/null +++ b/docs/oms_update_package.md @@ -0,0 +1,37 @@ +## oms update package + +Download a codesphere package + +### Synopsis + +Download a specific version of a Codesphere package +To list available packages, run oms list packages. + +``` +oms update package [flags] +``` + +### Examples + +``` +# Download Codesphere version 1.55.0 +$ /tmp/go-build2765864964/b001/exe/main download package --version codesphere-v1.55.0 + +# Download lite package of Codesphere version 1.55.0 +$ /tmp/go-build2765864964/b001/exe/main download package --version codesphere-v1.55.0 --file installer-lite.tar.gz +``` + +### Options + +``` + -f, --file string Specify artifact to download (default "installer.tar.gz") + -H, --hash string Hash of the version to download if multiple builds exist for the same version + -h, --help help for package + -V, --version string Codesphere version to download +``` + +### SEE ALSO + +* [oms update](oms_update.md) - Update OMS related resources + +###### Auto generated by spf13/cobra on 14-Oct-2025 diff --git a/docs/oms_version.md b/docs/oms_version.md index 1770d52b..f6a3f274 100644 --- a/docs/oms_version.md +++ b/docs/oms_version.md @@ -20,4 +20,4 @@ oms version [flags] * [oms](oms.md) - Codesphere Operations Management System (OMS) -###### Auto generated by spf13/cobra on 19-Sep-2025 +###### Auto generated by spf13/cobra on 14-Oct-2025 From 3b694fcae59ab3d281ab44203da9812c7666320b Mon Sep 17 00:00:00 2001 From: OliverTrautvetter <66372584+OliverTrautvetter@users.noreply.github.com> Date: Tue, 14 Oct 2025 10:25:32 +0200 Subject: [PATCH 04/13] fix: amend last commit with auto-generated changes instead of using separate commit --- .github/workflows/update-docs-and-licenses.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/update-docs-and-licenses.yml b/.github/workflows/update-docs-and-licenses.yml index 9e694692..d51ad07a 100644 --- a/.github/workflows/update-docs-and-licenses.yml +++ b/.github/workflows/update-docs-and-licenses.yml @@ -25,12 +25,18 @@ jobs: # on push to main, use main; on PR, check out the PR head ref: ${{ github.event.pull_request.head.ref || github.ref }} token: ${{ secrets.GITHUB_TOKEN }} + fetch-depth: 0 - name: Update docs & licenses run: | ./hack/update-docs-and-licenses.sh - - name: Commit and push changes - uses: EndBug/add-and-commit@v9 - with: - message: "auto(docs): update docs and licenses" + - name: Amend last commit with auto-generated changes + run: | + if [ -n "$(git status --porcelain)" ]; then + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git add . + git commit --amend --no-edit + git push --force-with-lease origin ${{ github.event.pull_request.head.ref || github.ref_name }} + fi From 630bfdfa6478f7b326917af4d5b0178201fe3061 Mon Sep 17 00:00:00 2001 From: OliverTrautvetter <66372584+OliverTrautvetter@users.noreply.github.com> Date: Tue, 14 Oct 2025 10:25:32 +0200 Subject: [PATCH 05/13] fix: amend last commit with auto-generated changes instead of using separate commit --- .github/workflows/update-docs-and-licenses.yml | 14 ++++++++++---- docs/oms_download_package.md | 4 ++-- docs/oms_update_package.md | 4 ++-- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/.github/workflows/update-docs-and-licenses.yml b/.github/workflows/update-docs-and-licenses.yml index 9e694692..d51ad07a 100644 --- a/.github/workflows/update-docs-and-licenses.yml +++ b/.github/workflows/update-docs-and-licenses.yml @@ -25,12 +25,18 @@ jobs: # on push to main, use main; on PR, check out the PR head ref: ${{ github.event.pull_request.head.ref || github.ref }} token: ${{ secrets.GITHUB_TOKEN }} + fetch-depth: 0 - name: Update docs & licenses run: | ./hack/update-docs-and-licenses.sh - - name: Commit and push changes - uses: EndBug/add-and-commit@v9 - with: - message: "auto(docs): update docs and licenses" + - name: Amend last commit with auto-generated changes + run: | + if [ -n "$(git status --porcelain)" ]; then + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git add . + git commit --amend --no-edit + git push --force-with-lease origin ${{ github.event.pull_request.head.ref || github.ref_name }} + fi diff --git a/docs/oms_download_package.md b/docs/oms_download_package.md index 4dc5fceb..2ecbd52e 100644 --- a/docs/oms_download_package.md +++ b/docs/oms_download_package.md @@ -15,10 +15,10 @@ oms download package [flags] ``` # Download Codesphere version 1.55.0 -$ /tmp/go-build2765864964/b001/exe/main download package --version codesphere-v1.55.0 +$ /tmp/go-build1242790248/b001/exe/main download package --version codesphere-v1.55.0 # Download lite package of Codesphere version 1.55.0 -$ /tmp/go-build2765864964/b001/exe/main download package --version codesphere-v1.55.0 --file installer-lite.tar.gz +$ /tmp/go-build1242790248/b001/exe/main download package --version codesphere-v1.55.0 --file installer-lite.tar.gz ``` ### Options diff --git a/docs/oms_update_package.md b/docs/oms_update_package.md index baeb37c7..8eba0966 100644 --- a/docs/oms_update_package.md +++ b/docs/oms_update_package.md @@ -15,10 +15,10 @@ oms update package [flags] ``` # Download Codesphere version 1.55.0 -$ /tmp/go-build2765864964/b001/exe/main download package --version codesphere-v1.55.0 +$ /tmp/go-build1242790248/b001/exe/main download package --version codesphere-v1.55.0 # Download lite package of Codesphere version 1.55.0 -$ /tmp/go-build2765864964/b001/exe/main download package --version codesphere-v1.55.0 --file installer-lite.tar.gz +$ /tmp/go-build1242790248/b001/exe/main download package --version codesphere-v1.55.0 --file installer-lite.tar.gz ``` ### Options From 6434e76290ed1e5d15891645a73745d3c563f1eb Mon Sep 17 00:00:00 2001 From: OliverTrautvetter <66372584+OliverTrautvetter@users.noreply.github.com> Date: Tue, 14 Oct 2025 10:29:28 +0200 Subject: [PATCH 06/13] fix: add signoff to auto-amend commit in update-docs-and-licenses workflow --- .github/workflows/update-docs-and-licenses.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-docs-and-licenses.yml b/.github/workflows/update-docs-and-licenses.yml index d51ad07a..51106dd6 100644 --- a/.github/workflows/update-docs-and-licenses.yml +++ b/.github/workflows/update-docs-and-licenses.yml @@ -37,6 +37,6 @@ jobs: git config --local user.email "action@github.com" git config --local user.name "GitHub Action" git add . - git commit --amend --no-edit + git commit --amend --no-edit --signoff git push --force-with-lease origin ${{ github.event.pull_request.head.ref || github.ref_name }} fi From f7b9fe75a27669cdf4d39f8bbe11f921f4c6cd73 Mon Sep 17 00:00:00 2001 From: Manuel Dewald Date: Fri, 10 Oct 2025 15:08:22 +0200 Subject: [PATCH 07/13] docs: Describe service root command, update README (#32) * Adds a description to the service command * Updates README Signed-off-by: OliverTrautvetter <66372584+OliverTrautvetter@users.noreply.github.com> --- README.md | 84 +++++++++++++++++++++++++++++++++++---------- service/cmd/root.go | 29 +++------------- 2 files changed, 70 insertions(+), 43 deletions(-) diff --git a/README.md b/README.md index 00b7672f..fc84da25 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) ![CLI GitHub Workflow Status](https://github.com/codesphere-cloud/oms/actions/workflows/service-build_test.yml/badge.svg) ![Service GitHub Workflow Status](https://github.com/codesphere-cloud/oms/actions/workflows/cli-build_test.yml/badge.svg) @@ -6,46 +7,93 @@ This repository contains the source for the operations management system. It contains the sources for both the CLI and the Service. -## CLI -The CLI tool is used to bootstrap Codesphere cluster on customer sites and +## OMS CLI + +The OMS CLI tool is used to bootstrap Codesphere cluster on customer sites and replaces the formerly used private cloud installer. -### How to Build? +### Installation -```shell -make build-cli +You can install the OMS CLI in a few ways: + +#### Using GitHub CLI (`gh`) + +If you have the [GitHub CLI](https://cli.github.com/) installed, you can install the OMS CLI with a command like the following. +Note that some commands may require you to elevate to the root user with `sudo`. + +##### ARM Mac + +``` +gh release download -R codesphere-cloud/oms -O /usr/local/bin/oms-cli -p "oms-cli*darwin_arm64" +chmod +x /usr/local/bin/oms-cli ``` -### How to Test? +##### Linux Amd64 +``` +gh release download -R codesphere-cloud/oms -O /usr/local/bin/oms-cli -p "oms-cli*linux_amd64" +chmod +x /usr/local/bin/oms-cli +``` -### How to Use? +#### Using `wget` +This option requires to have the `wget` and `jq` utils installed. Download the OMS CLI and add permissions to run it with the following commands: +Note that some commands may require you to elevate to the root user with `sudo`. -## Service +##### ARM Mac -### How to Build? +``` +wget -qO- 'https://api.github.com/repos/codesphere-cloud/oms/releases/latest' | jq -r '.assets[] | select(.name | match("oms-cli.*darwin_arm64")) | .browser_download_url' | xargs wget -O oms-cli +mv oms-cli /usr/local/bin/oms-cli +chmod +x /usr/local/bin/oms-cli +``` -```shell -make build-service +##### Linux Amd64 + +``` +wget -qO- 'https://api.github.com/repos/codesphere-cloud/oms/releases/latest' | jq -r '.assets[] | select(.name | match("oms-cli.*linux_amd64")) | .browser_download_url' | xargs wget -O oms-cli +mv oms-cli /usr/local/bin/oms-cli +chmod +x /usr/local/bin/oms-cli ``` -### How to Test? +#### Manual Download + +You can also download the pre-compiled binaries from the [OMS Releases page](https://github.com/codesphere-cloud/oms/releases). +Note that some commands may require you to elevate to the root user with `sudo`. + +1. Go to the [latest release](https://github.com/codesphere-cloud/oms-cli/releases/latest). +2. Download the appropriate release for your operating system and architecture (e.g., `oms-cli_darwin_amd64` for macOS, `oms-cli_linux_amd64` for Linux, or `oms-cli_windows_amd64` for Windows). -### How to Use? +3. Move the `oms-cli` binary to a directory in your system's `PATH` (e.g., `/usr/local/bin` on Linux/Mac, or a directory added to `Path` environment variable on Windows). +4. Make the binary executable (e.g. by running `chmod +x /usr/local/bin/oms-cli` on Mac or Linux) -## How to add a command to one of the binaries? +#### Available Commands -This project currently uses a fork of cobra-cli with locally-scoped variables: https://github.com/NautiluX/cobra-cli-local +The OMS CLI organizes its functionality into several top-level commands, each with specific subcommands and flags. + +See our [Usage Documentation](docs) for usage information about the specific subcommands. + +### How to Build? ```shell -cobra-cli add -L -d cli -p install postgres +make build-cli ``` -This command will add the following command to the CLI: +See also [CONTRIBUTION.md] + +## Service + +The service implementation is currently WIP + +### How to Build? ```shell -oms-cli install postgres +make build-service ``` + +## Community & Contributions + +Please review our [Code of Conduct](CODE_OF_CONDUCT.md) to understand our community expectations. +We welcome contributions! All contributions to this project must be made in accordance with the Developer Certificate of Origin (DCO). See our full [Contributing Guidelines](CONTRIBUTING.md) for details. diff --git a/service/cmd/root.go b/service/cmd/root.go index fb9abaa9..60f87ac9 100644 --- a/service/cmd/root.go +++ b/service/cmd/root.go @@ -1,43 +1,22 @@ // Copyright (c) Codesphere Inc. // SPDX-License-Identifier: Apache-2.0 - package cmd import ( "os" + "github.com/codesphere-cloud/cs-go/pkg/io" "github.com/spf13/cobra" ) -// Execute adds all child commands to the root command and sets flags appropriately. -// This is called by main.main(). It only needs to happen once to the rootCmd. func Execute() { - // rootCmd represents the base command when called without any subcommands rootCmd := &cobra.Command{ Use: "service", - Short: "A brief description of your application", - Long: `A longer description that spans multiple lines and likely contains -examples and usage of using your application. For example: + Short: "Codesphere Operations Management System", + Long: io.Long(`This is the OMS standalone service, which can be used to manage and observe Codesphere installations. -Cobra is a CLI library for Go that empowers applications. -This application is a tool to generate the needed files -to quickly create a Cobra application.`, - // Uncomment the following line if your bare application - // has an action associated with it: - // Run: func(cmd *cobra.Command, args []string) { }, + This area is work in progress! OMS is under heavy development so please take a look back soon!`), } - // Here you will define your flags and configuration settings. - // Cobra supports persistent flags, which, if defined here, - // will be global for your application. - - // rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.service.yaml)") - - // Cobra also supports local flags, which will only run - // when this action is called directly. - // rootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") - - // Add child commands here - // AddChildCmd(rootCmd) err := rootCmd.Execute() if err != nil { From d5c2d208894eb90719328e2e63b0d48264238a33 Mon Sep 17 00:00:00 2001 From: OliverTrautvetter <66372584+OliverTrautvetter@users.noreply.github.com> Date: Tue, 14 Oct 2025 09:56:04 +0200 Subject: [PATCH 08/13] feat (docs): Add auto generation of license and docs Signed-off-by: OliverTrautvetter <66372584+OliverTrautvetter@users.noreply.github.com> --- .github/workflows/cli-build_test.yml | 3 + .github/workflows/go-lint.yml | 3 + .github/workflows/service-build_test.yml | 3 + .github/workflows/tag-release.yml | 3 + .../workflows/update-docs-and-licenses.yml | 27 ++++++++ hack/update-docs-and-licenses.sh | 63 +++++++++++++++++++ internal/portal/api_key.go | 3 + internal/util/mocks.go | 3 +- internal/util/required_flag.go | 3 + 9 files changed, 109 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/update-docs-and-licenses.yml create mode 100755 hack/update-docs-and-licenses.sh diff --git a/.github/workflows/cli-build_test.yml b/.github/workflows/cli-build_test.yml index ea4d33c1..242e8818 100644 --- a/.github/workflows/cli-build_test.yml +++ b/.github/workflows/cli-build_test.yml @@ -1,3 +1,6 @@ +# Copyright (c) Codesphere Inc. +# SPDX-License-Identifier: Apache-2.0 + # This workflow will build a golang project # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go diff --git a/.github/workflows/go-lint.yml b/.github/workflows/go-lint.yml index 14e37f2a..29e0d01b 100644 --- a/.github/workflows/go-lint.yml +++ b/.github/workflows/go-lint.yml @@ -1,3 +1,6 @@ +# Copyright (c) Codesphere Inc. +# SPDX-License-Identifier: Apache-2.0 + name: golangci-lint on: push: diff --git a/.github/workflows/service-build_test.yml b/.github/workflows/service-build_test.yml index 101190b1..e1d95753 100644 --- a/.github/workflows/service-build_test.yml +++ b/.github/workflows/service-build_test.yml @@ -1,3 +1,6 @@ +# Copyright (c) Codesphere Inc. +# SPDX-License-Identifier: Apache-2.0 + # This workflow will build a golang project # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml index d17de3a6..4aab3d22 100644 --- a/.github/workflows/tag-release.yml +++ b/.github/workflows/tag-release.yml @@ -1,3 +1,6 @@ +# Copyright (c) Codesphere Inc. +# SPDX-License-Identifier: Apache-2.0 + name: Tag on: diff --git a/.github/workflows/update-docs-and-licenses.yml b/.github/workflows/update-docs-and-licenses.yml new file mode 100644 index 00000000..d111ebf8 --- /dev/null +++ b/.github/workflows/update-docs-and-licenses.yml @@ -0,0 +1,27 @@ +# Copyright (c) Codesphere Inc. +# SPDX-License-Identifier: Apache-2.0 + +name: 'Auto-Update Docs & Licenses' + +on: + pull_request: + types: [opened, synchronize] + +jobs: + update-files: + runs-on: ubuntu-latest + steps: + - name: Checkout PR Code + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.ref }} + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Update docs & licenses + run: | + ./hack/update-docs-and-licenses.sh + + - name: Commit and push changes + uses: EndBug/add-and-commit@v9 + with: + message: "auto(docs): update docs and licenses" \ No newline at end of file diff --git a/hack/update-docs-and-licenses.sh b/hack/update-docs-and-licenses.sh new file mode 100755 index 00000000..c9b01837 --- /dev/null +++ b/hack/update-docs-and-licenses.sh @@ -0,0 +1,63 @@ +#!/usr/bin/env bash +# Copyright (c) Codesphere Inc. +# SPDX-License-Identifier: Apache-2.0 + +set -euo pipefail +IFS=$'\n\t' + +here=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +root=$(cd "$here/.." && pwd) + +echo "Working directory: $root" + +cd "$root" + +echo "1/2: Generating docs" + +if command -v go >/dev/null 2>&1; then + go run ./hack/gendocs/main.go + echo "Docs generated into: $root/docs" +else + echo "ERROR: 'go' binary not found in PATH. Install Go and retry." >&2 + exit 2 +fi + +echo "2/2: Updating licenses" + +echo "Checking license tooling: go-licenses + addlicense" + +export GOBIN="$(go env GOBIN 2>/dev/null || echo "$HOME/go/bin")" +export PATH="$GOBIN:$PATH" + +need_install=() +if ! command -v go-licenses >/dev/null 2>&1; then + need_install+=("github.com/google/go-licenses@latest") +fi +if ! command -v addlicense >/dev/null 2>&1; then + need_install+=("github.com/google/addlicense@latest") +fi + +if [ ${#need_install[@]} -ne 0 ]; then + echo "Installing missing tools: ${need_install[*]}" + for pkg in "${need_install[@]}"; do + if command -v go >/dev/null 2>&1; then + go install "$pkg" + else + echo "ERROR: 'go' binary not found; cannot install $pkg" >&2 + exit 2 + fi + done +fi + +echo "Generating NOTICE via go-licenses" +if command -v go-licenses >/dev/null 2>&1; then + + if ! go-licenses report --template .NOTICE.template ./... > NOTICE 2> >(grep -v "module .* has empty version, defaults to HEAD" >&2); then + echo "go-licenses report failed" >&2 + fi + echo "NOTICE generated/updated" +else + echo "go-licenses not available; skipping NOTICE generation" >&2 +fi + +echo "Done." diff --git a/internal/portal/api_key.go b/internal/portal/api_key.go index 20de7892..1d7d161e 100644 --- a/internal/portal/api_key.go +++ b/internal/portal/api_key.go @@ -1,3 +1,6 @@ +// Copyright (c) Codesphere Inc. +// SPDX-License-Identifier: Apache-2.0 + package portal import "time" diff --git a/internal/util/mocks.go b/internal/util/mocks.go index c9fcabf6..23487339 100644 --- a/internal/util/mocks.go +++ b/internal/util/mocks.go @@ -5,10 +5,9 @@ package util import ( - "os" - "github.com/jedib0t/go-pretty/v6/table" mock "github.com/stretchr/testify/mock" + "os" ) // NewMockFileIO creates a new instance of MockFileIO. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. diff --git a/internal/util/required_flag.go b/internal/util/required_flag.go index 600c1e62..e9109b84 100644 --- a/internal/util/required_flag.go +++ b/internal/util/required_flag.go @@ -1,3 +1,6 @@ +// Copyright (c) Codesphere Inc. +// SPDX-License-Identifier: Apache-2.0 + package util import ( From 86e49c2733c568920326a81413492b9802cb833b Mon Sep 17 00:00:00 2001 From: OliverTrautvetter <66372584+OliverTrautvetter@users.noreply.github.com> Date: Tue, 14 Oct 2025 10:11:48 +0200 Subject: [PATCH 09/13] fix: prevent new workflow from doing loops and ignoring merges Signed-off-by: OliverTrautvetter <66372584+OliverTrautvetter@users.noreply.github.com> --- .github/workflows/update-docs-and-licenses.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/update-docs-and-licenses.yml b/.github/workflows/update-docs-and-licenses.yml index d111ebf8..9e694692 100644 --- a/.github/workflows/update-docs-and-licenses.yml +++ b/.github/workflows/update-docs-and-licenses.yml @@ -3,18 +3,27 @@ name: 'Auto-Update Docs & Licenses' +permissions: + contents: write + on: pull_request: types: [opened, synchronize] + push: + branches: + - main jobs: update-files: + # skip runs triggered by the bot's own commit to avoid loops + if: github.actor != 'github-actions[bot]' runs-on: ubuntu-latest steps: - - name: Checkout PR Code + - name: Checkout Code uses: actions/checkout@v4 with: - ref: ${{ github.event.pull_request.head.ref }} + # on push to main, use main; on PR, check out the PR head + ref: ${{ github.event.pull_request.head.ref || github.ref }} token: ${{ secrets.GITHUB_TOKEN }} - name: Update docs & licenses @@ -24,4 +33,4 @@ jobs: - name: Commit and push changes uses: EndBug/add-and-commit@v9 with: - message: "auto(docs): update docs and licenses" \ No newline at end of file + message: "auto(docs): update docs and licenses" From c09a065b4257bd18b73de3481486e23b6c4e6849 Mon Sep 17 00:00:00 2001 From: OliverTrautvetter Date: Tue, 14 Oct 2025 08:15:13 +0000 Subject: [PATCH 10/13] auto(docs): update docs and licenses Signed-off-by: OliverTrautvetter <66372584+OliverTrautvetter@users.noreply.github.com> --- docs/oms.md | 7 ++++-- docs/oms_beta.md | 21 ++++++++++++++++++ docs/oms_beta_extend.md | 20 +++++++++++++++++ docs/oms_beta_extend_baseimage.md | 30 +++++++++++++++++++++++++ docs/oms_download.md | 6 +---- docs/oms_download_package.md | 6 ++--- docs/oms_list.md | 3 ++- docs/oms_list_api-keys.md | 23 +++++++++++++++++++ docs/oms_list_packages.md | 2 +- docs/oms_register.md | 27 ++++++++++++++++++++++ docs/oms_revoke.md | 21 ++++++++++++++++++ docs/oms_revoke_api-key.md | 24 ++++++++++++++++++++ docs/oms_update.md | 9 +++++--- docs/oms_update_api-key.md | 25 +++++++++++++++++++++ docs/oms_update_oms.md | 23 +++++++++++++++++++ docs/oms_update_package.md | 37 +++++++++++++++++++++++++++++++ docs/oms_version.md | 2 +- 17 files changed, 270 insertions(+), 16 deletions(-) create mode 100644 docs/oms_beta.md create mode 100644 docs/oms_beta_extend.md create mode 100644 docs/oms_beta_extend_baseimage.md create mode 100644 docs/oms_list_api-keys.md create mode 100644 docs/oms_register.md create mode 100644 docs/oms_revoke.md create mode 100644 docs/oms_revoke_api-key.md create mode 100644 docs/oms_update_api-key.md create mode 100644 docs/oms_update_oms.md create mode 100644 docs/oms_update_package.md diff --git a/docs/oms.md b/docs/oms.md index c90fac99..b1478448 100644 --- a/docs/oms.md +++ b/docs/oms.md @@ -17,9 +17,12 @@ like downloading new versions. ### SEE ALSO +* [oms beta](oms_beta.md) - Commands for early testing * [oms download](oms_download.md) - Download resources available through OMS * [oms list](oms_list.md) - List resources available through OMS -* [oms update](oms_update.md) - Update Codesphere OMS +* [oms register](oms_register.md) - Register a new API key +* [oms revoke](oms_revoke.md) - Revoke resources available through OMS +* [oms update](oms_update.md) - Update OMS related resources * [oms version](oms_version.md) - Print version -###### Auto generated by spf13/cobra on 19-Sep-2025 +###### Auto generated by spf13/cobra on 14-Oct-2025 diff --git a/docs/oms_beta.md b/docs/oms_beta.md new file mode 100644 index 00000000..97fb981a --- /dev/null +++ b/docs/oms_beta.md @@ -0,0 +1,21 @@ +## oms beta + +Commands for early testing + +### Synopsis + +OMS CLI commands for early adoption and testing. +Be aware that that usage and behavior may change as the features are developed. + +### Options + +``` + -h, --help help for beta +``` + +### SEE ALSO + +* [oms](oms.md) - Codesphere Operations Management System (OMS) +* [oms beta extend](oms_beta_extend.md) - Extend Codesphere ressources such as base images. + +###### Auto generated by spf13/cobra on 14-Oct-2025 diff --git a/docs/oms_beta_extend.md b/docs/oms_beta_extend.md new file mode 100644 index 00000000..7f598058 --- /dev/null +++ b/docs/oms_beta_extend.md @@ -0,0 +1,20 @@ +## oms beta extend + +Extend Codesphere ressources such as base images. + +### Synopsis + +Extend Codesphere ressources such as base images to customize them for your needs. + +### Options + +``` + -h, --help help for extend +``` + +### SEE ALSO + +* [oms beta](oms_beta.md) - Commands for early testing +* [oms beta extend baseimage](oms_beta_extend_baseimage.md) - Extend Codesphere's workspace base image for customization + +###### Auto generated by spf13/cobra on 14-Oct-2025 diff --git a/docs/oms_beta_extend_baseimage.md b/docs/oms_beta_extend_baseimage.md new file mode 100644 index 00000000..704dd207 --- /dev/null +++ b/docs/oms_beta_extend_baseimage.md @@ -0,0 +1,30 @@ +## oms beta extend baseimage + +Extend Codesphere's workspace base image for customization + +### Synopsis + +Loads the baseimage from Codesphere package and generates a Dockerfile based on it. +This enables you to extend Codesphere's base image with specific dependencies. + +To use the custom base image, you need to push the resulting image to your container registry and +reference it in your install-config for the Codesphere installation process to pick it up and include it in Codesphere + +``` +oms beta extend baseimage [flags] +``` + +### Options + +``` + -d, --dockerfile string Output Dockerfile to generate for extending the base image (default "Dockerfile") + -f, --force Enforce package extraction + -h, --help help for baseimage + -p, --package string Package file (e.g. codesphere-v1.2.3-installer.tar.gz) to load base image from +``` + +### SEE ALSO + +* [oms beta extend](oms_beta_extend.md) - Extend Codesphere ressources such as base images. + +###### Auto generated by spf13/cobra on 14-Oct-2025 diff --git a/docs/oms_download.md b/docs/oms_download.md index 29728ade..1eedf18e 100644 --- a/docs/oms_download.md +++ b/docs/oms_download.md @@ -7,10 +7,6 @@ Download resources available through OMS Download resources managed by or available for OMS, e.g. available Codesphere packages -``` -oms download [flags] -``` - ### Options ``` @@ -22,4 +18,4 @@ oms download [flags] * [oms](oms.md) - Codesphere Operations Management System (OMS) * [oms download package](oms_download_package.md) - Download a codesphere package -###### Auto generated by spf13/cobra on 19-Sep-2025 +###### Auto generated by spf13/cobra on 14-Oct-2025 diff --git a/docs/oms_download_package.md b/docs/oms_download_package.md index de640c62..4dc5fceb 100644 --- a/docs/oms_download_package.md +++ b/docs/oms_download_package.md @@ -15,10 +15,10 @@ oms download package [flags] ``` # Download Codesphere version 1.55.0 -$ /var/folders/h2/qdn9mcsx32j2384qdrqyqlkw0000gn/T/go-build3505592854/b001/exe/main download package --version 1.55.0 +$ /tmp/go-build2765864964/b001/exe/main download package --version codesphere-v1.55.0 # Download lite package of Codesphere version 1.55.0 -$ /var/folders/h2/qdn9mcsx32j2384qdrqyqlkw0000gn/T/go-build3505592854/b001/exe/main download package --version 1.55.0 --file installer-lite.tar.gz +$ /tmp/go-build2765864964/b001/exe/main download package --version codesphere-v1.55.0 --file installer-lite.tar.gz ``` ### Options @@ -34,4 +34,4 @@ $ /var/folders/h2/qdn9mcsx32j2384qdrqyqlkw0000gn/T/go-build3505592854/b001/exe/m * [oms download](oms_download.md) - Download resources available through OMS -###### Auto generated by spf13/cobra on 19-Sep-2025 +###### Auto generated by spf13/cobra on 14-Oct-2025 diff --git a/docs/oms_list.md b/docs/oms_list.md index f92c44b4..84a56737 100644 --- a/docs/oms_list.md +++ b/docs/oms_list.md @@ -16,6 +16,7 @@ eg. available Codesphere packages ### SEE ALSO * [oms](oms.md) - Codesphere Operations Management System (OMS) +* [oms list api-keys](oms_list_api-keys.md) - List API keys * [oms list packages](oms_list_packages.md) - List available packages -###### Auto generated by spf13/cobra on 19-Sep-2025 +###### Auto generated by spf13/cobra on 14-Oct-2025 diff --git a/docs/oms_list_api-keys.md b/docs/oms_list_api-keys.md new file mode 100644 index 00000000..3e3b4950 --- /dev/null +++ b/docs/oms_list_api-keys.md @@ -0,0 +1,23 @@ +## oms list api-keys + +List API keys + +### Synopsis + +List API keys registered in the OMS portal. + +``` +oms list api-keys [flags] +``` + +### Options + +``` + -h, --help help for api-keys +``` + +### SEE ALSO + +* [oms list](oms_list.md) - List resources available through OMS + +###### Auto generated by spf13/cobra on 14-Oct-2025 diff --git a/docs/oms_list_packages.md b/docs/oms_list_packages.md index e61d1880..f61569b1 100644 --- a/docs/oms_list_packages.md +++ b/docs/oms_list_packages.md @@ -20,4 +20,4 @@ oms list packages [flags] * [oms list](oms_list.md) - List resources available through OMS -###### Auto generated by spf13/cobra on 19-Sep-2025 +###### Auto generated by spf13/cobra on 14-Oct-2025 diff --git a/docs/oms_register.md b/docs/oms_register.md new file mode 100644 index 00000000..d015c8d3 --- /dev/null +++ b/docs/oms_register.md @@ -0,0 +1,27 @@ +## oms register + +Register a new API key + +### Synopsis + +Register a new API key for accessing the OMS portal. + +``` +oms register [flags] +``` + +### Options + +``` + -e, --expires string Expiration date of the new API key. Default is 1 year from now. Format: RFC3339 (e.g., 2024-12-31T23:59:59Z) + -h, --help help for register + -g, --organization string Organization of the new API key + -o, --owner string Owner of the new API key + -r, --role string Role of the new API key. Available roles: Admin, Dev, Ext (default "Ext") +``` + +### SEE ALSO + +* [oms](oms.md) - Codesphere Operations Management System (OMS) + +###### Auto generated by spf13/cobra on 14-Oct-2025 diff --git a/docs/oms_revoke.md b/docs/oms_revoke.md new file mode 100644 index 00000000..064f605b --- /dev/null +++ b/docs/oms_revoke.md @@ -0,0 +1,21 @@ +## oms revoke + +Revoke resources available through OMS + +### Synopsis + +Revoke resources managed by or available for OMS, +eg. api keys. + +### Options + +``` + -h, --help help for revoke +``` + +### SEE ALSO + +* [oms](oms.md) - Codesphere Operations Management System (OMS) +* [oms revoke api-key](oms_revoke_api-key.md) - Revoke an API key + +###### Auto generated by spf13/cobra on 14-Oct-2025 diff --git a/docs/oms_revoke_api-key.md b/docs/oms_revoke_api-key.md new file mode 100644 index 00000000..f18f2228 --- /dev/null +++ b/docs/oms_revoke_api-key.md @@ -0,0 +1,24 @@ +## oms revoke api-key + +Revoke an API key + +### Synopsis + +Revoke an OMS portal API key. + +``` +oms revoke api-key [flags] +``` + +### Options + +``` + -h, --help help for api-key + -i, --id string API key id to revoke +``` + +### SEE ALSO + +* [oms revoke](oms_revoke.md) - Revoke resources available through OMS + +###### Auto generated by spf13/cobra on 14-Oct-2025 diff --git a/docs/oms_update.md b/docs/oms_update.md index 1d05476a..306be3bf 100644 --- a/docs/oms_update.md +++ b/docs/oms_update.md @@ -1,10 +1,10 @@ ## oms update -Update Codesphere OMS +Update OMS related resources ### Synopsis -Updates the OMS to the latest release from OMS Portal. +Updates resources, e.g. OMS or OMS API keys. ``` oms update [flags] @@ -19,5 +19,8 @@ oms update [flags] ### SEE ALSO * [oms](oms.md) - Codesphere Operations Management System (OMS) +* [oms update api-key](oms_update_api-key.md) - Update an API key's expiration date +* [oms update oms](oms_update_oms.md) - Update the OMS CLI +* [oms update package](oms_update_package.md) - Download a codesphere package -###### Auto generated by spf13/cobra on 19-Sep-2025 +###### Auto generated by spf13/cobra on 14-Oct-2025 diff --git a/docs/oms_update_api-key.md b/docs/oms_update_api-key.md new file mode 100644 index 00000000..57d2b6f4 --- /dev/null +++ b/docs/oms_update_api-key.md @@ -0,0 +1,25 @@ +## oms update api-key + +Update an API key's expiration date + +### Synopsis + +Updates the expiration date for a given API key using the --id and --valid-to flags. + +``` +oms update api-key [flags] +``` + +### Options + +``` + -h, --help help for api-key + -i, --id string The ID of the API key to update + -v, --valid-to string The new expiration date in RFC3339 format (e.g., "2025-12-31T23:59:59Z") +``` + +### SEE ALSO + +* [oms update](oms_update.md) - Update OMS related resources + +###### Auto generated by spf13/cobra on 14-Oct-2025 diff --git a/docs/oms_update_oms.md b/docs/oms_update_oms.md new file mode 100644 index 00000000..4a70fac0 --- /dev/null +++ b/docs/oms_update_oms.md @@ -0,0 +1,23 @@ +## oms update oms + +Update the OMS CLI + +### Synopsis + +Updates the OMS CLI to the latest release from OMS Portal. + +``` +oms update oms [flags] +``` + +### Options + +``` + -h, --help help for oms +``` + +### SEE ALSO + +* [oms update](oms_update.md) - Update OMS related resources + +###### Auto generated by spf13/cobra on 14-Oct-2025 diff --git a/docs/oms_update_package.md b/docs/oms_update_package.md new file mode 100644 index 00000000..baeb37c7 --- /dev/null +++ b/docs/oms_update_package.md @@ -0,0 +1,37 @@ +## oms update package + +Download a codesphere package + +### Synopsis + +Download a specific version of a Codesphere package +To list available packages, run oms list packages. + +``` +oms update package [flags] +``` + +### Examples + +``` +# Download Codesphere version 1.55.0 +$ /tmp/go-build2765864964/b001/exe/main download package --version codesphere-v1.55.0 + +# Download lite package of Codesphere version 1.55.0 +$ /tmp/go-build2765864964/b001/exe/main download package --version codesphere-v1.55.0 --file installer-lite.tar.gz +``` + +### Options + +``` + -f, --file string Specify artifact to download (default "installer.tar.gz") + -H, --hash string Hash of the version to download if multiple builds exist for the same version + -h, --help help for package + -V, --version string Codesphere version to download +``` + +### SEE ALSO + +* [oms update](oms_update.md) - Update OMS related resources + +###### Auto generated by spf13/cobra on 14-Oct-2025 diff --git a/docs/oms_version.md b/docs/oms_version.md index 1770d52b..f6a3f274 100644 --- a/docs/oms_version.md +++ b/docs/oms_version.md @@ -20,4 +20,4 @@ oms version [flags] * [oms](oms.md) - Codesphere Operations Management System (OMS) -###### Auto generated by spf13/cobra on 19-Sep-2025 +###### Auto generated by spf13/cobra on 14-Oct-2025 From 4a17380d5eb38f307b67ecdc8523a3fb8b6a4f07 Mon Sep 17 00:00:00 2001 From: OliverTrautvetter <66372584+OliverTrautvetter@users.noreply.github.com> Date: Tue, 14 Oct 2025 10:25:32 +0200 Subject: [PATCH 11/13] fix: amend last commit with auto-generated changes instead of using separate commit Signed-off-by: OliverTrautvetter <66372584+OliverTrautvetter@users.noreply.github.com> --- .github/workflows/update-docs-and-licenses.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/update-docs-and-licenses.yml b/.github/workflows/update-docs-and-licenses.yml index 9e694692..d51ad07a 100644 --- a/.github/workflows/update-docs-and-licenses.yml +++ b/.github/workflows/update-docs-and-licenses.yml @@ -25,12 +25,18 @@ jobs: # on push to main, use main; on PR, check out the PR head ref: ${{ github.event.pull_request.head.ref || github.ref }} token: ${{ secrets.GITHUB_TOKEN }} + fetch-depth: 0 - name: Update docs & licenses run: | ./hack/update-docs-and-licenses.sh - - name: Commit and push changes - uses: EndBug/add-and-commit@v9 - with: - message: "auto(docs): update docs and licenses" + - name: Amend last commit with auto-generated changes + run: | + if [ -n "$(git status --porcelain)" ]; then + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git add . + git commit --amend --no-edit + git push --force-with-lease origin ${{ github.event.pull_request.head.ref || github.ref_name }} + fi From ba8c5c15e2f3b8255d4ba1b595860a304970065b Mon Sep 17 00:00:00 2001 From: OliverTrautvetter <66372584+OliverTrautvetter@users.noreply.github.com> Date: Tue, 14 Oct 2025 10:29:28 +0200 Subject: [PATCH 12/13] fix: add signoff to auto-amend commit in update-docs-and-licenses workflow Signed-off-by: OliverTrautvetter <66372584+OliverTrautvetter@users.noreply.github.com> --- .github/workflows/update-docs-and-licenses.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-docs-and-licenses.yml b/.github/workflows/update-docs-and-licenses.yml index d51ad07a..51106dd6 100644 --- a/.github/workflows/update-docs-and-licenses.yml +++ b/.github/workflows/update-docs-and-licenses.yml @@ -37,6 +37,6 @@ jobs: git config --local user.email "action@github.com" git config --local user.name "GitHub Action" git add . - git commit --amend --no-edit + git commit --amend --no-edit --signoff git push --force-with-lease origin ${{ github.event.pull_request.head.ref || github.ref_name }} fi From 5ee6bf247f558d511b42d0898d86e8ce9890f837 Mon Sep 17 00:00:00 2001 From: OliverTrautvetter <66372584+OliverTrautvetter@users.noreply.github.com> Date: Tue, 14 Oct 2025 10:25:32 +0200 Subject: [PATCH 13/13] fix: amend last commit with auto-generated changes instead of using separate commit Signed-off-by: OliverTrautvetter <66372584+OliverTrautvetter@users.noreply.github.com> --- docs/oms_download_package.md | 4 ++-- docs/oms_update_package.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/oms_download_package.md b/docs/oms_download_package.md index 4dc5fceb..2ecbd52e 100644 --- a/docs/oms_download_package.md +++ b/docs/oms_download_package.md @@ -15,10 +15,10 @@ oms download package [flags] ``` # Download Codesphere version 1.55.0 -$ /tmp/go-build2765864964/b001/exe/main download package --version codesphere-v1.55.0 +$ /tmp/go-build1242790248/b001/exe/main download package --version codesphere-v1.55.0 # Download lite package of Codesphere version 1.55.0 -$ /tmp/go-build2765864964/b001/exe/main download package --version codesphere-v1.55.0 --file installer-lite.tar.gz +$ /tmp/go-build1242790248/b001/exe/main download package --version codesphere-v1.55.0 --file installer-lite.tar.gz ``` ### Options diff --git a/docs/oms_update_package.md b/docs/oms_update_package.md index baeb37c7..8eba0966 100644 --- a/docs/oms_update_package.md +++ b/docs/oms_update_package.md @@ -15,10 +15,10 @@ oms update package [flags] ``` # Download Codesphere version 1.55.0 -$ /tmp/go-build2765864964/b001/exe/main download package --version codesphere-v1.55.0 +$ /tmp/go-build1242790248/b001/exe/main download package --version codesphere-v1.55.0 # Download lite package of Codesphere version 1.55.0 -$ /tmp/go-build2765864964/b001/exe/main download package --version codesphere-v1.55.0 --file installer-lite.tar.gz +$ /tmp/go-build1242790248/b001/exe/main download package --version codesphere-v1.55.0 --file installer-lite.tar.gz ``` ### Options