Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
19b92c8
[KERNEL] [RUNTIME] [DOCS] describe the logging contracts, give module…
MarcT1me Nov 25, 2026
7499e01
[SDK] [TOOLS] [DOCS] add marks in comments, pack a module before its …
MarcT1me Nov 25, 2026
b7ae9e4
[SCRIPTS] [DOCS] check the marks, start the mirror by a release only
MarcT1me Nov 25, 2026
2dfb017
[SCRIPTS] [SDK] [DOCS] check the marks of the modules with the workfl…
MarcT1me Nov 25, 2026
b83f6d4
Merge pull request #17 from QuantumDevTeam/feature/marks-and-logging
MarcT1me Nov 25, 2026
f5ecea0
[DOCS] describe the way of a change
MarcT1me Nov 25, 2026
1f66ac0
Merge pull request #18 from QuantumDevTeam/feature/git-policy
MarcT1me Nov 25, 2026
c13733f
[SCRIPTS] [SDK] build and test on every pull request
MarcT1me Nov 25, 2026
88c81cb
Merge pull request #19 from QuantumDevTeam/feature/tests-ci
MarcT1me Nov 25, 2026
b1a365a
[CORE] [TESTS] skip the tests of the native core without it
MarcT1me Nov 25, 2026
22104b0
[SDK] clean up the analyzers
MarcT1me Nov 25, 2026
89dca0e
[SDK] [DOCS] raise the versions, describe the migration
MarcT1me Nov 25, 2026
c6c52b0
Merge pull request #20 from QuantumDevTeam/feature/migration-0.11
MarcT1me Nov 25, 2026
0e034d9
[SCRIPTS] [DOCS] run the tests by hand, by themselves only for master
MarcT1me Nov 25, 2026
3ea261d
[KERNEL] [SDK] [DOCS] name the folders of the engine, put compiled re…
MarcT1me Nov 25, 2026
b5f602f
Merge pull request #21 from QuantumDevTeam/feature/folders
MarcT1me Nov 25, 2026
6f3be1f
[SCRIPTS] [SDK] build and pack the modules with the core, keep one re…
MarcT1me Nov 28, 2026
22d5056
[DOCS] [SDK] publish the documentation to the docs site, drop the Doc…
MarcT1me Nov 28, 2026
20f1df7
[KERNEL] fix the spaces of the default logger format
MarcT1me Nov 28, 2026
3ba80c3
Merge pull request #51 from QuantumDevTeam/feature/prometheus-docs
MarcT1me Nov 28, 2026
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
112 changes: 86 additions & 26 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
name: Docs

# Builds the documentation site with DocFX and publishes it to GitHub Pages. One workflow, two sites:
# - in StellarEngine-Core: the site of the core (docfx.json): Docs/, the API reference, the schemas, the installer;
# - in the mirror (StellarEngine-Mono), recognized by the .orchestra file scripts/mirror.ps1 puts at its root:
# the site of the orchestra (scripts/orchestra-site.ps1), the core and every module in one site.
# Pull requests and manual runs on other branches only build; the site is deployed from master only.
# Repository setting required once: Settings -> Pages -> Source = "GitHub Actions".
# Publishes the documentation of this repository to GitHub Pages for the Prometheus site (the team site).
# GitHub Pages is only the storage of the site: static files (the installer, the schemas), the documentation as data
# (bundle/) and a small embed that redirects to the site when the site is up.
#
# This file is a thin wrapper and does not need updates: the steps (ci.py, the bundle builder, the embed) are
# downloaded from the site on every run (/docs-kit.zip), so they are always the same version as the site.
# What to build is described by the repository itself in prometheus.json (format prometheus-repo/1, see the DOCS
# page of the site); without it: Docs/ and the API of the projects in docfx.json.
# If the site is down, the static files and a page that leads to the site are published; the next run fixes the rest.
#
# Repository settings:
# Settings -> Pages -> Source = "GitHub Actions" (once)
# Variables (optional): PROMETHEUS_SITE (https://notagood.org by default),
# PROMETHEUS_PROJECT, PROMETHEUS_TITLE (override prometheus.json)
# Secrets (optional): PROMETHEUS_SYNC_KEY an API key of the site with the "sync" scope: the site learns about
# the new build at once instead of on its next check
# Pull requests and manual runs on other branches only build; Pages is deployed from master only.

