-
Notifications
You must be signed in to change notification settings - Fork 0
Import Rust template tooling #32
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
30 commits
Select commit
Hold shift + click to select a range
aa5569a
Document template agent workflow
leynos 60063ab
Import Rust template tooling
leynos 5b743a9
Record tooling import progress
leynos 2993b19
Record final template validation
leynos 3b94065
Record draft PR handoff
leynos ca44b42
Remove unsupported parent CI gates
leynos a16f3e2
Run parent template tests in CI
leynos 6bbe943
Fix pytest-copier CI template fixture
leynos 6ccafb8
Document pytest-copier fixture scope
leynos b57045a
Install CI template test dependencies
leynos 035d1cb
Pin workflow actions and clarify template tests
leynos da72c32
Restore generated test fallback coverage
leynos 2ee870f
Document binstall template placeholders
leynos 23a38b3
Clarify generated coverage linker policy
leynos 2648557
Update ExecPlan branch status note
leynos ed8a026
Fix AGENTS test log command example
leynos 2d2e8a8
Remove unsupported Windows ARM release target
leynos f4f7b43
Disable parent checkout credential persistence
leynos 4997428
Address template review check failures
leynos 4369d14
Harden generated template contracts
leynos 54b91a2
Test generated Whitaker fallback resolution
leynos 08d47ad
Tighten generated tooling contract tests
leynos 85f4c1d
Clarify Copier prompt meanings in user guide
leynos a436991
Harden generated tooling verification
leynos 9985d28
Document release workflow toolchain overrides
leynos 7388745
Clarify snapshot and lint test diagnostics
leynos 74e42d8
Tighten generated tooling review fixes
leynos 3e5ccf0
Format developer tooling names
leynos e5722cd
Share checkout step extraction in tests
leynos f788402
Split generated tooling contract assertions
leynos 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| # Agent Instructions | ||
|
|
||
| ## Repository Purpose | ||
|
|
||
| This repository is a Copier template for generating Rust projects. It is not | ||
| itself the generated Rust project. Files under `template/` are copied or | ||
| rendered into downstream projects, and files under `tests/` validate the | ||
| template output through `pytest-copier`. | ||
|
|
||
| When changing generated Rust project behaviour, update the template files and | ||
| the parent repository tests that prove the rendered output. Prefer assertions | ||
| against the generated project's public commands, such as `make all`, over | ||
| testing private implementation details in the parent repository. | ||
|
|
||
| ## Copier Test Dependencies | ||
|
|
||
| Template tests use `pytest` and `pytest-copier`. Install or run them through | ||
| `uv` so the parent repository does not need a manually managed virtual | ||
| environment. | ||
|
|
||
| See `docs/users-guide.md` for generated-project features and | ||
| `docs/developers-guide.md` for parent-template tooling requirements. | ||
|
|
||
| The repository Makefile exposes the expected entrypoint: | ||
|
|
||
| ```sh | ||
| make test | ||
| ``` | ||
|
|
||
| That target currently runs: | ||
|
|
||
| ```sh | ||
| uvx --with pytest-copier pytest tests/ | ||
| ``` | ||
|
|
||
| If tests import additional pytest plugins or assertion helpers, add them to | ||
| the `uvx --with ...` invocation or to the documented dependency list before | ||
| using them in tests. Do not rely on packages installed in an ambient shell | ||
| environment. | ||
|
|
||
| When debugging generated projects manually, render with Copier into a temporary | ||
| directory, then run the generated project's public gates from that rendered | ||
| directory. Keep build output in the rendered project or Cargo's default shared | ||
| cache; do not configure an isolated Cargo cache. | ||
|
|
||
| ## Validation | ||
|
|
||
| Run parent-template tests after changing `copier.yaml`, `template/`, or | ||
| `tests/`: | ||
|
|
||
| ```sh | ||
| make test | ||
| ``` | ||
|
|
||
| For long test runs, capture output with `tee` into `/tmp`, for example: | ||
|
|
||
| ```sh | ||
| make test 2>&1 | tee /tmp/test-agent-template-rust-$(git branch --show-current).out | ||
| ``` | ||
|
|
||
| Review the log before committing if the terminal output is truncated. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| # Developers Guide | ||
|
|
||
| This guide documents the tooling needed to work on the template itself. It is | ||
| separate from the generated-project guide because this parent repository runs | ||
| pytest-copier tests that render temporary Rust projects. | ||
|
|
||
| ## Parent Template Tests | ||
|
|
||
| Run the public parent gate: | ||
|
|
||
| ```sh | ||
| make test | ||
| ``` | ||
|
|
||
| The target uses `uvx --with pytest-copier --with pyyaml pytest tests/`, so | ||
| Python test dependencies must be added to that invocation before tests import | ||
| them. Keep long runs logged through `tee` into `/tmp`, following the example | ||
| in `AGENTS.md`. | ||
|
|
||
| The tests render both library and application projects, run generated public | ||
| gates such as `make all`, validate generated Makefiles with `mbake`, and parse | ||
| generated `Cargo.toml` files as TOML. | ||
|
|
||
| ## Required Tooling | ||
|
|
||
| The parent tests expect these tools to be available when validating generated | ||
| projects: | ||
|
|
||
| - `uv` for isolated Python test dependency execution. | ||
| - `pytest-copier` for rendering Copier templates in tests. | ||
| - `PyYAML` for parsing rendered GitHub Actions workflows in tests. | ||
| - `syrupy` for generated structured file snapshots in tests. | ||
| - Rust and Cargo through `rustup`. | ||
| - cargo-nextest for generated fast test execution in CI, while generated | ||
| Makefiles still fall back to `cargo test` for contributors. | ||
| - `mbake` for generated Makefile validation. | ||
| - `Whitaker` for generated lint gates. | ||
| - `clang`, `lld`, and `mold` for generated linker and coverage behaviour. | ||
|
|
||
| The generated project itself uses Cranelift for debug code generation, Linux | ||
| `mold` linking for development builds, and `lld` for coverage because coverage | ||
| is driven by LLVM tooling. | ||
|
|
||
| ## Design Notes | ||
|
|
||
| Keep generated-project behaviour in `template/` and prove it from parent tests | ||
| under `tests/`. Prefer assertions that render a real project and run public | ||
| generated commands over checks that only inspect template source text. | ||
|
|
||
| GitHub Actions in both parent and generated workflows are SHA-pinned. When an | ||
| action revision changes, update the rendered workflow assertions that lock the | ||
| pin. |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.