From ccc5e4fb970138e282ab1e00c3fb1a2ed7200eec Mon Sep 17 00:00:00 2001 From: Gerard Soldevila Date: Fri, 13 Dec 2024 16:21:59 +0100 Subject: [PATCH 1/2] Small enhancements! --- packages/kbn-relocate/README.md | 12 ++++++------ packages/kbn-relocate/constants.ts | 2 ++ packages/kbn-relocate/utils.git.ts | 4 +++- packages/kbn-relocate/utils.relocate.ts | 1 + 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/packages/kbn-relocate/README.md b/packages/kbn-relocate/README.md index 3ceb2432c69d1..967de1a67da27 100644 --- a/packages/kbn-relocate/README.md +++ b/packages/kbn-relocate/README.md @@ -10,16 +10,16 @@ You must have `gh` CLI tool installed. You can install it by running: brew install gh ``` -You must also configure your "default" kibana repo in `gh`, so that it can find PRs.: - -```sh -gh repo set-default elastic/kibana -``` - You must have `elastic/kibana` remote configured under the name `upstream`. You must have a remote named `origin` pointing to your fork of the Kibana repo. +It's highly recommended that you disable the pre-commit hook, as it often causes the script to fail: + +```sh +mv .git/hooks/pre-commit .git/hooks/pre-commit.sample +``` + ## Usage First of all, you need to decide whether you want to contribute to an existing PR or to create a new one. Use the `--pr` flag to specify the PR you are trying to update: diff --git a/packages/kbn-relocate/constants.ts b/packages/kbn-relocate/constants.ts index 0ba7e9d50314b..059c32004370e 100644 --- a/packages/kbn-relocate/constants.ts +++ b/packages/kbn-relocate/constants.ts @@ -96,4 +96,6 @@ This PR aims at relocating some of the Kibana modules (plugins and packages) int > * Try to obtain the missing reviews / approvals before applying manual fixes, and/or keep your changes in a .patch / git stash. > * Please use [#sustainable_kibana_architecture](https://elastic.slack.com/archives/C07TCKTA22E) Slack channel for feedback. +Are you trying to rebase this PR to solve merge conflicts? Please follow the steps describe [here](https://elastic.slack.com/archives/C07TCKTA22E/p1734019532879269?thread_ts=1734019339.935419&cid=C07TCKTA22E). + `; diff --git a/packages/kbn-relocate/utils.git.ts b/packages/kbn-relocate/utils.git.ts index 743e6522c585b..4f002772528fd 100644 --- a/packages/kbn-relocate/utils.git.ts +++ b/packages/kbn-relocate/utils.git.ts @@ -21,7 +21,9 @@ export function hasManualCommits(commits: Commit[]) { (commit) => !commit.messageHeadline.startsWith('Relocating module ') && !commit.messageHeadline.startsWith('Moving modules owned by ') && - commit.authors.some((author) => author.login !== 'kibanamachine') + commit.authors.some( + (author) => author.login !== 'kibanamachine' && author.login !== 'elasticmachine' + ) ); return manualCommits.length > 0; diff --git a/packages/kbn-relocate/utils.relocate.ts b/packages/kbn-relocate/utils.relocate.ts index c76c1f48790ba..15121fefd344a 100644 --- a/packages/kbn-relocate/utils.relocate.ts +++ b/packages/kbn-relocate/utils.relocate.ts @@ -119,6 +119,7 @@ const replaceReferencesInternal = async ( ); const matchingFiles = result.stdout.split('\n').filter(Boolean); + matchingFiles.push('.github/CODEOWNERS'); // to update references in the manual section, thanks pgayvallet! for (let i = 0; i < matchingFiles.length; ++i) { const file = matchingFiles[i]; From 4cfc0f823e8dbe6a1dc947e89bcce372ecb5e110 Mon Sep 17 00:00:00 2001 From: Gerard Soldevila Date: Fri, 13 Dec 2024 22:18:18 +0100 Subject: [PATCH 2/2] Use `--no-verify` flag in git commit --- packages/kbn-relocate/README.md | 6 ------ packages/kbn-relocate/relocate.ts | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/packages/kbn-relocate/README.md b/packages/kbn-relocate/README.md index 967de1a67da27..899a5e9b97970 100644 --- a/packages/kbn-relocate/README.md +++ b/packages/kbn-relocate/README.md @@ -14,12 +14,6 @@ You must have `elastic/kibana` remote configured under the name `upstream`. You must have a remote named `origin` pointing to your fork of the Kibana repo. -It's highly recommended that you disable the pre-commit hook, as it often causes the script to fail: - -```sh -mv .git/hooks/pre-commit .git/hooks/pre-commit.sample -``` - ## Usage First of all, you need to decide whether you want to contribute to an existing PR or to create a new one. Use the `--pr` flag to specify the PR you are trying to update: diff --git a/packages/kbn-relocate/relocate.ts b/packages/kbn-relocate/relocate.ts index 646a3ba5bef0e..dde0c83fc096e 100644 --- a/packages/kbn-relocate/relocate.ts +++ b/packages/kbn-relocate/relocate.ts @@ -73,7 +73,7 @@ const relocateModules = async (toMove: Package[], log: ToolingLog): Promise