on:
push:
Expand All @@ -24,49 +35,88 @@ env:
DOCFX_VERSION: '2.81.0'
DOTNET_NOLOGO: 'true'
DOTNET_CLI_TELEMETRY_OPTOUT: 'true'
PROMETHEUS_SITE: ${{ vars.PROMETHEUS_SITE || 'https://notagood.org' }}
PROMETHEUS_PROJECT: ${{ vars.PROMETHEUS_PROJECT }}
PROMETHEUS_TITLE: ${{ vars.PROMETHEUS_TITLE }}
OUT: artifacts/pages

jobs:
build:
name: Build site
runs-on: ubuntu-latest
name: Build
runs-on: ubuntu-latest # pwsh, python3 and bash are there: "prepare" scripts may use any of them
steps:
- name: Checkout
uses: actions/checkout@v5

- name: Setup .NET
if: hashFiles('global.json') != ''
uses: actions/setup-dotnet@v5
with:
global-json-file: global.json

# Installed outside the checkout so the repository NuGet.config (local "packages" feed) is not involved.
- name: Setup .NET (no global.json)
if: hashFiles('global.json') == ''
uses: actions/setup-dotnet@v5
with:
dotnet-version: '9.0.x'

# Installed outside the checkout so a repository NuGet.config (a local feed) is not involved.
- name: Install DocFX
working-directory: ${{ runner.temp }}
run: dotnet tool install docfx --version "$DOCFX_VERSION" --tool-path "$RUNNER_TEMP/docfx"

- name: Choose the site
id: site
shell: pwsh
- name: Prometheus
id: prometheus
continue-on-error: true
run: |
# The local feed of an installation: empty here, but NuGet wants the folder it names to exist
New-Item -ItemType Directory -Force packages | Out-Null
if (Test-Path .orchestra) {
./scripts/orchestra-site.ps1
"config=docfx.orchestra.json" >> $env:GITHUB_OUTPUT
"output=artifacts/docs/orchestra-site" >> $env:GITHUB_OUTPUT
} else {
"config=docfx.json" >> $env:GITHUB_OUTPUT
"output=artifacts/docs/site" >> $env:GITHUB_OUTPUT
}
set -euo pipefail
# NuGet wants the local feed folder of an installation to exist, even empty
mkdir -p packages
curl -fsSL --retry 2 "$PROMETHEUS_SITE/docs-kit.zip" -o "$RUNNER_TEMP/kit.zip"
unzip -q -o "$RUNNER_TEMP/kit.zip" -d "$RUNNER_TEMP/kit"
python3 -m pip install --quiet pyyaml
python3 "$RUNNER_TEMP/kit/ci.py" --out "$OUT" --docfx "$RUNNER_TEMP/docfx/docfx"

# metadata (the API reference from the managed projects), then build
- name: Build documentation
run: '"$RUNNER_TEMP/docfx/docfx" "${{ steps.site.outputs.config }}" --warningsAsErrors'
# The site is down or the build failed: publish the static files and a page that leads to the site.
# Self-contained on purpose (no kit): the installer and the schemas keep their addresses whatever happens.
- name: Fallback
if: steps.prometheus.outcome == 'failure'
run: |
echo "::warning title=Prometheus::The documentation was not built (is $PROMETHEUS_SITE up?); publishing the static files only"
mkdir -p "$OUT" && touch "$OUT/.nojekyll"
python3 - <<'PY'
import glob, html, json, os, re, shutil
out = os.environ["OUT"]
cfg = json.load(open("prometheus.json", encoding="utf-8-sig")) if os.path.isfile("prometheus.json") else {}
static = cfg.get("static") or next((a.get("docfx") if isinstance(a, dict) else a for a in cfg.get("api") or []), None) \
or ("docfx.json" if os.path.isfile("docfx.json") else None)
for config in ([static] if isinstance(static, str) else static or []):
if not os.path.isfile(config):
continue
base = os.path.dirname(os.path.abspath(config))
for r in json.load(open(config, encoding="utf-8-sig")).get("build", {}).get("resource", []):
src, dest = os.path.join(base, r.get("src", "")), os.path.join(out, r.get("dest", ""))
for pattern in r.get("files", []):
for f in glob.glob(os.path.join(src, pattern), recursive=True):
if os.path.isfile(f):
t = os.path.join(dest, os.path.relpath(f, src))
os.makedirs(os.path.dirname(t), exist_ok=True)
shutil.copy2(f, t)
repo = os.environ.get("GITHUB_REPOSITORY", "").rsplit("/", 1)[-1]
project = os.environ.get("PROMETHEUS_PROJECT") or cfg.get("project") or re.sub(r"[^a-z0-9]+", "-", repo.lower()).strip("-")
url = html.escape(f"{os.environ['PROMETHEUS_SITE'].rstrip('/')}/docs/{project}")
title = html.escape(os.environ.get("PROMETHEUS_TITLE") or cfg.get("title") or repo)
with open(os.path.join(out, "index.html"), "w", encoding="utf-8") as f:
f.write(f'<!DOCTYPE html><html><head><meta charset="utf-8"><title>{title}</title>'
f'<meta http-equiv="refresh" content="0; url={url}"></head>'
f'<body><p><a href="{url}">{title} documentation</a></p></body></html>')
PY

