Skip to content

ci(sync): add reactive sync-models workflow - #97

Open
gsmith85 wants to merge 8 commits into
mainfrom
feat/reactive-sync-models
Open

gsmith85 wants to merge 8 commits into
mainfrom
feat/reactive-sync-models

Conversation

@gsmith85

@gsmith85 gsmith85 commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Adds sync-models.yml using a two-job prepare -> sync matrix triggered by repository_dispatch (ucp-schemas-updated), daily scheduled reconciliation across main and active release/YYYY-MM-DD (>= 2026-08-25) branches, and manual workflow_dispatch with per-ref concurrency and job timeouts.
  • Enforces blobless full-history upstream commit existence and branch ancestry checks, open-PR-gated rolling-branch monotonicity, SHA256-verified ucp-schema installation, repository pre-commit Prettier normalization, lockfile-only PR suppression (plus stale rolling PR auto-closure when models return to matching the base branch), and full build + unit test verification prior to opening or updating Stage 1 PRs via ucp-automation[bot].
  • Files branch-scoped release-cut-needed and codegen-sync-failure issues via GITHUB_TOKEN, skipping duplicate comments when an open issue already references the target commit SHA.

Refs Universal-Commerce-Protocol/ucp#909

@damaz91 damaz91 added the status:needs-triage Signal that the PR is ready for human triage label Nov 5, 2026
@gsmith85
gsmith85 requested review from damaz91 and jingyli November 18, 2026 07:34
@damaz91 damaz91 added status:under-review and removed status:needs-triage Signal that the PR is ready for human triage labels Nov 18, 2026

@damaz91 damaz91 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.

Thanks for putting this together, @gsmith85! Overall the workflow design, action permissions, binary checksum verification, and ucp-automation[bot] commit attribution look solid.

A quick note on current check status and sequencing:

  • Tests / Committed models match regeneration: failing only because this branch is based on 3a86b3a (prior to #95 merging on main). Rebasing onto main will clear it.
  • Lockfile & CLI flags dependency: ./generate_models.sh ... --channel --ref --write-lock and ucp-lock.json depend on the feat/ucp-lock-and-draft-channel changes landing (while the ! -f ucp-lock.json check safely skips runs in the meantime).

Left a few inline comments on rolling pull request diff/open-state handling, Prettier normalization parity with repository hooks, and branch-scoped failure issue deduplication.

Comment thread .github/workflows/sync-models.yml Resolved
Comment thread .github/workflows/sync-models.yml Resolved
Comment thread .github/workflows/sync-models.yml Resolved
Comment thread .github/workflows/sync-models.yml Resolved
Comment thread .github/workflows/sync-models.yml Resolved
Comment thread .github/workflows/sync-models.yml Resolved
Comment thread .github/workflows/sync-models.yml Resolved
@gsmith85
gsmith85 force-pushed the feat/reactive-sync-models branch from b1830b5 to edb5682 Compare November 18, 2026 22:38
@gsmith85
gsmith85 force-pushed the feat/reactive-sync-models branch from 1168ede to 7bdb7df Compare November 19, 2026 05:00

@damaz91 damaz91 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.

LGTM! Thanks for addressing all the review feedback, @gsmith85—the multi-branch schedule matrix, open-pull-request and rolling ancestry guards, pre-commit Prettier parity, token isolation, and branch-scoped issue deduplication all look clean, and #98 has landed on main.

Left one optional, non-blocking nit inline that can be handled in a follow-up if needed.

Comment on lines +130 to +134
if [[ "$TARGET_BRANCH" != "main" ]] && ! git show-ref --verify --quiet "refs/remotes/origin/${TARGET_BRANCH}"; then
UPSTREAM_SHA="${REQUESTED_SHA:-$(git ls-remote https://github.com/Universal-Commerce-Protocol/ucp.git "refs/heads/${UCP_REF}" | awk '{print $1}')}"
printf '%s\n' "ISSUE_KIND=release-cut-needed" "NEW_SHA=${UPSTREAM_SHA:-unknown}" >> "$GITHUB_ENV"
exit 0
fi

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.

Optional, non-blocking nit (fine for a follow-up):

  1. Passing --exit-code to git ls-remote here (and asserting [[ "$UPSTREAM_SHA" =~ ^[0-9a-f]{40}$ ]], matching Universal-Commerce-Protocol/python-sdk#107) prevents a mistyped workflow_dispatch release/YYYY-MM-DD date that does not exist upstream in ucp from exiting 0 with NEW_SHA=unknown and opening a false-positive release-cut-needed issue.
  2. Checking [[ -z "$REQUESTED_SHA" || "$REQUESTED_SHA" =~ ^[0-9a-f]{40}$ ]] near the top of the step ensures REQUESTED_SHA is validated before lines 132 and 150 write NEW_SHA to $GITHUB_ENV.

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants