Skip to content

Conversation

@naspirato
Copy link
Collaborator

@naspirato naspirato commented Nov 18, 2025

… error handling

  • Added --allow-unmerged option to backport unmerged PRs directly using their commits.
  • Introduced --merge-commits option to control behavior for merge commits (skip or fail).
  • Enhanced error handling for cherry-pick conflicts and Git command failures.
  • Improved PR title and body formatting to include metadata and linked issues.
  • Updated workflow configuration to support new script options.

Changelog entry

FOR CHANGLOG TEST!
ITS GOOD CHANGES!

Changelog category

  • Not for changelog (changelog entry is not required)

Description for reviewers

📦 Backport

Branch Actions
stable-25-2 ▶ Backport ⚙️
stable-25-2-1 ▶ Backport ⚙️
stable-25-3 ▶ Backport ⚙️
stable-25-3-1 ▶ Backport ⚙️

▶ Select branches manually - opens UI to select branches

Legend:

  • ▶ - immediately runs the workflow with default parameters
  • ⚙️ - opens UI to review and modify parameters before running

… error handling

- Added `--allow-unmerged` option to backport unmerged PRs directly using their commits.
- Introduced `--merge-commits` option to control behavior for merge commits (skip or fail).
- Enhanced error handling for cherry-pick conflicts and Git command failures.
- Improved PR title and body formatting to include metadata and linked issues.
- Updated workflow configuration to support new script options.
@github-actions
Copy link

github-actions bot commented Nov 18, 2025

🟢 2025-11-18 16:05:13 UTC The validation of the Pull Request description is successful.

@naspirato naspirato reopened this Nov 18, 2025
@github-actions
Copy link

github-actions bot commented Nov 18, 2025

2025-11-18 11:45:52 UTC Pre-commit check linux-x86_64-release-asan for eeb9422 has started.
2025-11-18 11:46:08 UTC Artifacts will be uploaded here
2025-11-18 11:48:13 UTC ya make is running...
🟢 2025-11-18 11:48:19 UTC Tests successful.

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
0 0 0 0 0 0

🟢 2025-11-18 11:48:25 UTC Build successful.

@github-actions
Copy link

github-actions bot commented Nov 18, 2025

2025-11-18 11:47:13 UTC Pre-commit check linux-x86_64-relwithdebinfo for eeb9422 has started.
2025-11-18 11:47:22 UTC Artifacts will be uploaded here
2025-11-18 11:48:38 UTC ya make is running...
🟢 2025-11-18 11:48:45 UTC Tests successful.

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
0 0 0 0 0 0

🟢 2025-11-18 11:48:50 UTC Build successful.

…body formatting

- Added methods to extract changelog category, entry, and description from PR body.
- Improved PR body generation to include extracted changelog information and ensure validation requirements are met.
- Updated workflow configuration to support new changelog features.
@naspirato naspirato marked this pull request as ready for review November 18, 2025 11:55
Copilot AI review requested due to automatic review settings November 18, 2025 11:55
@github-actions
Copy link

github-actions bot commented Nov 18, 2025

2025-11-18 11:58:09 UTC Pre-commit check linux-x86_64-release-asan for 652d1f9 has started.
2025-11-18 11:58:28 UTC Artifacts will be uploaded here
2025-11-18 12:00:33 UTC ya make is running...
🟢 2025-11-18 12:00:39 UTC Tests successful.

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
0 0 0 0 0 0

🟢 2025-11-18 12:00:44 UTC Build successful.

@github-actions
Copy link

github-actions bot commented Nov 18, 2025

2025-11-18 11:59:15 UTC Pre-commit check linux-x86_64-relwithdebinfo for 652d1f9 has started.
2025-11-18 11:59:33 UTC Artifacts will be uploaded here
2025-11-18 12:01:38 UTC ya make is running...
🟢 2025-11-18 12:01:44 UTC Tests successful.

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
0 0 0 0 0 0

🟢 2025-11-18 12:01:49 UTC Build successful.

… backport comment handling

- Updated datetime formatting to include seconds, preventing branch name conflicts.
- Added method to find and update existing backport comments in original PRs, enhancing comment management.
- Improved logging for comment creation and updates to provide clearer feedback on operations.
@github-actions
Copy link

