Skip to content

Commit

Permalink
Sustainable Kibana Architecture: Relocate script v3 (elastic#204239)
Browse files Browse the repository at this point in the history
## 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.
  • Loading branch information
gsoldevila authored Dec 13, 2024
1 parent bee7f0f commit 39732db
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
6 changes: 0 additions & 6 deletions packages/kbn-relocate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions packages/kbn-relocate/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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).
`;
2 changes: 1 addition & 1 deletion packages/kbn-relocate/relocate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion packages/kbn-relocate/utils.git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-relocate/utils.relocate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 39732db

Please sign in to comment.