Add ddev release port-commit command#23686
Conversation
5f3970c to
f604f64
Compare
cbef667 to
e33bd03
Compare
This stack of pull requests is managed by Graphite. Learn more about stacking. |
e33bd03 to
579edab
Compare
f604f64 to
6912a4f
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6912a4f767
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| steps: list[PortStep] = [ | ||
| FetchOriginStep(app, dry_run=plan.dry_run), |
There was a problem hiding this comment.
Require a clean index before committing the backport
When the user has staged local edits before running this command, the workflow starts with fetch/checkout/cherry-pick and later runs git commit without ever checking that the index was clean, so those pre-existing staged changes are committed into the backport branch alongside the cherry-pick. This can silently publish unrelated local work in the pushed branch/PR; add an initial clean-worktree/index guard or explicitly reset/abort before the mutating steps.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed with a validation when creating the plan.
6912a4f to
4a797b4
Compare
579edab to
5729ee2
Compare
🎉 All green!❄️ No new flaky tests detected 🔗 Commit SHA: ca857eb | Docs | Datadog PR Page | Give us feedback! |
Codecov Report❌ Patch coverage is Additional details and impacted files🚀 New features to boost your workflow:
|
2edc14e to
e2408d2
Compare
5729ee2 to
518fee5
Compare
e2408d2 to
4988ad1
Compare
518fee5 to
f869e87
Compare
4988ad1 to
b57a198
Compare
f869e87 to
18440ba
Compare
c945300 to
d8f8ae0
Compare
18440ba to
3d8ca21
Compare
d8f8ae0 to
a56402e
Compare
3d8ca21 to
99fa9d0
Compare
57fa156 to
9362527
Compare
99fa9d0 to
2a381c6
Compare
9362527 to
4c1c326
Compare
2a381c6 to
1c9e7d3
Compare
7c1e084 to
ca857eb
Compare
Review from NouemanKHAL is dismissed. Related teams and files:
- agent-integrations
- .gitignore
- ddev/changelog.d/23686.added
- ddev/src/ddev/cli/release/init.py
- ddev/src/ddev/cli/release/port_commit.py
- ddev/src/ddev/cli/release/port_commit_workflow.py
- ddev/tests/cli/release/test_port_commit.py
Validation ReportAll 20 validations passed. Show details
|
* Add ddev release port-commit command * Lowercase port branch name and clean up step output * Improve port-commit output: split steps, lighter styling, completion panel, commit link in PR body c0767bc

What does this PR do?
Adds
ddev release port-commit: cherry-picks a commit onto a target branch, pushes a<user>/port-<sha>-to-<target>branch, and opens a PR (ready-for-review by default,--draftto opt in). Preserves.in-totofiles from the target branch so package signatures stay intact.The workflow runs in an isolated git worktree under
.worktrees/port-commit/<sanitized-branch>/so the user's primary working tree is never mutated. On success the worktree is removed; on failure it is left in place and its path is surfaced so the user can inspect or finish the work manually.Motivation
Brings an existing personal backport script into
ddevso the flow is consistent, discoverable, and reuses ddev's git + GitHub helpers.Implementation notes:
SetupWorktreeSteprunsgit worktree add -B <port-branch> <path> origin/<target>to create the working area; all cherry-pick /.in-totosweep / commit / push steps run inside aGitRepositoryinstance bound to that worktree. ATeardownWorktreeStepremoves the worktree on a clean run, and is intentionally skipped on failure so partial state is recoverable.PortStepworkflow. Each step has a uniformdescribe/planned_commands/executeinterface; adding or reordering steps is a one-line change inbuild_port_steps.--dry-runis centralized inPortStep.runso every step prints its planned commands without executing them.resolve_port_planfails fast (before any mutation) ifgithub.useris missing, or ifgithub.tokenis missing while PR creation is enabled (skippable via--no-pror--dry-run). It also verifies the commit exists, reads its subject, warns about touched.in-totofiles, and confirms the resolved plan with the user.AsyncGitHubClient, withhttpx.HTTPError/pydantic.ValidationErrorwrapped intoPortStepErrorso any HTTP / response-shape failure produces a clean abort instead of a raw traceback.Stacks on top of #23685, which adds the async-client surface and
FakeAsyncGitHubClienttest helper this PR consumes.Review checklist (to be filled by reviewers)
qa/skip-qalabel if the PR doesn't need to be tested during QA.backport/<branch-name>label to the PR and it will automatically open a backport PR once this one is merged