github-actions bot commented Nov 18, 2025

2025-11-18 12:07:54 UTC Pre-commit check linux-x86_64-relwithdebinfo for e364135 has started.
2025-11-18 12:09:01 UTC Artifacts will be uploaded here
2025-11-18 12:11:07 UTC ya make is running...
🟢 2025-11-18 12:11:13 UTC Tests successful.

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
0 0 0 0 0 0

🟢 2025-11-18 12:11:18 UTC Build successful.

@github-actions
Copy link

github-actions bot commented Nov 18, 2025

2025-11-18 12:08:38 UTC Pre-commit check linux-x86_64-release-asan for e364135 has started.
2025-11-18 12:08:56 UTC Artifacts will be uploaded here
2025-11-18 12:11:04 UTC ya make is running...
🟢 2025-11-18 12:11:09 UTC Tests successful.

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
0 0 0 0 0 0

🟢 2025-11-18 12:11:15 UTC Build successful.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances the cherry-pick script to support backporting unmerged PRs and improves error handling throughout the workflow. The changes introduce new command-line options for flexible handling of unmerged PRs and merge commits, better conflict resolution with draft PR creation, and comprehensive metadata tracking in backport PRs.

  • Added --allow-unmerged flag to enable backporting of unmerged PRs using their commits directly
  • Introduced --merge-commits option to control handling of merge commits (skip or fail)
  • Enhanced conflict handling with automatic draft PR creation and detailed resolution instructions
  • Improved PR body formatting with changelog extraction, linked issues, and metadata tracking

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 15 comments.

File Description
.github/workflows/cherry_pick.yml Added allow_unmerged workflow input parameter and configured new environment variables for tracking workflow metadata
.github/scripts/cherry_pick.py Complete rewrite of cherry-pick logic with support for unmerged PRs, conflict handling, validation, GraphQL integration for linked issues, and comprehensive error tracking

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

try:
commit_author = commit.author.login if commit.author else None
if commit_author and commit_author not in self.pull_authors:
self.pull_authors.append(commit_author)
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bare except clause will catch all exceptions including KeyboardInterrupt and SystemExit. This should be replaced with a specific exception type like Exception or AttributeError.

Suggested change
self.pull_authors.append(commit_author)
except AttributeError:

Copilot uses AI. Check for mistakes.
…formation

- Updated the `created_backport_prs` structure to store conflicted files alongside target branches and PRs.
- Improved the PR body generation to include a section for files with conflicts, providing links for easier resolution.
- Enhanced conflict handling to return a list of conflicted files, improving logging and user feedback during cherry-pick operations.
- Introduced a new `pr_template.py` file containing PR template and issue reference patterns for the YDB project.
- Updated `validate_pr_description.py` to utilize the new template and patterns, ensuring consistency in PR descriptions.
- Enhanced `cherry_pick.py` to import category definitions and streamline changelog category handling.
@github-actions
Copy link

github-actions bot commented Nov 18, 2025

2025-11-18 13:51:15 UTC Pre-commit check linux-x86_64-relwithdebinfo for 4e5bbf4 has started.
2025-11-18 13:51:33 UTC Artifacts will be uploaded here
2025-11-18 13:53:42 UTC ya make is running...
🟢 2025-11-18 13:53:49 UTC Tests successful.

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
0 0 0 0 0 0

🟢 2025-11-18 13:53:55 UTC Build successful.

@github-actions
Copy link

github-actions bot commented Nov 18, 2025

2025-11-18 13:52:48 UTC Pre-commit check linux-x86_64-release-asan for 4e5bbf4 has started.
2025-11-18 13:53:07 UTC Artifacts will be uploaded here
2025-11-18 13:55:13 UTC ya make is running...
🟢 2025-11-18 13:55:20 UTC Tests successful.

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
0 0 0 0 0 0

🟢 2025-11-18 13:55:26 UTC Build successful.

…resolution

- Added detailed error handling for the `git rev-parse` command to ensure the repository is cloned before execution.
- Updated exception handling to specify the type of error encountered during PR fetching and automerge attempts.
- Improved conflict detection logic to ensure all changes are captured and logged appropriately.
- Enhanced logging for conflict resolution, providing clearer feedback on the status of conflicted files.
@github-actions
Copy link

