Build: restore deleted files preserving history#11064
Build: restore deleted files preserving history#11064dmsnell wants to merge 29 commits intoWordPress:trunkfrom
Conversation
04cdca9 to
efc89d8
Compare
|
I have force-pushed from 04cdca9 to efc89d8, which is a big change:
|
5cfaf68 to
29b508c
Compare
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
ef9bcb2 to
4220ecc
Compare
59e0a27 to
49093f1
Compare
|
Recreated branch from previous 59e0a27 to new 49093f1 This time the creation was automated with the following script: https://gist.github.com/dmsnell/c6f068e7f6028bacbfcb810d2fe726c2 |
b30d403 to
1c1cf17
Compare
1c1cf17 to
45aafcc
Compare
|
I picked a file that I expected to have a long history. The paragraph block.json. If I start at the That file doesn't exist at all in It's a good indicator that this branch is an adequate solution to fixing history. 👍 I'm certainly missing some background, but I'd like to understand how this will work in practice.
Ultimately, things need to happen in subversion and then propagate to git mirrors from there. Work is committed with |
Thanks @sirreal for your review and the question. This is something I wanted to ensure was simulated before merging, which you can see if you use the attached simulator script. To the best of my knowledge, when The final commit will be the merge commit itself, and since both of its parent’s will already by synced, we should have no problem seeing it created in My plan was to recreate the commits in |
865350f to
e51421b
Compare
c08fb34 to
618b73c
Compare
|
The commits here in GitHub seem to be correct and will likely resolve the issue of broken and lost history that this seeks to address. This isn't a simple commit, much of the interesting work here is the process of how the commits are actually made. I've reviewed the process with @dmsnell and it seems to work well. |
618b73c to
663d948
Compare
See changelog in 22294af > Build: Update Gutenberg integration to checkout-and-build approach. > This changes WordPress Core's Gutenberg integration from npm packages to checking out and building Gutenberg directly. Instead of syncing individual npm packages, Core now checks out the Gutenberg repository, builds it, and copies the build artifacts. > > This enables Core to use Gutenberg's advanced features like route-based navigation, full-page rendering, and the Font Library, while also streamlining future updates.
See changelog in 0544d56 > Editor: backport client side media PHP changes to core. > Bring over the changes required to implement client side media in core. This feature recently graduated from experiments and is ready for testing in beta. > > Props adamsilverstein, westonruter, mamaduka, mukesh27, swissspidy, andrewserong, ellatrix, ramonjd.
See changelog in f6927c8 > Gutenberg ref update. > CI run: WordPress#10988. > > See #64595.
See changelog in f328908 > Gutenberg ref update. > CI run: WordPress#11059. > > See #64595.
See changelog in e7d40e7 > Gutenberg ref update. > CI run: WordPress#11167. > > See #64595.
See changelog in aaafdc0 > Gutenberg ref update. > Only includes the following commit: WordPress/gutenberg@e7b8c0c. > > "Media: Use Document-Isolation-Policy for cross-origin isolation on Chromium 137+" (WordPress/gutenberg#75991)
See changelog in 8a7d2ce > Gutenberg ref update. > Only includes the following commit: WordPress/gutenberg@f4d8a58. > > "DataForm datetime control: fix date handling" (WordPress/gutenberg#76193)
See changelog in 63240d9 > Editor: Bump pinned hash for the Gutenberg repository. > This updates the pinned hash from the `gutenberg` from `f4d8a5803aa2fbe26e7d9af4d17e80a622b7bab8` to `7b7fa2bc97a8029a302bd6511cf0d206b5953172`. > > The following changes are included:
See changelog in b80140a > Editor: Bump pinned hash for the Gutenberg repository. > This updates the pinned hash from the `gutenberg` from `7b7fa2bc97a8029a302bd6511cf0d206b5953172` to `9b8144036fa5faf75de43d4502ff9809fcf689ad`. > > The following changes are included:
See changelog in 49d8c11 > Build/Test Tools: Remove the requirement to clone/build Gutenberg. > This iterates on the changes from [61438] by removing the need to: > - Check out the WordPress/gutenberg repository at the pinned hash. > - Run `npm install` within that checkout.
See changelog in 21d3c57 > Editor: Bump pinned hash for the Gutenberg repository. > This updates the pinned hash from the `gutenberg` from `9b8144036fa5faf75de43d4502ff9809fcf689ad` to `8c78d87453509661a9f28f978ba2c242d515563b`. > > The following changes are included:
See changelog in 3678df3 > Editor: Bump pinned hash for the Gutenberg repository. This updates the pinned hash from the `gutenberg` from `8c78d87453509661a9f28f978ba2c242d515563b` to `487a096a9782ba6110a7686d7b4b2d0c55ed1b06`. > The following changes are included: > > - Disables anchor support for the Page Break block. (WordPress/gutenberg#76434)
See changelog in 7ac6151 > Build/Test Tools: Stop generating unminified `.min` file. > The generated `wp-includes/assets/script-loader-packages.min.php` and `wp-includes/assets/script-modules-packages.min.php` files are not actually minified. Additionally, the only purpose they serve is to pass a different script handle to the script loader (`.min.js` vs. `.js`). > > This eliminates the need for those files entirely since the difference in file size is negligible, and a human-readable version is more useful.
See changelog in 0af3431 > Editor: Bump pinned hash for the Gutenberg repository. This updates the pinned hash from the `gutenberg` from `487a096a9782ba6110a7686d7b4b2d0c55ed1b06` to `2ee7ede6be6d4e55d5c7047394c5c4e0ea8d521d`. > The following changes are included: > > - RTC: Backport race condition fix (WordPress/gutenberg#76649)
See changelog in 19bef0e > Build/Test Tools: Move icon library SVG files to `wp-includes/images`. > This makes several changes to the build script to place the icon library files into more appropriate locations. > - The icon library SVG files are now copied into the `wp-includes/images/icon-library` directory instead of `wp-includes/icons`. > - The name of the `manifest.php` file has changed to `icon-library-manifest.php` and is now copied to `wp-includes/assets`.
See changelog in b00a9eb > Build/Test Tools: Only include active, stable routes in build. > The `registry.php` file within the built assets from the `gutenberg` repository contains an accurate list of active, stable routes. However, the `build/routes/` directory has the JavaScript and PHP files for all routes, regardless of their status. > > This makes adjustments to the `grunt copy` tasks responsible for copying these files into the appropriate locations to extract the list of routes specified in the `registry.php` file so that only the required files are copied.
See changelog in 5875321 > Editor: Bump pinned hash for the Gutenberg repository. This updates the pinned hash from the `gutenberg` from `2ee7ede6be6d4e55d5c7047394c5c4e0ea8d521d` to `3edafcc90fc4520939d69279e26ace69390582be`. > The following changes are included: > > - RTC: Use activation hook to enable RTC by default (WordPress/gutenberg#76736)
663d948 to
f3f6234
Compare
In [61438] and successive fixes, a number of files were deleted and added to `.gitignore`. These files were removed because they are built from the Gutenberg repo and copied into the Core repo. However, because the only artifact of udpates to those files are an opaque hash change, it’s important to have a copy of the files at the change in version control for the purposes of auditing, debugging, benchmarking, and tracking. This patch merges a version-history from before the initial changeset and reattaches the version-tracking to these files, creating immitation commits along each step where the files were updated in a Gutenberg sync. Developed in: #11064 Discussed in: https://core.trac.wordpress.org/ticket/64393 Follow-up to [61438]. Props 762e5e74, aidvu, desrosj, dmsnell, jonsurrell, youknowriad. See #64393. git-svn-id: https://develop.svn.wordpress.org/trunk@62143 602fd350-edb4-49c9-b593-d223f7449a82
In [61438] and successive fixes, a number of files were deleted and added to `.gitignore`. These files were removed because they are built from the Gutenberg repo and copied into the Core repo. However, because the only artifact of udpates to those files are an opaque hash change, it’s important to have a copy of the files at the change in version control for the purposes of auditing, debugging, benchmarking, and tracking. This patch merges a version-history from before the initial changeset and reattaches the version-tracking to these files, creating immitation commits along each step where the files were updated in a Gutenberg sync. Developed in: WordPress/wordpress-develop#11064 Discussed in: https://core.trac.wordpress.org/ticket/64393 Follow-up to [61438]. Props 762e5e74, aidvu, desrosj, dmsnell, jonsurrell, youknowriad. See #64393. Built from https://develop.svn.wordpress.org/trunk@62143 git-svn-id: http://core.svn.wordpress.org/trunk@61425 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Adds files that were missed in [62143]. Developed in: #11064 Discussed in: https://core.trac.wordpress.org/ticket/64393 Follow-up to [62143]. Props desrosj, dmsnell, ellatrix. See #64393. git-svn-id: https://develop.svn.wordpress.org/trunk@62147 602fd350-edb4-49c9-b593-d223f7449a82
Adds files that were missed in [62143]. Developed in: WordPress/wordpress-develop#11064 Discussed in: https://core.trac.wordpress.org/ticket/64393 Follow-up to [62143]. Props desrosj, dmsnell, ellatrix. See #64393. Built from https://develop.svn.wordpress.org/trunk@62147 git-svn-id: http://core.svn.wordpress.org/trunk@61429 1a063a9b-81f0-0310-95a4-ce76da25c4cd
…e follow-up). Removes svn:ignore props that were excluding script package manifests [62143]. Developed in: #11064 Discussed in: https://core.trac.wordpress.org/ticket/64393 Follow-up to [62143]. Props desrosj, dmsnell, ellatrix. See #64393. git-svn-id: https://develop.svn.wordpress.org/trunk@62148 602fd350-edb4-49c9-b593-d223f7449a82
…e follow-up). Removes svn:ignore props that were excluding script package manifests [62143]. Developed in: WordPress/wordpress-develop#11064 Discussed in: https://core.trac.wordpress.org/ticket/64393 Follow-up to [62143]. Props desrosj, dmsnell, ellatrix. See #64393. Built from https://develop.svn.wordpress.org/trunk@62148 git-svn-id: http://core.svn.wordpress.org/trunk@61430 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Trac ticket: Core-64393
The build change in #10638 removed many required files and added them to
.gitignore. This led to WordPress crashing when loadingwp-load.phpuntil thenpm run build:devcommand was run.Deleting these files had a number of deleterious side-effects:
wordpress-develop, making it hard to see what code is going to run and hard to reference the files in places like Github wheregitCLI tools and the Gutenberg repo are not colocated and handy.git bisectto find root cause and changes containing the root cause.npm cihas to run, download more than 1 GB ofnpmpackages, and rebuild all of the files on everygit checkout. this practically eliminates the practicality of running workflows which assess the project over time.This PR brings back those files and connects them to their pre-build-change version history by branching from a point in
trunkimmediately before the build change.Although they were deleted in
trunk, this patch, when applied as a merge commit will provide two parents which will allow any and allgittooling to reconstruct the history of the files without any special options or flags.Status
This is ready for a full review.
As of the time of posting this, running
npm run grunt gutenberg:download -- --forcewith this branch checked out leaves no changes or ignored changes ingit, which suggests that every file which was changed has been accounted for.restored-file-history.mp4
Changes to
svn:ignoreNote:
svn-to-gitconversion. If the merge is lost in that process then it won’t matter if this PR restores the history, because it will be lost when back-writing from the Subversion source.Testing
Here is a sequence of events that simulates this operation. The script creates an SVN repo, adds some files and makes a few meaningless commits, then deletes a
test.txtfile.There is a
git svnmirror tracking the SVN repo.From the SVN side, a new branch is created to restore the files. It is forked from before they were deleted and then the
test.txtfile is modified in a neutral way so that it will create a merge conflict. This is important because otherwisesvnandgitwill automatically accept the deleted files as the truth.That branch is merged in which tracks the version history for the files, because it maintains metadata pointing to the commits before they were deleted.
On the
git svnside though it’s critical to firstgit svn fetch --allto retrieve the new branch (otherwise it will not have the metadata and therefore linearize the merge), and then to rungit rebase --merge --rebase-mergesso that it avoid linearizing the merge.simulating-restore.mp4