Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sustainable Kibana Architecture: Relocate script v3 #204239

Merged
merged 2 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading