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

Merge CKEditor 5 subrepositories to the main repository #6476

Closed
2 of 3 tasks
mlewand opened this issue Mar 23, 2020 · 5 comments
Closed
2 of 3 tasks

Merge CKEditor 5 subrepositories to the main repository #6476

mlewand opened this issue Mar 23, 2020 · 5 comments
Assignees
Labels
type:task This issue reports a chore (non-production change) and other types of "todos".

Comments

@mlewand
Copy link
Contributor

mlewand commented Mar 23, 2020

Provide a description of the task

All the ckeditor5-xyz core repositories should be merged into the ckeditor/ckeditor5 repository.

It would be great if we were able to somehow keep the history, so at least blame is useful - but that's not a must-have.

Todos before the merge

  • Ensure there are no severe performance drawbacks, when working with the repository.
  • Recreate the monorepo branch with the latest changes in all packages.
    • Prepare a reproducible script to create such monorepo branch.

📃 Other details

This is a subtask of #6466.

@mlewand mlewand added the type:task This issue reports a chore (non-production change) and other types of "todos". label Mar 23, 2020
@mlewand mlewand added this to the iteration 31 milestone Mar 23, 2020
@mlewand mlewand self-assigned this Mar 23, 2020
@Reinmar Reinmar mentioned this issue Mar 24, 2020
7 tasks
@pomek
Copy link
Member

pomek commented Mar 24, 2020

After merging packages to the main repository, we need to clean up package.json in each package. Move the lint task from each package to the main repository. Be sure that URLs are correct.

@mlewand
Copy link
Contributor Author

mlewand commented Mar 24, 2020

Added the monorepo-mock branch, that has the file layout that we should be looking for, we can use it for further testing.

However it's just a mock, made by adding carelessly adding files from all our CKE5 subpackages.

@mlewand
Copy link
Contributor Author

mlewand commented Mar 26, 2020

I have successfully integrated all our subpackages, while preserving ckediotr/ckeditor5 hashes and porting packages commits into it.

monorepo branch creation

The execution of the script might be time-consuming, so be aware of that.

It is much easier to work on it by creating an empty repository.

