Automated Python SDK generation from Open Telekom Cloud (OTC) API documentation.
The current focus is the repository scanner: given one opentelekomcloud-docs
repository, it checks that the repo's docs contain an api-ref/source/
directory, parses each endpoint RST file, and emits a structured JSON result
describing which documents can be processed today and which can't. Scanning a
whole organization — and aggregating the results into headline numbers — is
the panel's job, not the scanner's.
The token is the one thing kept outside the TOML config — it lives in .env
(or your shell environment) so it can never be committed by accident.
-
Create a GitHub personal access token: Settings → Developer settings → Personal access tokens → Tokens (classic). Scope:
public_repo. -
Copy it into
.env:cp .env.example .env # then edit .env and set GITHUB_TOKEN=ghp_...
The panel is a web app over the scan results: a FastAPI backend and a
React + TypeScript frontend, living in src/tools/panel/ and frontend/.
Requires Docker Desktop running and a .env file in the repo root with
GITHUB_TOKEN set (the backend won't start without it).
From the repo root:
docker compose up --buildWithout access to Artifactory, use the dev file - the same stack, with the backend built on the public Python image:
docker compose -f docker-compose.dev.yml up --buildStarts both services:
- Backend (FastAPI) on
http://localhost:8000 - Frontend (Vite) on
http://localhost:5173
Stop with:
docker compose down- Backend details:
src/tools/panel/README.md - Frontend dev (run without Docker):
frontend/README.md
The panel ships as two images, built by CI on a tag or a release. What they need from their environment and what they reach out to is in DEPLOYMENT.md; the Zitadel setup is in AUTHORIZATION.md.
To check documentation changes locally before a merge, see docs/local-scan.md.
git clone git@github.com:opentelekomcloud/gen-sdk-toolset.git
cd gen-sdk-toolset
uv sync --extra devThe scanner reads its configuration from three sources, in order of precedence:
- CLI flags (
--repo,--branch,--output, …) - Environment variables, including nested overrides via
__(e.g.GITHUB__ORG=foo) scan-config.tomlin the current working directory, or a custom path via--config <path>
The supported entrypoint is uv run gen-sdk-scan, which scans exactly one
repository per run:
# Scan one repository and print one raw RepositoryScanResult (no file written)
uv run gen-sdk-scan \
--repo opentelekomcloud-docs/anti-ddos \
--output -
# A branch name or a fixed commit SHA can select the snapshot
uv run gen-sdk-scan \
--repo opentelekomcloud-docs/anti-ddos \
--branch 8ff5254f6b7d669170bdacbdf5058e9adcfbe75f \
--output reports/anti-ddos.json
# Write to a file and also print the same JSON to stdout
uv run gen-sdk-scan --repo OWNER/NAME --output report.json --stdout
# Use a non-default config file or enable verbose logging
uv run gen-sdk-scan --repo OWNER/NAME --config configs/staging.toml -vOne of --repo (GitHub, takes an OWNER/NAME slug) or --path (a local git
working copy) is required. Scanning a whole
organization is the panel's job, not the CLI's: it needs durable job state to
resume after a rate limit, which a one-shot command cannot provide.
When the configured API reference path is absent, the scan succeeds with an
empty result whose repository remains a plain Repository. A repository or
ref that cannot be confirmed instead includes a diagnostic error and exits
non-zero.
| Flag | Effect |
|---|---|
--config PATH |
Path to TOML config (default: scan-config.toml) |
--output PATH |
Output JSON file path. - redirects to stdout instead |
--repo OWNER/NAME |
Required. Repository to scan; emits one RepositoryScanResult |
--branch NAME |
Branch name or fixed commit SHA to scan |
--stdout |
Also print the JSON report to stdout (in addition to the file) |
-v, --verbose |
DEBUG-level logging |
-q, --quiet |
WARNING-level logging |
A run produces one raw RepositoryScanResult, carrying data only: derived
views (per-document overall status, flat issue lists, version and quality
roll-ups) are not embedded in the JSON. They are computed by the pure functions
in tools.panel.core.analytics, so every number the panel reports has exactly
one definition and cannot drift from a second stored copy.
-
Repository data is represented by
Repositoryor its eligible specializationService. A service containsDocumentrecords; recognized endpoint documents are represented byEndpoint(Document)and contain their extractedSectionrecords. Thekinddiscriminator identifies each polymorphic entity asrepository,service,document, orendpoint. A plainDocumentwithout a failure is a successfully scanned non-endpoint; this classification is derived from the entity and is not stored in a parallelnon_endpoint_documentsfield. -
Scan results are nested into the entities produced by that scan:
- every document carries one
DocumentScanResultinscan_result; - every endpoint section carries one
SectionScanResultinscan_result; - result payloads contain diagnostics only and do not repeat their document or section;
- section ownership is expressed by nesting, so sections do not repeat an
endpoint_pathforeign key in the JSON snapshot.
- every document carries one
-
Repository scan metadata:
branch,commit_hash, andscanner_versionidentify the scan;- API-version counts are derived from
Service.endpoints, not stored in a paralleldocuments_by_versionstructure; error— repo-level failure (e.g. file listing failed, or a truncated file tree, so a partial scan is never mistaken for a clean one)
-
Derived views (
tools.panel.core.analytics, computed by the panel — never stored in the scan result):quality.py— the per-document primitives:document_sectionsanddoc_all_issues(every diagnostic flattened, with section-prefixed locations), plus theOverallStatusvocabularysnapshot.py— the roll-ups a scan is persisted with:document_statusper document, andanalyze_snapshotfor the headline numbers (SnapshotAnalytics: status counters,by_section_status,issues_by_code,by_version, completeness)
A committed default file with sensible values. Edit it (or override individual fields via env / CLI) to tweak:
[github]
org = "opentelekomcloud-docs"
branch = "main"
api_url = "https://api.github.com"
[scanner]
api_ref_path = "api-ref/source"
excluded_segments = ["out-of-date_apis", "calling_apis"]
max_workers = 8
[output]
path = "scan-output.json"
indent = 2
[logging]
level = "INFO"The RST file prefix (api-ref/source/) is derived from api_ref_path and is
not a key of its own.
docs/council/ records why a task is shaped the way it is: the decisions a
task rests on and the reasoning behind them. One maintainer keeps the folder and
produces it with an external tool. Everyone else, developers and coding agents
alike, only reads it.
Each note is one file, named by its ID, with id, type and links in the
frontmatter. links points to the note it grew out of, one step up the chain:
IDEA → OPEN QUESTION → PROPOSAL → ADR → OUTCOME
What each prefix means, IDEA- through ISS-, is defined in
docs/GLOSSARY.md, "Design notes". To see what was weighed
for a decision, go up from the ADR: it links to the proposal it chose. The other
proposals under the same question are the alternatives that were turned down.
- Read the outcome and the ADRs the issue names. The acceptance criteria in the outcome are what the change must satisfy. When the issue's copy of an ADR and the file here differ, the file wins.
- The issue's Open questions are left to implementation on purpose. Settle them while you work on the task.
- If the code, the issue or what you find while working contradicts an ADR or an outcome, stop. Raise it on the issue instead of deciding in code. A decision taken silently in code is exactly the gap these notes exist to close.
- Put the task's
ISS-number, given at the end of the issue, into the final commit message. When merging, keep the squash commit body: the repository fills it from the branch's commit messages, and that is how theISS-number reachesmain.
Do not add, edit, rename or delete anything under docs/council/, not even a
typo. The notes are regenerated outside the repository, so a local edit is lost
or conflicts with the next export. Report the problem on the issue instead.
Working on the code itself is documented separately, so it stays in one place:
- CONTRIBUTING.md — branches, commits, pull requests, CI gates
- AGENTS.md — the full command reference (lint, tests, coverage, schema regeneration) and the project layout
- docs/FAQ.md — how to carry out the common development tasks
- docs/AGENT-TOOLING.md — the
/plan,/reviewand/prcommands, the review agents, and the hooks that apply themselves - STYLEGUIDE.md — code conventions
- docs/GLOSSARY.md — the canonical domain vocabulary