Build: restore deleted files preserving history#11064
Build: restore deleted files preserving history#11064dmsnell wants to merge 28 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
a4d2abe to
20909b5
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 35313fa > Build/Test Tools: Update Gutenberg hash to fix CSS minification. > Updates the Gutenberg ref to include changes that generate both minified and non-minified CSS files during build. Previously, the build only produced a single CSS file (e.g., `style.css`), causing missing asset errors when `SCRIPT_DEBUG` is set to `false`, as Core expects `.min.css` files. > > Props peterwilsoncc, dd32, tyxla, jsnajdr, mcsf.
See changelog in 425bc36 > Build/Test Tools: Use --fast flag for Gutenberg builds. > Adds the `--fast` flag to Gutenberg build commands, which skips TypeScript-related steps (version validation, `tsc --build`, and type declaration file checks) that aren't needed when building for WordPress Core. These steps only produce `.d.ts` files which aren't shipped with Core. Also updates the Gutenberg ref to include the commit that adds `--fast` flag support. > > The build times are now comparable to the build times we had using the npm packages.
See changelog in e626725 > Build: Improve Gutenberg integration workflow. > This changeset improves the Gutenberg build integration to simplify the developer workflow and reinstore a flow similar to how package dependencies worked before the Gutenberg checkout-and-build approach was introduced. > > Key improvements:
See changelog in f8b2285 > Gutenberg ref update. > Updates unit tests to account for: > - "Dynamically add CSS class to Paragraph block" (WordPress/gutenberg#71207) > - New block server-side block registrations.
See changelog in b63a84b > Gutenberg ref update. > Developed in WordPress#10968. > > Props ellatrix, adamsilverstein, youknowriad.
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.
c08fb34 to
618b73c
Compare
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
Note:
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