check-upstream-version-task: structured multi-key JSON state - #169
Merged
Conversation
The canonical upstream-version tracker serialized only a single bare string
(resolver printed one line; state file written raw), so a wrapper pinning more
than one upstream component could not converge on it and kept a bespoke tracker.
Make the resolver print a JSON object of name -> version and write it as the
canonical (sorted, pretty) state file: one key for the common single-version
case ({"version":"X"}) or N keys for a multi-component wrapper, each read by the
build by key. This also makes the upstream-version.json extension honest. The
bump PR title/body now name only the keys that actually moved, diffed against
the prior state. Update the AGENTS.md wrapper-repo description to match.
Also swap the todo-tree workspace extension for fanaticpythoner.better-todo-tree.
Closes#168
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>Contributor
There was a problem hiding this comment.
Pull request overview
Updates the upstream-version tracking reusable workflow to support wrapper repos that need to pin multiple upstream components by moving from a single string state to a structured JSON object, and aligns documentation/workspace defaults with that new contract.
Changes:
- Switch
.github/workflows/check-upstream-version-task.ymlto accept resolver output as a JSON object (name -> version), normalize it, and generate PR title/body from per-key diffs. - Document the new multi-key JSON state contract in
AGENTS.md. - Update
DotNet.code-workspaceextension recommendations (swap TODO-tree extension).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
DotNet.code-workspace | Replaces the TODO tree extension recommendation. |
AGENTS.md | Updates wrapper-repo guidance to the new JSON name -> version state contract. |
.github/workflows/check-upstream-version-task.yml | Implements structured JSON state parsing/normalization and changed-key PR title/body composition. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Require the resolver object to be non-empty with all-string values so malformed output fails fast instead of committing state the build cannot consume. Diff across the union of old+new keys so a removed key is reported (carries null); title a key-less reserialization as a canonicalize-only change rather than an empty "Update upstream versions: ". Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Uh oh!
There was an error while loading. Please reload this page.
A state file that was valid JSON but not an object (string/array/number) passed
the existing-file guard and then broke the `$old + $new` union diff. Accept the
prior state only when it parses as an object; otherwise diff against `{}`.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
A version string carrying an embedded newline would corrupt the single-line title=/body GITHUB_OUTPUT, so require keys and values to be single-line. Also correct the state-write comment: a differently-formatted-but-identical prior file does change and opens a canonicalize-only PR. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Jun 21, 2026
Closed
ptr727 added a commit
to ptr727/ESPHome-NonRoot
that referenced
this pull request
Jun 21, 2026
* Adopt canonical upstream-version tracker for multi-key state Replace the bespoke check-esphome-version.yml with the carried check-upstream-version-task.yml plus a thin scheduled entry-point (check-upstream-version.yml) whose resolver prints the esphome and device-builder versions as a JSON object. Rename the state file esphome-version.json -> upstream-version.json (keyed esphome and device_builder, sorted JSON) and point build-docker-task.yml, the merge-bot refs (upstream-version-<base>), and the PR paths-filter at it. Converges on ptr727/ProjectTemplate#169, which added structured multi-key state to the canonical task per the gap filed in #168. Closes#66. * Write upstream-version state file as CRLF per template fix Re-sync the carried check-upstream-version-task.yml to write the state file as CRLF (jq emits LF), honoring .editorconfig's .json rule, and convert upstream-version.json to CRLF to match. Converges on ptr727/ProjectTemplate#172, which resolved the LF-vs-CRLF state-file nuance filed in #170. * Harden upstream resolver curl error reporting Add --show-error/--location to the PyPI curl calls and emit ::error:: annotations on resolve failure, so a failed scheduled run surfaces a clear cause. Addresses Copilot review feedback on PR #67. * Use product names in resolver errors and tracker wording Reference ESPHome and esphome-device-builder (the PyPI/product names) in the resolve-failure messages, and update the remaining "ESPHome-version bump" mention in AGENTS.md to "upstream-version bump". Addresses Copilot review feedback on PR #67.
ptr727 added a commit
that referenced
this pull request
Jun 22, 2026
… quota (#180) Promote accumulated `develop` work to `main` so derived repos can re-sync from `main` (the stable ref) rather than tracking `develop`. Docs / CI / config only — no `version.json` bump (no functional change). ## Notable contents - **Consolidate code style + carry contract** (#178, closes#175): one root `CODESTYLE.md` (General → .NET → Python, droppable sections); `PyPiLibrary/CODESTYLE.md` removed; `CODESTYLE.md` + `.vscode/tasks.json` added to the verbatim-carry list; official-tooling casing (`.Net*` → `.NET*`); clean-compile rule; brownfield/suppression scope hierarchy; `dependsOrder: sequence` on the `.NET Format` task. - **Clarify project-rule home + harden Copilot runbook** (#173): project conventions/API contracts live in `AGENTS.md`, not `.github/copilot-instructions.md`; a no-inline-comment review is a clean pass; poll for the auto-review before self-triggering. - **Cut Actions artifact-storage quota usage** (#179): PR smoke builds no longer upload artifacts nothing consumes. - Plus prior develop work: docs/comment cleanup (#167), `check-upstream-version-task` structured multi-key state (#169) + CRLF state file (#172), `publish-docker-readme-task`, and routine codegen updates. ## Notes - develop → main is **merge-commit only** (preserves develop's commit list as a second-parent reference on `main`). - Merging closes#173 and #175 (their `Closes` keywords reach the default branch). - After merge, the downstream re-sync issues (each updated with the current state) can point at `main`.
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 freeto 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.
Closes#168.
Raised by
ptr727/ESPHome-NonRootwhile re-syncing from #167: the canonicalcheck-upstream-version-task.ymlserialized only a single bare-string version, so a wrapper pinning several upstream components (ESPHome-NonRoot pins bothesphomeand the device-builder) could not converge on it and kept a bespoke tracker.Change
name -> version; the task normalizes it (sorted keys, pretty) and writes it as the canonical state file. One key for the common single-version case ({"version":"X"}) or N keys for a multi-component wrapper, each read by the build by key. This also makes theupstream-version.jsonextension honest.versioncase still rendersUpdate upstream version to X; multi-key rendersUpdate upstream versions: esphome to 2026.7.0plus a per-component body list.AGENTS.mdwrapper-repo description updated to the JSONname -> versioncontract.gruntfuggly.todo-treeforfanaticpythoner.better-todo-treeinDotNet.code-workspace(bundled per request).The merge-bot keys only on branch refs (
upstream-version-<base>), so it needs no change.Validation
Ran the resolve/compose logic locally across single-key first-run, multi-key first-run, partial move (one of two changed), no-change (empty diff → no PR), and malformed output (rejected). YAML validated.
🤖 Generated with Claude Code