github-actions bot commented Nov 18, 2025

2025-11-18 14:22:58 UTC Pre-commit check linux-x86_64-relwithdebinfo for cadbdc1 has started.
2025-11-18 14:23:14 UTC Artifacts will be uploaded here
2025-11-18 14:25:18 UTC ya make is running...
🟢 2025-11-18 14:25:23 UTC Tests successful.

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
0 0 0 0 0 0

🟢 2025-11-18 14:25:28 UTC Build successful.

@github-actions
Copy link

github-actions bot commented Nov 18, 2025

2025-11-18 14:23:26 UTC Pre-commit check linux-x86_64-release-asan for cadbdc1 has started.
2025-11-18 14:23:43 UTC Artifacts will be uploaded here
2025-11-18 14:25:43 UTC ya make is running...
🟢 2025-11-18 14:25:48 UTC Tests successful.

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
0 0 0 0 0 0

🟢 2025-11-18 14:25:54 UTC Build successful.

- Added detailed diagnostics for `git merge-base` command to better handle ancestor checks and error reporting.
- Updated conflict resolution logic to capture line numbers of conflicts, improving user feedback on conflicted files.
- Enhanced PR body generation to include links to specific lines in files with conflicts, facilitating easier resolution.
- Introduced a method to find the first line with conflict markers in files, improving conflict detection accuracy.
@github-actions
Copy link

github-actions bot commented Nov 18, 2025

2025-11-18 14:54:35 UTC Pre-commit check linux-x86_64-relwithdebinfo for d1f9c6f has started.
2025-11-18 14:55:55 UTC Artifacts will be uploaded here
2025-11-18 14:57:52 UTC ya make is running...
🟢 2025-11-18 14:57:58 UTC Tests successful.

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
0 0 0 0 0 0

🟢 2025-11-18 14:58:03 UTC Build successful.

@github-actions
Copy link

github-actions bot commented Nov 18, 2025

2025-11-18 14:55:31 UTC Pre-commit check linux-x86_64-release-asan for d1f9c6f has started.
2025-11-18 14:56:17 UTC Artifacts will be uploaded here
2025-11-18 14:59:04 UTC ya make is running...
🟢 2025-11-18 14:59:10 UTC Tests successful.

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
0 0 0 0 0 0

🟢 2025-11-18 14:59:15 UTC Build successful.

- Enhanced the logic for capturing conflict messages to ensure accurate matching of file paths, including handling both relative and absolute paths.
- Improved the detection of continuation lines in conflict messages, allowing for better summarization of conflicts.
- Added a cleanup step to quit the cherry-pick operation if no commits are left to apply, improving script robustness.
@github-actions
Copy link

github-actions bot commented Nov 19, 2025

2025-11-19 10:07:57 UTC Pre-commit check linux-x86_64-relwithdebinfo for 66302b1 has started.
2025-11-19 10:08:15 UTC Artifacts will be uploaded here
2025-11-19 10:10:25 UTC ya make is running...
🟢 2025-11-19 10:10:32 UTC Tests successful.

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
0 0 0 0 0 0

🟢 2025-11-19 10:10:38 UTC Build successful.

@github-actions
Copy link

github-actions bot commented Nov 19, 2025

2025-11-19 10:08:09 UTC Pre-commit check linux-x86_64-release-asan for 66302b1 has started.
2025-11-19 10:08:27 UTC Artifacts will be uploaded here
2025-11-19 10:10:32 UTC ya make is running...
🟢 2025-11-19 10:10:38 UTC Tests successful.

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
0 0 0 0 0 0

🟢 2025-11-19 10:10:44 UTC Build successful.

- Updated the logic to collect and determine the changelog category from multiple PRs, ensuring it is only set if all categories are the same.
- Improved handling of category extraction to allow for better flexibility when dealing with differing categories across PRs.
- Enhanced comments for clarity on the purpose of category determination in the changelog process.
…k script

- Introduced a new method to add Git conflict markers for conflict types (DU, UD, AA) where they are not generated automatically.
- Enhanced the conflict resolution process by ensuring visibility of conflicts in PR diffs, improving user experience during cherry-picking.
- Updated logging to provide feedback when conflict markers are added, aiding in troubleshooting and resolution efforts.
@ydbot
Copy link
Collaborator

