Repository navigation
Conversation
TOML has no `null` literal, so the delete branch in `_deep_merge` (None pops the key) was unreachable from `.config/tend.toml`. A pre-pass swaps the sentinel string for None before the existing merge runs. Closes #439 Co-Authored-By: Claude <[email protected]>
tend-agent
approved these changes
May 13, 2026
This was referenced May 13, 2026
max-sixty
added a commit
that referenced
this pull request
May 14, 2026
## Summary Move `.config/tend.toml` → `.config/tend.yaml`. Alternative to the `"__TEND_DELETE__"` string sentinel landed in #451 — same goal (reach RFC 7396's null-deletes-key branch from user config), different mechanism. #439 has both for comparison. YAML has a native `null`, so the delete-key example becomes: ```yaml workflows: nightly: workflow_extra: on: schedule: null # drop the cron, keep workflow_dispatch ``` The parser is `ruamel.yaml` (YAML 1.2), not PyYAML — so the usual YAML 1.1 footguns don't bite the config surface: - Unquoted `on:` stays the string `"on"`, not boolean True. - Norway problem doesn't apply: `yes`/`no`/`on`/`off` stay strings; only `true`/`false` are booleans. ## Scope - `Config.load` reads `.config/tend.yaml` via ruamel.yaml's safe loader. - `tend init` auto-migrates a legacy `.config/tend.toml` (verifies parsed structures match via dict equality before swapping). `tend check` stays read-only and points users at `tend init` if only `.toml` is present. - Migrated `docs/tend.example.toml` → `docs/tend.example.yaml` with a new "delete a generated key with null" example. - Removed the `__TEND_DELETE__` sentinel + its three tests; added replacement tests for YAML-native `null` (top-level, nested, missing-key noop), unquoted `on:` round-trip as string, and Norway-problem strings (`NO`, `off`) surviving uncoerced. - `_apply_extras` uses `ruamel.yaml` with `typ="rt"` to preserve insertion-order on regen (safe mode sorts mapping keys, which would churn every diff). Flow-mode scalar dumper stays on `typ="safe"`. - Migrated every test, tend's own `.config/tend.yaml`, install-tend, review-reviewers, review-runs, running-tend, CLAUDE.md, README.md, action.yaml, TODO.md. `bot_name` scrapers in cross-repo lookups now use `yq '.bot_name // ""'` instead of sed. ## Tradeoffs vs the sentinel - (+) Native `null` instead of a magic string. - (+) Single config format aligned with the generated workflows. - (+) YAML 1.2 via ruamel.yaml — no Norway problem, no `on:` → True trap. - (−) Breaking change for every consumer: `.config/tend.toml` no longer parses; consumers must rename and translate. Auto-migration in `tend init` softens this — nightly regen handles it for free — but `tend check` invocations between bump and nightly hard-error with the migration hint. - (−) Extra runtime dep: `ruamel.yaml` (pure-Python, ~1.3 MB installed) replacing `pyyaml` (C-extension, ~750 KB installed). The sentinel approach (#451) keeps TOML and avoids both the breaking change and the new dep at the cost of a magic string in config. Pick your poison. ## Test plan - [x] `cd generator && uv run pytest` — 203 passed - [x] `pre-commit run --all-files` — all hooks pass - [x] `uv run python -m tend init` round-trips `.config/tend.yaml` into the existing `.github/workflows/` files (no diff outside pre-existing drift in tend-mention.yaml and the v0.0.17 → v0.0.18 header stamp from the release on main) - [x] Delete-key example in `docs/tend.example.yaml` produces the expected merged workflow — covered by `test_null_drops_top_level_key` - [x] Norway-problem strings survive — covered by `test_norway_problem_string_not_coerced` - [x] Auto-migration verifies parsed structures match before swapping — covered by `test_init_auto_migrates_legacy_toml`, `test_init_does_not_touch_yaml_when_both_exist`, `test_workflows_from_migrated_config_match_workflows_built_from_toml_dict` 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude <[email protected]> Co-authored-by: tend-agent <[email protected]>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds
"__TEND_DELETE__"as a sentinel for RFC 7396's null-deletes-key semantic, which was unreachable from TOML before. A pre-pass in_apply_extraswalksworkflow_extraand per-job overrides, swapping the sentinel forNonebefore the existing_deep_mergeruns — the delete branch then does the work.Motivating case: a scheduled workflow that should be
workflow_dispatch-only. The user can now drop juston.scheduleinstead of replacing the wholeon:block:Same shape covers the issue author's case (narrowing
on.issuesontend-mention) and any other generator-injected key.Lists are passed through unchanged — JSON Merge Patch doesn't define array element deletion, and the sentinel inherits that limitation.
A parallel PR exploring the alternative (switch the config format to YAML so
nullis native) will appear as a separate PR; #439 has both for comparison.Closes #439
Thanks to @jrdncstr for reporting in #439.