بنقرة واحدة
upstream-sync
// Sync upstream changes for a package and open a PR. Pass a package name as the first argument (e.g. model-registry or notebooks) or be prompted to choose. Optionally pass a PR URL to do a temporary test sync.
// Sync upstream changes for a package and open a PR. Pass a package name as the first argument (e.g. model-registry or notebooks) or be prompted to choose. Optionally pass a PR URL to do a temporary test sync.
Evaluates code changes in a PR against the acceptance criteria of a Jira issue. Given a Jira issue key, determines whether each criterion is satisfied, partially satisfied, or missed. Use when asked to evaluate a PR against a Jira issue, check acceptance criteria, or verify implementation completeness.
Builds and deploys the gen-ai sidecar container to a personal OpenShift cluster for testing. Handles frontend build, Go BFF cross-compile, Podman image build/push to quay.io, and deployment patching. Supports both initial deploy and fast iteration (rebuild + pod delete). Use when the user wants to test local gen-ai changes on a real (dev) cluster.
Assign a scrum team label to issues based on area-to-scrum mapping and team keyword associations, producing ADD_LABEL operations in the standard triage format.
Fetch Jira issues by filter criteria, define structured triage operations, and bulk-apply them. Full Triage mode orchestrates all analysis skills on New issues end-to-end.
Validate and assign dashboard-area-* labels on Jira issues using multi-signal analysis. Tag mode assigns missing labels; Validate mode audits existing labels for correctness.
Pre-merge readiness check for a PR or local branch. Gathers context, runs reviews and checks, reports a results table. Interactive by default — asks what to review and whether to fix. Supports flags: --fix, --local, --review X,Y, --skip-review X,Y, --ci, --help.
| name | upstream-sync |
| description | Sync upstream changes for a package and open a PR. Pass a package name as the first argument (e.g. model-registry or notebooks) or be prompted to choose. Optionally pass a PR URL to do a temporary test sync. |
Sync upstream changes for a package and open a PR.
This command orchestrates the entire sync process: branch creation, running the update-subtree script, resolving conflicts, running tests, and opening a PR.
$ARGUMENTS — Optional. Can be:
model-registry, notebooks) — runs a normal sync for that packagemodel-registry https://github.com/kubeflow/model-registry/pull/1234) — runs a PR test synchttps://github.com/kubeflow/model-registry/pull/1234) — infers the package from the URL's repoPackages with upstream subtrees have a subtree field in their package.json under packages/<name>/package.json.
<package-name>.subtree.repo field in each package's package.json.subtree config:
grep -rl '"subtree"' packages/*/package.json | sed 's|packages/||;s|/package.json||'
Present the list to the user and ask which package to sync.Once the package is identified, read packages/<package-name>/package.json to get the subtree config. Extract the upstream GitHub <owner>/<repo> from the subtree.repo URL.
If the user passes a PR URL as an argument (e.g. /upstream-sync model-registry https://github.com/kubeflow/model-registry/pull/1234), this is a temporary test sync to validate an upstream PR's changes in odh-dashboard before the upstream PR merges. The differences from a normal sync are noted inline below with [PR Test Mode] markers.
First, check the current branch state:
git branch --show-current to get the current branch namegit status to check for uncommitted changes or unresolved conflictsIf on a <pkg>-sync-* or tmp-sync-pr-* branch:
--continueIf on main:
git pull to ensure main is up to date before starting the synctmp-sync-pr-<number> (extract the PR number from the URL)<pkg>-sync-YYYY-MM-DD (use today's date; <pkg> is a short prefix like mr for model-registry, nb for notebooks, etc.)git branch --list <branch-name>
<branch-name>-2 (or find next available suffix)git checkout -b <branch-name>If on any other branch:
Run the update-subtree script from the packages/<package-name> directory:
cd packages/<package-name> && npm run update-subtree
[PR Test Mode] Pass the --pr flag with the PR URL:
cd packages/<package-name> && npm run update-subtree -- --pr=<pr-url>
Or if continuing after conflict resolution:
cd packages/<package-name> && npm run update-subtree -- --continue
Parse the output to detect:
When conflicts are detected:
Identify conflicting files: Run git status and look for files under "Unmerged paths"
Record conflict info for later use in PR description:
For each conflicting file:
<<<<<<<, =======, >>>>>>>)After resolution:
git add <file1> <file2> ...cd packages/<package-name> && npm run update-subtree -- --continueAfter the sync completes successfully, run lint and tests. Check which scripts are available in the package's upstream frontend:
cd packages/<package-name>/upstream/frontend && cat package.json | grep -E '"test:|"type-check'
Step 1: Lint (required before creating a PR)
Run lint first — CI will reject the PR if this fails:
cd packages/<package-name>/upstream/frontend && npm run test:lint
If lint fails, try auto-fixing:
cd packages/<package-name>/upstream/frontend && npm run test:fix
After auto-fix, re-run test:lint to confirm all issues are resolved. If issues remain that can't be auto-fixed, fix them manually. Stage and commit any lint fixes:
git add packages/<package-name> && git commit -m "Fix lint issues from upstream sync"
Step 2: Unit tests
cd packages/<package-name>/upstream/frontend && npm run test:unit
Step 3: Type check
cd packages/<package-name>/upstream/frontend && npm run test:type-check
Report results to the user. If there are failures, let the user decide how to proceed.
Ask the user if they're ready to open a PR. If not, exit gracefully.
Extract PR information:
Get all sync commits since main:
git log main..HEAD --oneline
Extract PR numbers from commit messages - look for patterns like (#XXXX) in messages that contain "Update @odh-dashboard/:"
Filter to only include commits with actual file changes (exclude commits that say "tracking" or "no file changes")
Get the upstream commit SHA from the latest sync commit or from packages/<package-name>/package.json
Build PR content:
First, read the PR template at .github/pull_request_template.md to get the current structure and "Request review criteria" checklist. The PR body should follow this template's structure.
[Normal Mode] Title format:
Sync from <owner>/<repo> <7-char-sha>
[PR Test Mode] Title format:
[DO NOT MERGE] Test sync for <owner>/<repo>#<pr-number>
Body sections (following the PR template structure):
[PR Test Mode] Description section:
## Description
**This is a temporary test sync and should not be merged.**
This PR syncs the changes from [<owner>/<repo>#<pr-number>](https://github.com/<owner>/<repo>/pull/<pr-number>) into odh-dashboard so they can be tested before the upstream PR merges. The branch is available for local testing or CI validation.
Then include the "Conflicts Resolved" subsection (if any), "How Has This Been Tested?", "Test Impact", and "Request review criteria" sections as normal.
[Normal Mode] Description section:
## Description
Sync to pull in changes from:
* https://github.com/<owner>/<repo>/pull/<PR1>
* https://github.com/<owner>/<repo>/pull/<PR2>
...
### Conflicts Resolved
The following conflicts were resolved during this sync:
**[#<PR> - <title>](https://github.com/<owner>/<repo>/pull/<PR>)**
- `<file path>`
- `<file path>`
*Nature of conflict:* <Brief explanation of what caused the conflict - e.g., import path differences, overlapping code changes, etc.>
*Resolution:* <Brief explanation of how the conflict was resolved - e.g., kept both features, maintained downstream conventions while adding upstream changes, etc.>
If there were no conflicts, omit the "Conflicts Resolved" subsection entirely.
How Has This Been Tested? section:
## How Has This Been Tested?
Tested by running the federated <package-name> package locally, verifying existing behavior in the files this diff touches, and verifying the incoming changes.
Also ran available test scripts in `packages/<package-name>/upstream/frontend`.
Test Impact section:
## Test Impact
Upstream changes include their own tests.
Request review criteria section:
Copy the "Request review criteria" section exactly as it appears in .github/pull_request_template.md, including all checklist items. It is not hard-coded here, read it from the template file to ensure it stays current.
Push and create PR:
git remote get-url upstream to extract <upstream-owner>/<upstream-repo>git remote get-url origin to extract <fork-owner>git push -u origin <branch-name>gh pr create --repo <upstream-owner>/<upstream-repo> --head <fork-owner>:<branch-name> --base main --title "<title>" --body "<body>"
tmp-sync-pr-): immediately close the PR after creating it, since it exists only to share the branch and trigger CI:
gh pr close <pr-number> --repo <upstream-owner>/<upstream-repo>
Do NOT close the PR in normal mode. Normal sync PRs are meant to be reviewed and merged.