- name: Upload Pages artifact
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master'
uses: actions/upload-pages-artifact@v5
with:
path: ${{ steps.site.outputs.output }}
path: ${{ env.OUT }}

deploy:
name: Deploy to GitHub Pages
Expand All @@ -87,3 +137,13 @@ jobs:
- name: Deploy
id: deployment
uses: actions/deploy-pages@v5

# The site would notice the new bundle on its next check anyway; this makes it immediate.
- name: Nudge the site
continue-on-error: true
env:
KEY: ${{ secrets.PROMETHEUS_SYNC_KEY }}
run: |
if [ -z "$KEY" ]; then echo "::notice::PROMETHEUS_SYNC_KEY is not set: the site picks the docs up on its next check"; exit 0; fi
sleep 30 # Pages needs a moment to serve the new files
curl -fsS -X POST -H "Authorization: Bearer $KEY" "$PROMETHEUS_SITE/api/v1/sync"
55 changes: 55 additions & 0 deletions .github/workflows/marks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Marks

# Marks in the comments of the code (Docs/Engine/Marks.md): one that stops a commit, or that nobody knows, does not
# get in. The hooks of git check the same on a machine; they can be skipped, this cannot.
#
# One workflow for every repository: the core runs it as it is, a module calls it. The kinds of marks and the command
# are those of the core, so a module is checked out into modules/ of a checkout of the core.

on:
push:
branches: [develop, master]
pull_request:
workflow_call:

permissions:
contents: read

jobs:
marks:
name: Marks
if: vars.STELLAR_MIRROR != 'true'
runs-on: ubuntu-latest
env:
IS_CORE: ${{ github.event.repository.name == 'StellarEngine-Core' }}
steps:
- name: Checkout
if: env.IS_CORE == 'true'
uses: actions/checkout@v5

- name: Checkout the core
if: env.IS_CORE != 'true'
uses: actions/checkout@v5
with:
repository: QuantumDevTeam/StellarEngine-Core
ref: develop

- name: Checkout the module
if: env.IS_CORE != 'true'
uses: actions/checkout@v5
with:
path: modules/${{ github.event.repository.name }}

- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
global-json-file: global.json

# A pull request into master is a release: what may lie in develop may not go there
- name: Check the marks
env:
STAGE: ${{ (github.base_ref == 'master' || github.ref == 'refs/heads/master') && 'release' || 'commit' }}
TARGET: ${{ github.event.repository.name == 'StellarEngine-Core' && '.' || format('modules/{0}', github.event.repository.name) }}
run: |
mkdir -p packages
dotnet run --project SDK/src/Stellar.Cli/Stellar.Cli.csproj -- marks check "$TARGET" --stage "$STAGE"
33 changes: 31 additions & 2 deletions .github/workflows/mirror.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,18 @@ name: Mirror
# The first snapshot comes from a machine: scripts/mirror.ps1 -Push. After that this workflow is the only writer:
# on a machine, mirror.ps1 without -Push shows the next snapshot, Run workflow here publishes it.

# It never starts by itself on a timer: a release of the core sends 'orchestra-release' (release.yml), or a person
# presses Run workflow. Run workflow also takes a component the mirror does not hold yet.

on:
repository_dispatch:
types: [orchestra-release]
workflow_dispatch:
schedule:
- cron: '17 3 * * *'
inputs:
add:
description: 'New components, e.g. modules/Stellar.LoggingSystem (comma separated). Empty: the ones of the mirror'
required: false
default: ''

permissions:
contents: write
Expand Down Expand Up @@ -62,6 +70,8 @@ jobs:
shell: pwsh
env:
COMPONENTS_TOKEN: ${{ secrets.STELLAR_MIRROR_TOKEN || github.token }}
# Through the environment, never pasted into the script
ADD: ${{ inputs.add }}
run: |
if (-not (Test-Path .orchestra)) {
throw 'No .orchestra here: make the first snapshot on a machine with scripts/mirror.ps1 -Push'
Expand All @@ -85,6 +95,13 @@ jobs:

$workspace = Join-Path $env:RUNNER_TEMP 'orchestra'
$components = @((Get-Content .orchestra -Raw | ConvertFrom-Json).Components)
# New components: a repository of the organization of the mirror, at its default branch
foreach ($entry in @("$env:ADD" -split ',' | ForEach-Object { $_.Trim() } | Where-Object { $_ })) {
if ($entry -cnotmatch '^(modules|tools)/([A-Za-z][A-Za-z0-9.-]*)$') { throw "Not modules/<Name> or tools/<Name>: $entry" }
$area, $name = $Matches[1], $Matches[2]
if ($components | Where-Object { $_.Name -eq $name }) { throw "$name is in the mirror already" }
$components += [pscustomobject]@{ Name = $name; Area = $area; Repository = "https://github.com/${{ github.repository_owner }}/$name.git" }
}
foreach ($component in $components) {
if ("$($component.Repository)" -like 'https://github.com/*' -and ($component.Repository -replace '\.git$', '') -ne $mirrorRepository) {
Set-Credentials $component.Repository $env:COMPONENTS_TOKEN
Expand All @@ -108,6 +125,18 @@ jobs:
"path=$workspace" >> $env:GITHUB_OUTPUT
"keep=$($keep -join ',')" >> $env:GITHUB_OUTPUT

- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
global-json-file: global.json

# The core and every component of the snapshot, as it will be pushed
- name: Check the marks
working-directory: ${{ steps.workspace.outputs.path }}
run: |
mkdir -p packages
dotnet run --project SDK/src/Stellar.Cli/Stellar.Cli.csproj -- marks check --all --stage release

- name: Snapshot and push
id: snapshot
shell: pwsh
Expand Down
41 changes: 29 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ name: Release
# into the tag v<version> and a GitHub release of the core.
#
# The orchestra is released by the mirror: its workflow tags the snapshot with the same version and publishes the
# release the installer installs. With the secret STELLAR_DISPATCH_TOKEN (a fine-grained token allowed to run the
# Actions of the mirror) this workflow starts it at once; without it the release of the orchestra waits for the
# nightly run of the mirror, or for Run workflow there.
# release the installer installs. With the variable STELLAR_MIRROR_APP_ID and the secret STELLAR_MIRROR_APP_KEY (the app
# that writes the mirror, see mirror.yml) this workflow starts it at once; without them the release of the orchestra
# waits for Run workflow in the mirror. Merge the modules into their master before the core: a snapshot takes it.
#
# The mirror holds this file too, as everything of the core: it never runs there (STELLAR_MIRROR is 'true').

Expand All @@ -34,6 +34,17 @@ jobs:
with:
fetch-depth: 0

- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
global-json-file: global.json

# Nothing that a mark stops is released: a tag cannot be taken back
- name: Check the marks
run: |
mkdir -p packages
dotnet run --project SDK/src/Stellar.Cli/Stellar.Cli.csproj -- marks check --stage release

- name: Tag and publish
id: release
shell: pwsh
Expand Down Expand Up @@ -77,14 +88,20 @@ jobs:
if ($LASTEXITCODE -ne 0) { throw "gh release create $tag failed" }
"released=true" >> $env:GITHUB_OUTPUT

# Only a release starts the mirror. Without the app here, Run workflow in the mirror does it
- name: Token of the mirror app
id: app
if: steps.release.outputs.released == 'true' && vars.STELLAR_MIRROR_APP_ID != ''
uses: actions/create-github-app-token@v3
with:
client-id: ${{ vars.STELLAR_MIRROR_APP_ID }}
private-key: ${{ secrets.STELLAR_MIRROR_APP_KEY }}
owner: ${{ github.repository_owner }}
repositories: StellarEngine-Mono
permission-contents: write

- name: Start the mirror
if: steps.release.outputs.released == 'true'
if: steps.app.outputs.token != ''
env:
GH_TOKEN: ${{ secrets.STELLAR_DISPATCH_TOKEN }}
MIRROR: ${{ vars.STELLAR_MIRROR_REPOSITORY || 'QuantumDevTeam/StellarEngine-Mono' }}
run: |
if [ -z "$GH_TOKEN" ]; then
echo "::notice::No STELLAR_DISPATCH_TOKEN: the orchestra is released by the next run of the mirror ($MIRROR)"
exit 0
fi
gh workflow run mirror.yml --repo "$MIRROR" --ref master
GH_TOKEN: ${{ steps.app.outputs.token }}
run: gh api "repos/${{ github.repository_owner }}/StellarEngine-Mono/dispatches" -f event_type=orchestra-release
Loading
Loading