To do that we'll reuse the mlewand/monorepo-tools#ckeditor5-migration script, a fork of shopsys/monorepo-tools (as it needs few adjustments).

  1. Create ckeditor5-migration directory anywhere you'd like.

    mkdir ckeditor5-migration && cd ckeditor5-migration && git init
    
  2. Hook up the ckeditor/ckeditor5 repository and merge its master branch

    git remote add main-repository https://github.com/ckeditor/ckeditor5.git
    git fetch main-repository
    git merge main-repository/master
    git checkout -b monorepo
    
  3. Set remotes for all the subpackages to be imported:

    git remote add package-ckeditor-cloud-services-core git@github.com:ckeditor/ckeditor-cloud-services-core.git
    git remote add package-ckeditor5-adapter-ckfinder git@github.com:ckeditor/ckeditor5-adapter-ckfinder.git
    git remote add package-ckeditor5-alignment git@github.com:ckeditor/ckeditor5-alignment.git
    git remote add package-ckeditor5-autoformat git@github.com:ckeditor/ckeditor5-autoformat.git
    git remote add package-ckeditor5-autosave git@github.com:ckeditor/ckeditor5-autosave.git
    git remote add package-ckeditor5-basic-styles git@github.com:ckeditor/ckeditor5-basic-styles.git
    git remote add package-ckeditor5-block-quote git@github.com:ckeditor/ckeditor5-block-quote.git
    git remote add package-ckeditor5-build-balloon git@github.com:ckeditor/ckeditor5-build-balloon.git
    git remote add package-ckeditor5-build-balloon-block git@github.com:ckeditor/ckeditor5-build-balloon-block.git
    git remote add package-ckeditor5-build-classic git@github.com:ckeditor/ckeditor5-build-classic.git
    git remote add package-ckeditor5-build-decoupled-document git@github.com:ckeditor/ckeditor5-build-decoupled-document.git
    git remote add package-ckeditor5-build-inline git@github.com:ckeditor/ckeditor5-build-inline.git
    git remote add package-ckeditor5-ckfinder git@github.com:ckeditor/ckeditor5-ckfinder.git
    git remote add package-ckeditor5-clipboard git@github.com:ckeditor/ckeditor5-clipboard.git
    git remote add package-ckeditor5-cloud-services git@github.com:ckeditor/ckeditor5-cloud-services.git
    git remote add package-ckeditor5-code-block git@github.com:ckeditor/ckeditor5-code-block.git
    git remote add package-ckeditor5-core git@github.com:ckeditor/ckeditor5-core.git
    git remote add package-ckeditor5-easy-image git@github.com:ckeditor/ckeditor5-easy-image.git
    git remote add package-ckeditor5-editor-balloon git@github.com:ckeditor/ckeditor5-editor-balloon.git
    git remote add package-ckeditor5-editor-classic git@github.com:ckeditor/ckeditor5-editor-classic.git
    git remote add package-ckeditor5-editor-decoupled git@github.com:ckeditor/ckeditor5-editor-decoupled.git
    git remote add package-ckeditor5-editor-inline git@github.com:ckeditor/ckeditor5-editor-inline.git
    git remote add package-ckeditor5-engine git@github.com:ckeditor/ckeditor5-engine.git
    git remote add package-ckeditor5-enter git@github.com:ckeditor/ckeditor5-enter.git
    git remote add package-ckeditor5-essentials git@github.com:ckeditor/ckeditor5-essentials.git
    git remote add package-ckeditor5-font git@github.com:ckeditor/ckeditor5-font.git
    git remote add package-ckeditor5-heading git@github.com:ckeditor/ckeditor5-heading.git
    git remote add package-ckeditor5-highlight git@github.com:ckeditor/ckeditor5-highlight.git
    git remote add package-ckeditor5-horizontal-line git@github.com:ckeditor/ckeditor5-horizontal-line.git
    git remote add package-ckeditor5-image git@github.com:ckeditor/ckeditor5-image.git
    git remote add package-ckeditor5-indent git@github.com:ckeditor/ckeditor5-indent.git
    git remote add package-ckeditor5-link git@github.com:ckeditor/ckeditor5-link.git
    git remote add package-ckeditor5-list git@github.com:ckeditor/ckeditor5-list.git
    git remote add package-ckeditor5-markdown-gfm git@github.com:ckeditor/ckeditor5-markdown-gfm.git
    git remote add package-ckeditor5-media-embed git@github.com:ckeditor/ckeditor5-media-embed.git
    git remote add package-ckeditor5-mention git@github.com:ckeditor/ckeditor5-mention.git
    git remote add package-ckeditor5-page-break git@github.com:ckeditor/ckeditor5-page-break.git
    git remote add package-ckeditor5-paragraph git@github.com:ckeditor/ckeditor5-paragraph.git
    git remote add package-ckeditor5-paste-from-office git@github.com:ckeditor/ckeditor5-paste-from-office.git
    git remote add package-ckeditor5-remove-format git@github.com:ckeditor/ckeditor5-remove-format.git
    git remote add package-ckeditor5-restricted-editing git@github.com:ckeditor/ckeditor5-restricted-editing.git
    git remote add package-ckeditor5-select-all git@github.com:ckeditor/ckeditor5-select-all.git
    git remote add package-ckeditor5-special-characters git@github.com:ckeditor/ckeditor5-special-characters.git
    git remote add package-ckeditor5-table git@github.com:ckeditor/ckeditor5-table.git
    git remote add package-ckeditor5-theme-lark git@github.com:ckeditor/ckeditor5-theme-lark.git
    git remote add package-ckeditor5-typing git@github.com:ckeditor/ckeditor5-typing.git
    git remote add package-ckeditor5-ui git@github.com:ckeditor/ckeditor5-ui.git
    git remote add package-ckeditor5-undo git@github.com:ckeditor/ckeditor5-undo.git
    git remote add package-ckeditor5-upload git@github.com:ckeditor/ckeditor5-upload.git
    git remote add package-ckeditor5-utils git@github.com:ckeditor/ckeditor5-utils.git
    git remote add package-ckeditor5-watchdog git@github.com:ckeditor/ckeditor5-watchdog.git
    git remote add package-ckeditor5-widget git@github.com:ckeditor/ckeditor5-widget.git
    git remote add package-ckeditor5-word-count git@github.com:ckeditor/ckeditor5-word-count.git
    
    
  4. git fetch --all --no-tags

  5. Clone the forked monorepo-tools.

    git clone https://github.com/mlewand/monorepo-tools.git ~/monorepo-tools -b ckeditor5-migration
    
  6. Execute monorepo build command (will take some time to process):

    ~/monorepo-tools/monorepo_build.sh main-repository package-ckeditor-cloud-services-core:packages/ckeditor-cloud-services-core package-ckeditor5-adapter-ckfinder:packages/ckeditor5-adapter-ckfinder package-ckeditor5-alignment:packages/ckeditor5-alignment package-ckeditor5-autoformat:packages/ckeditor5-autoformat package-ckeditor5-autosave:packages/ckeditor5-autosave package-ckeditor5-basic-styles:packages/ckeditor5-basic-styles package-ckeditor5-block-quote:packages/ckeditor5-block-quote package-ckeditor5-build-balloon:packages/ckeditor5-build-balloon package-ckeditor5-build-balloon-block:packages/ckeditor5-build-balloon-block package-ckeditor5-build-classic:packages/ckeditor5-build-classic package-ckeditor5-build-decoupled-document:packages/ckeditor5-build-decoupled-document package-ckeditor5-build-inline:packages/ckeditor5-build-inline package-ckeditor5-ckfinder:packages/ckeditor5-ckfinder package-ckeditor5-clipboard:packages/ckeditor5-clipboard package-ckeditor5-cloud-services:packages/ckeditor5-cloud-services package-ckeditor5-code-block:packages/ckeditor5-code-block package-ckeditor5-core:packages/ckeditor5-core package-ckeditor5-easy-image:packages/ckeditor5-easy-image package-ckeditor5-editor-balloon:packages/ckeditor5-editor-balloon package-ckeditor5-editor-classic:packages/ckeditor5-editor-classic package-ckeditor5-editor-decoupled:packages/ckeditor5-editor-decoupled package-ckeditor5-editor-inline:packages/ckeditor5-editor-inline package-ckeditor5-engine:packages/ckeditor5-engine package-ckeditor5-enter:packages/ckeditor5-enter package-ckeditor5-essentials:packages/ckeditor5-essentials package-ckeditor5-font:packages/ckeditor5-font package-ckeditor5-heading:packages/ckeditor5-heading package-ckeditor5-highlight:packages/ckeditor5-highlight package-ckeditor5-horizontal-line:packages/ckeditor5-horizontal-line package-ckeditor5-image:packages/ckeditor5-image package-ckeditor5-indent:packages/ckeditor5-indent package-ckeditor5-link:packages/ckeditor5-link package-ckeditor5-list:packages/ckeditor5-list package-ckeditor5-markdown-gfm:packages/ckeditor5-markdown-gfm package-ckeditor5-media-embed:packages/ckeditor5-media-embed package-ckeditor5-mention:packages/ckeditor5-mention package-ckeditor5-page-break:packages/ckeditor5-page-break package-ckeditor5-paragraph:packages/ckeditor5-paragraph package-ckeditor5-paste-from-office:packages/ckeditor5-paste-from-office package-ckeditor5-remove-format:packages/ckeditor5-remove-format package-ckeditor5-restricted-editing:packages/ckeditor5-restricted-editing package-ckeditor5-select-all:packages/ckeditor5-select-all package-ckeditor5-special-characters:packages/ckeditor5-special-characters package-ckeditor5-table:packages/ckeditor5-table package-ckeditor5-theme-lark:packages/ckeditor5-theme-lark package-ckeditor5-typing:packages/ckeditor5-typing package-ckeditor5-ui:packages/ckeditor5-ui package-ckeditor5-undo:packages/ckeditor5-undo package-ckeditor5-upload:packages/ckeditor5-upload package-ckeditor5-utils:packages/ckeditor5-utils package-ckeditor5-watchdog:packages/ckeditor5-watchdog package-ckeditor5-widget:packages/ckeditor5-widget package-ckeditor5-word-count:packages/ckeditor5-word-count
    

Inspect the logs to see that history is preserved. Ensure that latest ckeditor/ckeditor5 commit is included in your monorepo branch (so that there's no need for force-push or any shenanigans like that).

This is it, your local monorepo branch contains all the packages merged.

@pomek
Copy link
Member

pomek commented Mar 26, 2020

Set remotes for all the subpackages to be imported:

Just to be sure it will execute correctly. Use a bash script for that.

@mlewand
Copy link
Contributor Author

mlewand commented Apr 2, 2020

All the instructions are ready. What remains is to execute it as a part of #6534.

@mlewand mlewand closed this as completed Apr 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:task This issue reports a chore (non-production change) and other types of "todos".
Projects
None yet
Development

No branches or pull requests

2 participants