Skip to content

Prefix Composer Dependencies#4543

Merged
swissspidy merged 3 commits intoadd/amp-wpfrom
add/amp-wp-scoping
Oct 5, 2020
Merged

Prefix Composer Dependencies#4543
swissspidy merged 3 commits intoadd/amp-wpfrom
add/amp-wp-scoping

Conversation

@swissspidy
Copy link
Copy Markdown
Collaborator

@swissspidy swissspidy commented Sep 18, 2020

Summary

Prefixes dependencies to avoid conflicts with the AMP plugin and other plugins using these dependencies.

Relevant Technical Choices

  • Uses PHP-Scoper to prefix dependencies
    • Installs it via civicrm/composer-downloads-plugin to work around PHP version mismatch issues
    • Updates CI config accordingly
  • Separating autoloaders in third-party and includes makes building the plugin ZIP file much faster
  • Removes composer validate CI step as it doesn't work with mcaskill/composer-exclude-files

To-do

User-facing changes

N/A

Testing Instructions

  1. Check out this branch and run composer install or check out this branch on the QA site
  2. Activate AMP plugin
  3. Visit a single story, edit a story, etc.
  4. Verify there are no PHP errors or notices

Addresses one aspect of #4513

@swissspidy swissspidy added Type: Infrastructure Changes impacting testing infrastructure or build tooling Pod: WP & Infra labels Sep 18, 2020
@google-cla google-cla bot added the cla: yes label Sep 18, 2020
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Sep 18, 2020

Size Change: 0 B

Total Size: 1.33 MB

ℹ️ View Unchanged
Filename Size Change
assets/css/edit-story.css 909 B 0 B
assets/css/stories-dashboard.css 939 B 0 B
assets/css/web-stories-embed-block.css 515 B 0 B
assets/js/chunk-fonts-********************.js 43.5 kB 0 B
assets/js/chunk-web-stories-template-0-********************.js 10.2 kB 0 B
assets/js/chunk-web-stories-template-1-********************.js 10.2 kB 0 B
assets/js/chunk-web-stories-template-2-********************.js 9.97 kB 0 B
assets/js/chunk-web-stories-template-3-********************.js 10.5 kB 0 B
assets/js/chunk-web-stories-template-4-********************.js 10.6 kB 0 B
assets/js/chunk-web-stories-template-5-********************.js 6.83 kB 0 B
assets/js/chunk-web-stories-template-6-********************.js 9.87 kB 0 B
assets/js/chunk-web-stories-template-7-********************.js 9.75 kB 0 B
assets/js/chunk-web-stories-textset-0-********************.js 4.8 kB 0 B
assets/js/chunk-web-stories-textset-1-********************.js 3.64 kB 0 B
assets/js/chunk-web-stories-textset-2-********************.js 3.82 kB 0 B
assets/js/chunk-web-stories-textset-3-********************.js 4.47 kB 0 B
assets/js/chunk-web-stories-textset-4-********************.js 4.2 kB 0 B
assets/js/edit-story.js 516 kB 0 B
assets/js/stories-dashboard.js 581 kB 0 B
assets/js/web-stories-activation-notice.js 74 kB 0 B
assets/js/web-stories-embed-block.js 17.5 kB 0 B

compressed-size-action

@swissspidy swissspidy mentioned this pull request Sep 18, 2020
7 tasks
@swissspidy swissspidy force-pushed the add/amp-wp-scoping branch 3 times, most recently from 60bc23b to 6e78b55 Compare September 21, 2020 21:20
@google-cla

This comment has been minimized.

@google-cla google-cla bot added cla: no and removed cla: yes labels Sep 21, 2020
@google-cla google-cla bot added cla: yes and removed cla: no labels Sep 21, 2020
@swissspidy swissspidy force-pushed the add/amp-wp-scoping branch 5 times, most recently from 539b27a to 9c31977 Compare September 22, 2020 09:02
@swissspidy swissspidy marked this pull request as ready for review September 22, 2020 10:00
@swissspidy swissspidy force-pushed the add/amp-wp branch 2 times, most recently from 1f5f761 to cdb6b26 Compare September 23, 2020 21:15
@swissspidy swissspidy changed the title [WIP] Prefix Composer Dependencies Prefix Composer Dependencies Sep 23, 2020
@swissspidy
Copy link
Copy Markdown
Collaborator Author

@westonruter @schlessera @spacedmonkey I feel like this is now ready for initial review, so I'd love to get your feedback. Please note that this PR is based on #4513 and solves the conflict resolving part of that PR.

@felixarntz FYI I added you as a reviewer in case you have some feedback for us on this based on prior art in Site Kit. The Site Kit implementation was certainly a good inspiration, although I went for an easier route heree.

@swissspidy swissspidy force-pushed the add/amp-wp-scoping branch 5 times, most recently from fa851d0 to fb1b47d Compare September 28, 2020 21:25
@codecov
Copy link
Copy Markdown

codecov bot commented Sep 28, 2020

Codecov Report

Merging #4543 into add/amp-wp will decrease coverage by 0.08%.
The diff coverage is n/a.

Impacted file tree graph

@@              Coverage Diff               @@
##           add/amp-wp    #4543      +/-   ##
==============================================
- Coverage       75.12%   75.04%   -0.09%     
==============================================
  Files             888      894       +6     
  Lines           15518    15782     +264     
==============================================
+ Hits            11658    11843     +185     
- Misses           3860     3939      +79     
Flag Coverage Δ
#karmatests 49.77% <ø> (-0.06%) ⬇️
#unittests 65.95% <ø> (+0.21%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
bin/utils/createBuild.js 100.00% <ø> (ø)
includes/AMP/Canonical_Sanitizer.php 100.00% <ø> (ø)
includes/AMP/Meta_Sanitizer.php 62.96% <ø> (ø)
includes/AMP/Optimization.php 100.00% <ø> (ø)
includes/AMP/Sanitization.php 83.73% <ø> (ø)
includes/AMP/Story_Sanitizer.php 100.00% <ø> (ø)
includes/REST_API/Link_Controller.php 93.42% <ø> (ø)
includes/Story_Post_Type.php 81.37% <ø> (+0.12%) ⬆️
includes/Story_Renderer/HTML.php 86.41% <ø> (+8.83%) ⬆️
includes/Traits/Document_Parser.php 93.75% <ø> (ø)
... and 32 more

@swissspidy swissspidy force-pushed the add/amp-wp-scoping branch 3 times, most recently from ce6e207 to 85fef9e Compare September 30, 2020 11:29
@swissspidy swissspidy added Type: Enhancement New feature or improvement of an existing feature Group: WordPress Changes related to WordPress or Gutenberg integration and removed Type: Enhancement New feature or improvement of an existing feature labels Sep 30, 2020
Copy link
Copy Markdown
Contributor

@westonruter westonruter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've never used php-scoper before, but LGTM.

@swissspidy swissspidy merged commit 646ef89 into add/amp-wp Oct 5, 2020
@swissspidy swissspidy deleted the add/amp-wp-scoping branch October 5, 2020 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Group: WordPress Changes related to WordPress or Gutenberg integration Type: Infrastructure Changes impacting testing infrastructure or build tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants