-
Notifications
You must be signed in to change notification settings - Fork 0
chore(config): gen-au-build + ctld-tools.exe + MM doc (CTLD-TOOLS-FINALIZE) #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| Status: ready | ||
|
|
||
| # PRD — CTLD-TOOLS-FINALIZE | ||
|
|
||
| > Finalisation du programme `ctld-tools` (voir [ADR 0009](../../dev/adr/0009-external-yaml-authoring-ctld-tools.md)), | ||
| > demandée par le maintainer après les lots 1–3. | ||
|
|
||
| ## Problem Statement | ||
|
|
||
| Three loose ends after `CTLD-TOOLS-USERCONFIG`: | ||
|
|
||
| 1. The engine-config workflow used **committed generated Lua + a drift check**. Editing the config | ||
| meant a manual `gen-config` step; forgetting it produced a CI round-trip. The maintainer prefers | ||
| the build to regenerate the Lua itself. | ||
| 2. `ctld-tools.exe` was wired into `release.yml` but **never actually built/tested**, and only as an | ||
| isolated best-effort step. | ||
| 3. The Mission Maker had no **dedicated documentation page** for `ctld-tools` — only a tip. | ||
|
|
||
| ## Solution | ||
|
|
||
| - **gen-au-build**: `merge_CTLD.ps1` regenerates `src/CTLD_config_defaults.lua` from | ||
| `CTLD_config.yaml` via `ctld-tools gen-config` on every build. The generated Lua is a git-ignored | ||
| artifact. Consumers that need it (build, busted loader, release) generate it; a `conftest.py` | ||
| fixture does so for the Python tests. The drift check is dropped. | ||
| - **`ctld-tools.exe`**: built and verified (PyInstaller with lupa + the datamine bundled), and | ||
| attached to each Release by a **separate `build-exe` job** so a packaging failure never blocks the | ||
| `CTLD.lua` release. | ||
| - **Docs**: a dedicated bilingual `mission-maker/ctld-tools.md` page, detailed with examples. | ||
|
|
||
| ## Implementation Decisions | ||
|
|
||
| - `merge_CTLD.ps1` calls `poetry run ctld-tools gen-config` before merging; aborts with a clear | ||
| message if poetry is missing. The build (and the busted job) therefore require Python + poetry. | ||
| - `ci.yml` `build` (Windows) and `busted` (Ubuntu) jobs, and `release.yml`, add `setup-python` + | ||
| `poetry install --without dev --without build`; busted also runs `gen-config` before the suite. | ||
| - `src/CTLD_config_defaults.lua` removed from git tracking and added to `.gitignore`. | ||
| - `release.yml` gains a `build-exe` job (`needs: release`, `windows-latest`): PyInstaller `--onefile | ||
| --collect-all lupa --add-data dcs_types.json`, then `gh release upload`. | ||
| - ADR 0009 and the developer build docs updated to describe gen-au-build (superseding committed+drift). | ||
|
|
||
| ## Testing Decisions | ||
|
|
||
| - A `conftest.py` session fixture regenerates `CTLD_config_defaults.lua` from the YAML before the | ||
| Python tests, so the parity/reference/e2e tests keep working without a committed file. The drift | ||
| test (`test_committed_generated_lua_is_up_to_date`) is removed. | ||
| - The `.exe` build was validated locally: `scaffold` + `validate` run from the packaged exe (proving | ||
| lupa and the embedded `dcs_types.json` work). The `build-exe` CI job re-verifies on each release. | ||
| - The `busted` job proves the loader still loads the freshly-generated defaults. | ||
|
|
||
| ## Out of Scope | ||
|
|
||
| - `.miz` injection, TUI (roadmap). | ||
| - Any change to the `user-config.yaml` schema or the runtime API. | ||
|
|
||
| ## Further Notes | ||
|
|
||
| - Closes the `ctld-tools` program. Remaining roadmap items: `.miz` injection, interactive TUI. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (performance): Consider caching Poetry and the virtualenv to avoid re-installing dependencies on every workflow run.
Given
ctld-toolslikely has non-trivial dependencies, this will add avoidable time and PyPI traffic on every run. You can cache the Poetry environment (e.g..venvor~/.cache/pypoetry) withactions/cache, and reuse the same pattern in CI so builds stay faster and more consistent across workflows.