ydbot commented Nov 19, 2025

Backported to stable-25-2: draft PR #29170 (contains conflicts requiring manual resolution) - workflow run

- Added debug and warning logs to provide better visibility into the conflict resolution process, including details on the number of status lines and specific conflict types (DU, UD, AA).
- Improved error handling by including exception information in warning logs when adding conflict markers fails.
- Updated logging to ensure clarity on the state of conflict markers and the conditions under which they are added or skipped.
@github-actions
Copy link

github-actions bot commented Nov 19, 2025

2025-11-19 11:31:46 UTC Pre-commit check linux-x86_64-relwithdebinfo for 31e5500 has started.
2025-11-19 11:32:03 UTC Artifacts will be uploaded here
2025-11-19 11:34:08 UTC ya make is running...
🟢 2025-11-19 11:34:14 UTC Tests successful.

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
0 0 0 0 0 0

🟢 2025-11-19 11:34:20 UTC Build successful.

@ydbot
Copy link
Collaborator

ydbot commented Nov 19, 2025

Backported to stable-25-2: draft PR #29173 (contains conflicts requiring manual resolution) - workflow run

@github-actions
Copy link

github-actions bot commented Nov 19, 2025

2025-11-19 11:32:00 UTC Pre-commit check linux-x86_64-release-asan for 31e5500 has started.
2025-11-19 11:32:17 UTC Artifacts will be uploaded here
2025-11-19 11:34:23 UTC ya make is running...
🟢 2025-11-19 11:34:30 UTC Tests successful.

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
0 0 0 0 0 0

🟢 2025-11-19 11:34:36 UTC Build successful.

- Added logic to skip files that already have conflict markers to prevent overwriting existing information during cherry-picking.
- Introduced a mechanism to track processed files, ensuring that multiple conflicts in the same file are handled sequentially without duplication.
- Enhanced logging to provide clearer insights into the conflict resolution process, including reasons for skipping files and details on existing conflict markers.
- Replaced the previous method for extracting conflict messages with a new function that accurately matches file paths from git output, improving reliability.
- Enhanced the handling of conflict messages to ensure both relative and absolute paths are considered, streamlining the conflict resolution process.
- Removed redundant code related to conflict message extraction, simplifying the overall logic and improving maintainability.
- Introduced a new method to find conflict messages for specific files, improving the accuracy of message matching from git output.
- Simplified the conflict message extraction logic by consolidating redundant code, enhancing maintainability and readability.
- Ensured compatibility with both relative and absolute file paths in conflict message matching, streamlining the conflict resolution process.
- Added a warning log for unexpected clean working tree state after conflict detection, indicating potential auto-resolution or inconsistent state.
- Updated the cherry-pick logic to use '--skip' instead of '--quit' when a commit is already in the target branch, enhancing the cleanup process during cherry-picking.
@github-actions
Copy link

github-actions bot commented Nov 21, 2025

2025-11-21 11:51:25 UTC Pre-commit check linux-x86_64-relwithdebinfo for 60db632 has started.
2025-11-21 11:51:42 UTC Artifacts will be uploaded here
2025-11-21 11:53:50 UTC ya make is running...
🟢 2025-11-21 11:53:56 UTC Tests successful.

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
0 0 0 0 0 0

🟢 2025-11-21 11:54:03 UTC Build successful.

@github-actions
Copy link

github-actions bot commented Nov 21, 2025

2025-11-21 11:51:42 UTC Pre-commit check linux-x86_64-release-asan for 60db632 has started.
2025-11-21 11:52:01 UTC Artifacts will be uploaded here
2025-11-21 11:54:10 UTC ya make is running...
🟢 2025-11-21 11:54:17 UTC Tests successful.

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
0 0 0 0 0 0

🟢 2025-11-21 11:54:23 UTC Build successful.

@naspirato
Copy link
Collaborator Author

naspirato commented Nov 25, 2025

Backport results:

@naspirato
Copy link
Collaborator Author

naspirato commented Nov 25, 2025

Backport results:

@ydbot
Copy link
Collaborator

ydbot commented Nov 27, 2025

Backported to stable-25-3: PR #29711 - workflow run

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.

3 participants