up
Some checks failed
AOC Guard CI / aoc-guard (push) Has been cancelled
AOC Guard CI / aoc-verify (push) Has been cancelled
Docs CI / lint-and-preview (push) Has been cancelled

This commit is contained in:
StellaOps Bot
2025-11-24 09:07:40 +02:00
parent 150b3730ef
commit e6119cbe91
59 changed files with 1827 additions and 204 deletions

View File

@@ -0,0 +1,36 @@
# Post-process Scaffold (SDKGEN-62-002)
These hooks are invoked via OpenAPI Generator's `--enable-post-process-file` option. They are deliberately minimal and deterministic:
- Normalise line endings to LF and strip trailing whitespace.
- Preserve file mode 0644.
- Inject a deterministic banner for supported languages (TS/JS/Go/Java/C#/Python/Ruby) when enabled (default on).
- Language-specific rewrites (auth/retry/pagination/telemetry) will be added as SDKGEN-62-002 progresses.
## Usage
Set the generator's post-process command to this script (example for Bash):
```bash
export STELLA_SDK_POSTPROCESS="$PWD/postprocess/postprocess.sh"
export JAVA_OPTS="${JAVA_OPTS} -Dorg.openapitools.codegen.utils.postProcessFile=$STELLA_SDK_POSTPROCESS"
```
Or pass via CLI where supported:
```bash
--global-property "postProcessFile=$PWD/postprocess/postprocess.sh"
```
## Determinism
- Uses only POSIX tools (`sed`, `perl`) available in build containers.
- Does not reorder content; only whitespace/line-ending normalization.
- Safe to run multiple times (idempotent).
## Configuration (optional)
- `STELLA_POSTPROCESS_ADD_BANNER` (default `1`): when enabled, injects `Generated by StellaOps SDK generator — do not edit.` at the top of supported source files, idempotently.
- Future flags (placeholders until implemented): `STELLA_POSTPROCESS_ENABLE_AUTH`, `STELLA_POSTPROCESS_ENABLE_RETRY`, `STELLA_POSTPROCESS_ENABLE_PAGINATION`, `STELLA_POSTPROCESS_ENABLE_TELEMETRY`.
## Next steps
- Add language-specific post steps (auth helper injection, retry/pagination utilities, telemetry headers) behind flags per language template.
- Wire into CI to enforce post-processed trees are clean.