Sustainable Kibana Architecture: Relocate script v3 (#204239)

## Summary

* Added link to rebase guideline in PR description.
* Do not count `elasticmachine` commits as manual.
* Replace references in CODEOWNERS file manual section.
* Update README prerequisites.
This commit is contained in:
Gerard Soldevila 2024-12-14 00:15:31 +01:00 committed by GitHub
parent bee7f0f90e
commit 39732db6da
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 7 additions and 8 deletions

View file

@ -10,12 +10,6 @@ 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.

View file

@ -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).
`;

View file

@ -73,7 +73,7 @@ const relocateModules = async (toMove: Package[], log: ToolingLog): Promise<numb
// single commit per module now
await safeExec(`git add .`);
await safeExec(`git commit -m "Relocating module \\\`${module.id}\\\`"`);
await safeExec(`git commit --no-verify -m "Relocating module \\\`${module.id}\\\`"`);
++relocated;
}
return relocated;

View file

@ -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;

View file

@ -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];