···1010[`templates/bogus`](https://github.com/vic/den/tree/main/templates/bogus)
1111</Aside>
12121313-The bogus template helps you create minimal bug reproductions. Use it when reporting issues or contributing fixes.
1313+This template helps you create minimal Den reproductions.
1414+1515+Use it for:
1616+1717+- Showcasing focused demos of how you are trying to use Den.
1818+- Reducing a problem to its minimum outside of your infra.
1919+- Sharing code that exposes an unknown bug.
2020+- Contributing bug fixes to Den core.
2121+2222+All PRs modifying this template are run by Den CI on the following
2323+Den versions: `PR_HEAD`, `main`, `latest`.
2424+2525+Feel free to send any PR even if you don't know if it is an
2626+actual bug or if you don't know the solution.
2727+2828+Just having an small, focused example can help Den maintainers a lot.
2929+We can together determine if there's something we need to fix in Den.
3030+3131+If you wish to contribute a fix, you are more than welcome,
3232+just mention you'd like to work on this at the PR.
3333+3434+<Aside title="AI Policy">
3535+We accept AI assisted contributions as long as they are clear and focused and don't introduce unrelated accidental complexity.
3636+3737+**All PR changes must be the absolute minimum required for showing/fixing bugs**
3838+</Aside>
14391540## Initialize
1641···4368 den.hosts.x86_64-linux.igloo.users.tux = { };
44694570 # set up the scenario
4646- den.aspects.igloo.nixos.something = true;
7171+ den.aspects.igloo.nixos.environment.sessionVariables.FOO = ["foo" "bar"];
47724873 # what you get
4949- expr = igloo.something;
7474+ expr = igloo.environment.sessionVariables.FOO;
5075 # what you expect
5151- expected = true;
7676+ expected = "foo:bar";
5277 }
5378 );
5479 };
···7196| `tuxHm` | `igloo.home-manager.users.tux` |
7297| `pinguHm` | `igloo.home-manager.users.pingu` |
7398| `funnyNames` | Resolves an aspect for class `"funny"` and collects `.names` |
7474-| `show` | `builtins.trace` helper for debugging |
9999+| `trace` | traces included aspect names |
100100+101101+If you want to see some examples, take a look at other bogus reports that are now part of Den repository at:
102102+103103+```console
104104+ls den/templates/ci/modules/features/deadbugs/*.nix
105105+```
7510676107## Run Tests
7710878109```console
110110+# From the bogus root
79111nix flake check
80112```
811138282-## Testing Against Different Den Versions
831148484-Edit `.github/workflows/test.yml` to test against multiple Den versions:
8585-8686-```yaml
8787-strategy:
8888- matrix:
8989- rev: ["main", "v1.0.0", "abc1234"]
115115+```console
116116+# From the Den root
117117+just bogus
90118```
911199292-This helps identify regressions — include `"main"` and any release tag or commit.
9393-94120## Contributing a Fix
951219696-If you're submitting a fix to Den, test against your local checkout:
122122+Edit Den `/nix` or `/modules` code and run:
9712398124```console
9999-cd <den-working-copy>
100100-nix flake check --override-input den . ./templates/bogus
125125+just bogus
101126```
127127+128128+When your changes to Den have fixed the bug, be sure to
129129+move `bug.nix` into the `templates/ci/modules/feautres/deadbugs/` directory, following naming conventions for both the file and test-suite name.
102130103131## What It Provides
104132···111139112140## Next Steps
113141114114-- Share your reproduction repo on [GitHub Discussions](https://github.com/vic/den/discussions)
115142- Read [Debug Configurations](/guides/debug/) for debugging techniques
116143- See the [CI Tests template](/tutorials/ci/) for Den's own comprehensive test suite
···160160161161 # Traces aspect.name as nested lists per includes. Composed with filterIncludes
162162 # so tombstones and substitutions are visible.
163163- trace = filterIncludes (
164164- { aspect, recurse, ... }:
165165- {
166166- trace = [ aspect.name ] ++ builtins.map (i: (recurse i).trace or [ ]) (aspect.includes or [ ]);
167167- }
168168- );
163163+ #
164164+ # trace.on takes a function to extract any value from aspect.
165165+ trace = {
166166+ __functor = _: trace.on (a: a.name or "<anon>");
167167+ on =
168168+ f:
169169+ filterIncludes (
170170+ { aspect, recurse, ... }:
171171+ {
172172+ trace = [ (f aspect) ] ++ builtins.map (i: (recurse i).trace or [ ]) (aspect.includes or [ ]);
173173+ }
174174+ );
175175+ };
169176170177in
171178{
+7-33
templates/bogus/README.md
···11-# Bug Reproduction den
22-33-READ: https://den.oeiuwq.com/tutorials/ci/
44-55-Use this small template to reproduce bugs in den.
66-77-Edit the `rev` list being tested at [`test.yml`](.github/workflows/test.yml), include `"main"` and any other release tag or commit sha you might want to test. This is useful for showing regressions.
88-99-Create a **minimal** bug reproduction at [`modules/bug.nix`](modules/bug.nix)
1010-1111-Each `denTest` is isolated from others so you can create as many
1212-as you want with same hosts and users.
1313-1414-Then run tests:
1515-1616-```shell
1717-nix flake check
1818-```
1919-2020-Running a single test with `nixpkgs#nix-unit` on PATH:
2121-2222-```shell
2323-# append any attrName to run just particular tests
2424-nix-unit --flake .#.tests.systems.x86_64-linux.system-agnostic
2525-```
11+# READ: https://den.oeiuwq.com/tutorials/bogus/
2622727-Please share a link to your reproduction repo, showing the CI step and the error at CI build.
2828-2929-## Fixing Den
33+Use this template for:
3043131-If you are contributing a bug-fix PR, you can use the following command to
3232-use your local den checkout.
55+- Showcasing focused demos of how you are trying to use Den.
66+- Reducing a problem to its minimum outside of your infra.
77+- Sharing code that exposes an unknown bug.
88+- Contributing bug fixes to Den core.
3393434-```shell
3535-nix-unit --override-input den <den-working-copy> --flake <your-bogus-repo>#.tests.systems.x86_64-linux.system-agnostic
3636-```
1010+ALL pull-requests are welcome, even those not having solutions.