Repository navigation
Add a main (tip) mode to the Skia upstream sync - #4254
Conversation
Introduce an UPSTREAM_REF concept so the sync can merge from the very tip of upstream Skia (google/skia main HEAD) instead of only chrome/m<N> milestone branches. - skia-sync-detect.sh: accept --mode main; resolve UPSTREAM_REF (main vs chrome/m<TARGET>); for main mode use a distinct head branch skia-sync/main so it never collides with the current milestone sync; emit upstream_ref; gate on the resolved upstream ref. main mode is not a version bump (target==current). - auto-skia-sync.md: add main to the dispatch mode options, surface upstream_ref as a pre-activation output and in skia-sync-env.sh, fetch the resolved upstream ref in Phase 1, and document the tip/bleeding-edge semantics. - skia-sync-push-prs.sh: make PR titles/bodies UPSTREAM_REF-aware (tip vs milestone), defaulting to chrome/m<TARGET> for backward compat. - Recompiled the lock (0 errors). Co-authored-by: Copilot <[email protected]>
📦 Try the packages from this PRWarning Do not run these scripts without first reviewing the code in this PR. Step 1 — Download the packages bash / macOS / Linux: curl -fsSL https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.sh | bash -s -- 4254PowerShell / Windows: iex "& { $(irm https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.ps1) } 4254"Step 2 — Add the local NuGet source dotnet nuget add source ~/.skiasharp/hives/pr-4254/packages --name skiasharp-pr-4254More options
Or download manually from Azure Pipelines — look for the Remove the source when you're done: dotnet nuget remove source skiasharp-pr-4254 |
|
📖 Documentation Preview The documentation for this PR has been deployed and is available at: 🔗 View Staging Site This preview will be updated automatically when you push new commits to this PR. This comment is automatically updated by the documentation staging workflow. |
There was a problem hiding this comment.
Pull request overview
Adds a new dispatch-only main (“tip”) mode to the Skia upstream sync automation so the workflow can merge directly from google/skia’s main HEAD (bleeding edge) while keeping the target milestone unchanged (i.e., not a version bump). This extends the existing milestone-based modes (current/next/latest/explicit milestone) by introducing a generalized upstream_ref concept and making the agent prompt + PR creation logic upstream-ref aware.
Changes:
- Extend
skia-sync-detect.shto resolve bothTARGET(milestone) andUPSTREAM_REF(merge-from ref), includingmode=main→UPSTREAM_REF=main,HEAD_BRANCH=skia-sync/main, and emittingupstream_refas a workflow output. - Update the
auto-skia-syncworkflow template and compiled lock to exposeupstream_refand guide the agent to fetch the resolved upstream ref (milestone branch ormaintip). - Make PR titles/bodies in
skia-sync-push-prs.shtip-aware viaUPSTREAM_REF(fallback tochrome/m${TARGET}for backward compatibility).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
.github/workflows/auto-skia-sync.md |
Adds main dispatch option, surfaces upstream_ref output, and updates prompt/env heredoc to fetch/record the upstream ref. |
.github/workflows/auto-skia-sync.lock.yml |
Regenerated lock to reflect the new dispatch option and upstream_ref plumbing. |
.github/scripts/skia-sync-push-prs.sh |
Introduces UPSTREAM_REF (with backward-compatible default) and adjusts PR titles/bodies for tip vs milestone syncs. |
.github/scripts/skia-sync-detect.sh |
Generalizes merge-from ref selection via UPSTREAM_REF, adds main mode behavior, and emits upstream_ref output used by the workflow/prompt. |
…ne skill, honest run signal (#4258) Harden Skia upstream-sync: conflict policy, durable gn args, standalone skill, honest run signal (#4258) Follow-up to the mode=main tip work (#4254) and release-line targeting (#4239). The first real tip runs exposed three rough edges in the auto-skia-sync automation, plus that key Skia-update knowledge lived only in the workflow prompt where the update-skia skill couldn't reach it. ~~ Verify-upstream-or-reapply conflict resolution ~~ A tip merge runs ~291 commits ahead of our submodule base and conflicts on every file carrying an [M1xx] fork cherry-pick. The old "keep ours / resolve what you reasonably can" guidance risked silently dropping a not-yet- upstreamed patch (--theirs) or freezing a stale form of one upstream had since refined (--ours; e.g. our SDF-LCD patch used getMaxScale() while upstream relanded it as sk_ieee_float_divide(1.f, getMinScale())). Replace it with an explicit, auditable policy: classify each fork patch on a conflicted file as upstreamed (take upstream's form, record the SHA) or not upstreamed (re-apply ours on top) -- never a blanket --theirs/--ours, never a silent drop. A mandatory before-merge fork-patch snapshot is cross-checked so every patch lands in the resolution table as upstreamed or re-applied; a patch that is neither is a lost patch -> stop and fix. Applied across gotcha #15, SKILL.md Phase 5, and the workflow tip note. ~~ Allow a required new gn arg through build.cake ~~ The tip build needed skia_use_partition_alloc=false because upstream now defaults it to is_clang while our DEPS deliberately omits partition_alloc; Skia ships an official zero-overhead noop raw_ptr for exactly this case, so =false is the supported embedder path, not a hack. The rule banned all build.cake edits, forcing a one-off --gnArgs CLI flag and leaving durable config non-durable. Split the rule into two tiers: still forbid changing compiler/linker flags (or scripts/infra/native/**) to silence a host build error, but allow adding a genuinely required new upstream gn arg to the affected platforms' native/**/build.cake gn-args lists, flagged in both PR summaries for cross- platform review. Sequencing is honored: the toggle doesn't exist in m150, so the relaxed rule lets the next milestone merge add it in-context rather than breaking the current build. Recommendation for the eventual bump (gotcha #23): keep partition_alloc disabled via the supported noop, not by vendoring the Chromium allocator. ~~ Make the skill standalone; reduce the workflow to CI overrides ~~ main/tip mode and the required-new-gn-arg rule were documented only in the workflow prompt, so the update-skia skill couldn't drive them locally. Move both into the skill: tip mode becomes a first-class third option in Phase 1 (new {UPSTREAM_REF} variable, merge-base..upstream/main milestone diffs, generalized Phase 5 merge command), and the gn-arg rule lands in Phase 7 backed by gotcha #23. Trim the workflow's duplicated build.cake/mode prose to short pointers, keeping only genuinely CI-specific guardrails (can't apt- install in the sandbox; a missing host dep is a workflow bug, not a flag hack; Linux-only-build cross-platform review). These are prompt-body edits, so the lock stays byte-identical. ~~ Stop mislabeling a real sync as a no-op ~~ A sync that merged upstream, built, tested, and opened both PRs was reported by the gh-aw conclusion job as a no-op, which then failed trying to file a no-op issue (the workflow has no issues: write). Cause: safe-outputs staged mode blocks the agent from creating anything directly -- the real PRs are opened by the host post-step skia-sync-push-prs.sh with the autobump token -- so noop was the agent's only completion signal and every run, real or not, signalled noop. Give the agent an honest signal: declare create-pull-request in safe-outputs, kept staged (preview-only; the safe_outputs job is ubuntu-slim with permissions:{} and never touches the workspace) so a real sync registers as a pull-request output, while real PRs still come only from the post-step. Set noop: report-as-issue: false so noop is reserved for genuine no-work runs and no longer files an uncreatable issue; drop the unused create_issue offer; and add a "Completion signal" section to the prompt. This is the one frontmatter edit in the PR, so auto-skia-sync.lock.yml is regenerated. Validated end-to-end by run 28269474099 (mode=main, real 2-commit merge): the agent emitted a staged create_pull_request, the conclusion logged no noop with no failed issue step, and the post-step still pushed skia-sync/main to both repos and updated the real PRs (#4263 + #269). Rebased on main to pick up the #4260 workflow rename (lock recompiled to a 0-diff) and confirm consistency with the #4267 support-status model. Co-authored-by: Matthew Leibowitz <[email protected]> Co-authored-by: Copilot <[email protected]>
Summary
Adds a new
main(tip) mode to theauto-skia-syncgh-aw workflow so we can sync from the very tip of upstream Skia (google/skiamainHEAD) instead of onlychrome/m<N>milestone branches. This is a bleeding-edge sync: it may include new APIs/binding changes (regenerated + built + tested as normal) but is NOT a version bump — the target milestone stays equal tomain's current milestone (no soname/nuget/milestone changes). It uses a distinct head branch (skia-sync/main) so it never collides with thecurrentmilestone sync branch.mainmode is dispatch-only — the cron schedule never selects it.Changes
.github/scripts/skia-sync-detect.sh—UPSTREAM_REFgeneralizationmainas a valid--mode.UPSTREAM_REFconcept (thegoogle/skiaref we merge from), resolved alongsideTARGET:--milestone N→chrome/m${N}(modeexplicit)mode=main→main(tip),TARGET=MAIN_MSmode=latest→chrome/m${LATEST}mode=current→chrome/m${MAIN_MS}next) →chrome/m${NEXT}mode=main, head branch isskia-sync/main(distinct fromskia-sync/m${TARGET});IS_RELEASE=false, basemain/skiasharp. Release-detection stays skipped becauseTARGET == MAIN_MS.current == target(not a bump).upstream_refoutput, and the--gateupstream lookup now uses${UPSTREAM_REF}instead of a hardcodedchrome/m${TARGET}..github/workflows/auto-skia-sync.mdmainto theworkflow_dispatchmodeoptions and explains it in the input description.upstream_refas apre-activationoutput, in the prompt header, and in theskia-sync-env.shheredoc the agent writes.${upstream_ref}(milestone branch ormaintip) instead of a hardcodedchrome/m${target}, with a note on tip-mode semantics. Recompiled the lock..github/scripts/skia-sync-push-prs.shUPSTREAM_REF(defaults tochrome/m${TARGET}for backward compat) and makes PR titles/bodies tip-aware:[skia-sync] Merge upstream Skia main (tip)[skia-sync] Merge upstream Skia main (tip)Validation
gh aw compile auto-skia-sync→ 0 errors (4 pre-existing warnings:storage.googleapis.comecosystem hint + 3 fixed cron times). Lock still pinsclaude-opus-4.7and reflects the new option/output. Model and native-build setup unchanged.shellcheck --severity=styleclean on all three scripts.skia-sync-detect.sh(fakedgh/git,GITHUB_REPOSITORY=mono/SkiaSharp,GITHUB_REF=main):current/next/latest/main/default/--milestone N/empty-milestone all resolve correctly; unknown-arg exits 2;mode=mainyieldsupstream_ref=main,head_branch=skia-sync/main,target==current==main's milestone; themaingate path proceeds (no skip).The
release-branchskill is out of scope.Co-authored-by: Copilot [email protected]