You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Always verify the branch matches the target version:
git fetch origin
git branch -a | grep "CDH-7.3.2"
git show origin/CDH-7.3.2.100:pom.xml | grep -E '<version>|<spark.version>'| head -5
Expected for 7.3.2.100:
3.5.4.7.3.2.100-SNAPSHOT
Expected for 7.3.2.10000:
3.5.8.7.3.2.10000-SNAPSHOT
Branch selection priority
When multiple branches could match:
Exact CDH-{version} (e.g. CDH-7.3.2.100 for version 7.3.2.100)
Wildcard CDH-{version}x only when that is the established line (e.g. 10000x for 7.3.2.10000)
Never assume .x umbrella branches without verifying pom.xml
Caveat:.x branches do not always match their POM suffix (e.g. CDH-7.3.2.x may carry 7.3.2.200-SNAPSHOT). Always check pom.xml on the target branch.
Known 7.3.2 mappings
Branch
POM CDP suffix
Role
cdh_main
7.3.2.20000-SNAPSHOT
Future trunk
CDH-7.3.2.10000x
7.3.2.10000-SNAPSHOT
Next release line after .100
CDH-7.3.2.100
7.3.2.100-SNAPSHOT
Specific build
CDH-7.3.2.x
7.3.2.200-SNAPSHOT
Integration line
DEX-DEPS-7.3.2-MAIN
7.3.2.0-SNAPSHOT
Baseline / deps
Lookup commands
# List branches for a release line
git branch -a | grep 'CDH-7.3.2'# Confirm POM suffix on a branch
git show origin/CDH-7.3.2.100:pom.xml | grep '<version>'| head -3
# Check if a remote branch exists
git ls-remote --heads origin 'CDH-7.3.2.100'
Feature branch naming for ports
When creating a branch for the port PR:
CDPD-<port-ticket>_CDH-<version>
Examples:
CDPD-111272_CDH-7.3.2.100
CDPD-110603_CDH-7.3.2.10000x
Base the feature branch on the target release branch, not on cdh_main.
Review the full diff at ~/git/int/spark3 on branch CDH-7.3.2.100 (git diff).
Summary:
- 3 files, +196 / -4 (clean cherry-pick)
- SQLConf.scala, ddl.scala, MsckRepairTableSuite.scala
- Conflicts: none
Always include a chat summary (files, stats, conflict status). Do not paste the full diff unless asked.
Phase 5b — Ask about tests
Would you like me to run tests?
(a) All tests — ./build/mvn test (slow)
(b) Relevant tests — ./build/mvn test -pl sql/hive \
-DwildcardSuites=org.apache.spark.sql.hive.execution.command.MsckRepairTableSuite
(c) Skip
Wait for the user's choice before running anything.
Phase 6 — Create Port Jira (if needed)
Only if no duplicate and change not already present:
Summary: [Port] CDPD-108116 to 7.3.2.100
fixVersions: 7.3.2.100
Port link: inward=CDPD-108116, outward=CDPD-<new>
Phase 7 — Push and PR (on confirmation)
git checkout -b CDPD-111272_CDH-7.3.2.100 origin/CDH-7.3.2.100
git cherry-pick <commit-sha>
git commit -m "$(cat <<'EOF'CDPD-108116: Skip redundant alterTable in MSCK REPAIR TABLE when already trackedPort of CDPD-108116 to 7.3.2.100.Port Jira: CDPD-111272EOF)"
git push -u origin CDPD-111272_CDH-7.3.2.100
gh pr create \
--repo CDH/spark3 \
--base CDH-7.3.2.100 \
--head CDPD-111272_CDH-7.3.2.100 \
--title "CDPD-108116: Skip redundant alterTable in MSCK REPAIR TABLE when already tracked"
Example 2: Existing Port Jira — stop early
Input
User: "Port CDPD-108116 to 7.3.2.100"
Assessment
Source Jira issuelinks include Port → CDPD-111272 with summary [Port] CDPD-108116 to 7.3.2.100.
Response
## Port assessment: CDPD-108116 → 7.3.2.100**Existing Port Jira:** CDPD-111272 — https://cloudera.atlassian.net/browse/CDPD-111272
A Port ticket for this source and target version already exists. No duplicate needed.
If you want to continue the backport on that ticket, say so and I will assess
whether the cherry-pick is already on CDH-7.3.2.100.
Do not create a new Port Jira. Do not commit or push unless user asks to continue on the existing ticket.
git checkout -B port-assess/CDPD-108116 origin/CDH-7.3.2.100
git cherry-pick -n abc1234
git status
# nothing to commit, working tree clean
Response
## Port assessment: CDPD-108116 → 7.3.2.100**Repo:** CDH/spark3
**Target branch:** CDH-7.3.2.100
### Already on branch?
Yes — commit abc1234 with message "CDPD-108116: Skip redundant alterTable..."
is already on origin/CDH-7.3.2.100.
### Recommended next step
No backport needed. I will not create a Port Jira unless you specifically request one.
Example 4: Cherry-pick conflicts — hand off
Input
User: "Port CDPD-108116 to 7.3.2.100"
Cherry-pick produces conflicts in sql/hive/src/main/scala/.../HiveExternalCatalog.scala.
Response
## Port assessment: CDPD-108116 → 7.3.2.100**Cherry-pick result:** conflicts
**Conflicts:**-`sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveExternalCatalog.scala`### Commands to apply manually
git fetch origin
git checkout -b CDPD-111272_CDH-7.3.2.100 origin/CDH-7.3.2.100
git cherry-pick <commit-sha>
# resolve conflicts in HiveExternalCatalog.scala
git add sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveExternalCatalog.scala
git cherry-pick --continue
When ready, ask me to create the Port Jira and open the PR.
Do not commit, push, or create Port Jira until user resolves conflicts and confirms.
Port to 7.3.2.10000 and port to 7.3.2.100 are separate tickets on separate branches. Always match the exact version string when checking for duplicates.
Outcome decision table
Existing Port Jira?
Change on branch?
Cherry-pick result
Action
Yes, same version
—
—
Report existing ticket, stop
No
Yes
—
Report already done, stop (no Port Jira)
No
No
Clean diff
Show diff, wait for confirmation
No
No
Conflicts
Hand off commands, stop
No
No
Clean diff + user confirms
Apply diff locally for review; then commit, push, PR
Port and backport CDPD fixes to CDP release branches: assess whether a cherry-pick is needed before creating a Port Jira, show uncommitted diffs for review, and only push or open a PR after explicit user confirmation. Use when the user mentions port Jira, backport, cherry-pick to a CDP version, [Port] CDPD-…, or landing a fix on a release branch like 7.3.2.100.
CDP Port Jira Backport
Assessment-first workflow for porting CDPD fixes to CDP release branches.
Hard guardrails
Never commit, push, or open a PR without explicit user confirmation after showing the diff.
Port commit subjects and PR titles use the source Jira key (e.g. CDPD-108116), not the Port ticket; put the Port ticket at the end of the commit body and in the PR body. Feature branch names still use the Port ticket.
Never create a Port Jira if the change is already on the target branch (unless user explicitly requests the ticket anyway).
Never create a duplicate Port Jira when one already exists for the same source + version.
Use throwaway worktrees only for read-only checks (already present? conflicts?). For user review, apply the cherry-pick in the local repo clone on the target branch, unstaged.
Tell the user the exact repo path and branch where the diff was applied. The local git diff is the full review surface; do not paste the entire diff in chat unless the user asks.
Still provide a brief chat summary: files changed, line counts, and especially any merge conflicts (file names and conflict regions). A summary complements the local diff; it does not replace it.
On throwaway worktrees/branches used for assessment, clean up after the check completes.
Workflow overview
1. Resolve context (source Jira, target version, repo, commits)
2. Resolve target git branch
3. Check for existing Port Jira → stop if duplicate
4. Check if change already on branch → stop if done
5. Assess cherry-pick (worktree) → apply unstaged in local repo for git diff review
6. Ask user whether to run tests (all / relevant / skip)
7. Create Port Jira (only if backport needed and no duplicate)
8. Commit, push, open PR (only on explicit user confirmation)
If cherry-pick produces no changes (clean index/worktree):
Report: change appears already present on <branch>
Stop. Do not create a Port Jira unless user explicitly requests it.
Always clean up the worktree when done:
git cherry-pick --abort 2>/dev/null || git reset --hard HEAD
cd -
git worktree remove /tmp/port-assess-CDPD-108116 --force
Phase 5 — Apply in local repo for review (no commit, no Port Jira)
If the change is not already present, apply it in the user's local clone of the target repo so they can review with git diff in their IDE or terminal.
Important: The diff must land in the correct repo directory (e.g. ~/git/int/spark3), not merely a temp worktree or the wrong workspace. Confirm the repo path from Phase 1 and tell the user explicitly where to look.
cd<local-repo-path># e.g. /Users/you/git/int/spark3
git fetch origin
git checkout CDH-7.3.2.100 || git checkout -b CDH-7.3.2.100 origin/CDH-7.3.2.100
git cherry-pick -n <commit-sha>
git restore --staged .# leave changes unstaged so plain `git diff` works
git diff --stat
git diff --check
git status
Tell the user:
Repo path:<local-repo-path>
Branch:CDH-7.3.2.100
How to review: run git diff or open the modified files in the IDE diff view
Summary in chat (always include):
Files changed and git diff --stat line counts
Whether cherry-pick was clean or had conflicts
If conflicts: list each conflicted file and describe the conflict hunks; do not skip this
Source commit SHA
Do not paste the full diff in chat unless the user asks. The summary complements the local tree; it does not replace it.
Do NOT commit. Do NOT create Port Jira. Do NOT push.
If cherry-pick fails or has conflicts in the local repo
Leave conflict markers in place if the user may want to inspect them, or abort with git cherry-pick --abort after reporting. Give exact recovery commands:
Stop and wait for the user if cherry-pick failed or has unresolvable conflicts.
Phase 5b — Offer to run tests
After applying the diff locally and giving the chat summary, ask the user whether they want you to run tests. Use AskQuestion or a clear prompt with these options:
All tests — full repo/module test suite
Relevant tests only — your best guess based on changed files
Skip — no tests for now
Do not run tests automatically. Wait for the user's choice.
Choosing relevant tests
Infer from the changed paths:
Signal
Relevant test target
A *Suite.scala / *Test.java file was modified
That suite/class directly
Production code under sql/hive/
Matching test module + suite for that package
Production code with no obvious test
Module-level tests (-pl <module>)
pom.xml only
Build smoke test (mvn package -DskipTests or module compile)
State your reasoning when proposing relevant tests (e.g. "MsckRepairTableSuite.scala was added in the same module as ddl.scala").
Repo-specific commands (when known)
CDH/spark3:
cd<local-repo-path># Relevant — single Scala suite (adjust FQCN from changed test file)
./build/mvn test -pl sql/hive \
-DwildcardSuites=org.apache.spark.sql.hive.execution.command.MsckRepairTableSuite
# Relevant — module containing the change
./build/mvn test -pl sql/hive
# All tests (very slow — warn the user)
./build/mvn test
CDH/spark-atlas-connector-for-spark3:
cd<local-repo-path># Relevant — module tests
mvn test -pl spark-atlas-connector
# All tests
mvn test
When you do not know how to run tests
If the repo has no discoverable test command (no pom.xml, build/mvn, build/sbt, Makefile target, or CI script), tell the user honestly:
I don't know how to run tests in this repo. I checked for … and found nothing conclusive. Do you have a standard test command?
Do not guess a command that may not exist.
After tests complete
Report pass/fail, link to or summarize failures, and remind the user that nothing has been committed unless they previously confirmed a commit step.
Phase 6 — Create Port Jira (only when backport is needed)
Create a [Port] Jira only if all are true:
Change is not already on the target branch
No existing Port Jira for the same source + version
User wants to proceed (assessment showed a real backport is needed)
Use Atlassian MCP (cloudId from getAccessibleAtlassianResources):
Phase 7 — Commit, push, and PR (explicit confirmation only)
Proceed only when the user confirms the cherry-pick looks correct.
Commit and PR naming convention
Port commits and PR titles use the source Jira key, not the Port ticket key. The Port ticket is referenced at the end of the commit message body and in the PR body.
Commit subject:CDPD-<source-ticket>: <short summary> (same key as the original fix)
Commit body: port context, then Port Jira on its own line at the end
PR title: same as commit subject — CDPD-<source-ticket>: <short summary>
Feature branch name: still uses the Port ticket — CDPD-<port-ticket>_CDH-<version> (branch naming is separate from commit/PR titles)
Example for source CDPD-108116, Port CDPD-111272:
CDPD-108116: Skip redundant alterTable in MSCK REPAIR TABLE when already tracked
Port of CDPD-108116 to 7.3.2.100.
Port Jira: CDPD-111272
Feature branch
git fetch origin
git checkout -b CDPD-<port-ticket>_CDH-7.3.2.100 origin/CDH-7.3.2.100
git cherry-pick -n <commit-sha># or continue from assessment branch
git commit -m "$(cat <<'EOF'CDPD-<source-ticket>: <short summary>Port of CDPD-<source-ticket> to 7.3.2.100.Port Jira: CDPD-<port-ticket>EOF)"
git push -u origin CDPD-<port-ticket>_CDH-7.3.2.100