Skip to content

fix: 上游巡检允许已审查暂缓覆盖集合新增子技能 - #230

Open
yi-ge wants to merge 1 commit into
mainfrom
fix/upstream-health-new-skill-hold
Open

yi-ge wants to merge 1 commit into
mainfrom
fix/upstream-health-new-skill-hold

Conversation

@yi-ge

@yi-ge yi-ge commented Oct 28, 2026

Copy link
Copy Markdown
Member

Why

upstream-health-hold.json could only cover upstream-path-change and outdated. When the upstream head of a held collection adds children that children does not declare, the new-skill finding stays actionable even after maintainers have reviewed those children and decided not to declare them, so the tracking issue (#213) can never close. skills/marketingskills is in this state today: its two new upstream children were reviewed in the 2026-10-27 round (#227), but nothing can hold the finding.

What changes

  • new-skill is now a holdable status (HOLDABLE = ("upstream-path-change", "new-skill", "outdated")).
  • A hold that lists new-skill also checks the undeclared children:
    • the set of undeclared child paths at branch head must equal the set at the reviewed head; otherwise stale-hold: undeclared children changed since <head> (added …; removed …);
    • the staleness diff adds those undeclared child paths to the installed scope (declared children plus root LICENSE*/NOTICE*/COPYING*), so any change inside them gives stale-hold: upstream changed within the installed scope or undeclared children since <head>;
    • a network error while listing children at the reviewed head is unreachable, not a stale hold.
  • Holds without new-skill compare the same scope and keep every existing message. The only wording change for them is the validation error for an unholdable status, which now lists new-skill among the holdable statuses.
  • The discovery filter moves into undeclared_children(), which the new-skill finding and the hold check share, so both always agree on what is undeclared.
  • The checker docstring, the tracking-issue guidance in .github/workflows/upstream-health.yml, README.md and README.zh-CN.md describe the extended hold.

Tests

New cases in scripts/catalog/test_check_upstream_health.py:

  • a valid new-skill hold is reported as held, and stays held after an unrelated upstream change;
  • a newly added undeclared child, and later the removal of the reviewed ones, make the hold stale;
  • a content change inside a held undeclared child makes the hold stale;
  • an outdated-only hold on a collection still ignores changes to undeclared children (existing behaviour);
  • a network error while listing children at the reviewed head stays unreachable.

The validation test now accepts new-skill and still rejects broken, unreachable, unpinned, held, stale-hold and ok.

Validation

  • scripts/i18n/test_validate_i18n.py: 19 tests pass.
  • scripts/catalog/test_validate_catalog_metadata.py: 51 tests pass.
  • scripts/catalog/test_collection_generator.py: 10 tests pass.
  • scripts/catalog/test_check_upstream_health.py: 47 tests pass (5 new).
  • validate_catalog_metadata.py --require-complete and validate-i18n.py: 0 errors, 103 existing warnings. translate.py --check, actionlint and git diff --check are clean.
  • Live run on marketingskills (entry and hold as on main, in a scratch copy, not committed):
    • with new-skill added to the 2026-10-27 hold, the result is stale-hold, because upstream has since moved from 17772c7 to 0cd9b3a and changed declared children. The same hold without new-skill is also stale, so this is not caused by the new check. The two undeclared children are unchanged between those heads.
    • with the reviewed head set to a commit whose tree equals the current head, new-skill and outdated are both held and the summary reports actionable: false.

Follow-up

After this lands, the marketingskills hold can add new-skill to its statuses. Its reviewed head needs a fresh review first, because upstream has changed declared children since 17772c7.

The pre-publication sensitive-token scan was run privately by the maintainer and passed.

Refs #213.

A held collection whose upstream head adds undeclared children kept a `new-skill` finding that no hold could cover, so the tracking issue stayed open even after maintainers had reviewed those children and decided not to declare them. `upstream-health-hold.json` may now list `new-skill` as well.

A `new-skill` hold applies only while the undeclared child paths at branch head are the same set as at the reviewed head and those directories are unchanged since then. The staleness diff therefore adds the undeclared child paths found at head to the installed scope (declared children plus root license files). A different set reports `stale-hold` with the added and removed paths; a content change reports that upstream changed within the installed scope or undeclared children. A network error while listing children at the reviewed head stays `unreachable`. Holds that do not list `new-skill` compare the same scope with the same messages as before; only the validation message for an unholdable status now names `new-skill` among the holdable ones.

The checker docstring, the tracking-issue guidance in the workflow and both READMEs describe the extended hold.

Validation: 47 upstream-health (5 new), 10 collection-generator, 51 catalog-metadata and 19 i18n tests pass. Catalog metadata and i18n (0 errors, 103 existing warnings), translation-freshness, actionlint and `git diff --check` are clean. A live run on marketingskills with a temporary hold listing `outdated` and `new-skill`, reviewed at a commit whose tree equals the current head, reports both findings as `held` with `actionable: false`; that hold is not committed.

Refs #213.
@github-actions
github-actions Bot requested a balanced review from Copilot October 28, 2026 03:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants