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

Add composer autoload #95

Merged
merged 11 commits into from
Jan 29, 2025
Merged

Add composer autoload #95

merged 11 commits into from
Jan 29, 2025

Conversation

MaxwellGarceau
Copy link
Collaborator

@MaxwellGarceau MaxwellGarceau commented Dec 26, 2024

Description of the Change

Added autoloading to have an easy way to modularize new code and refactor existing code in the future.

❗I modified the Github action workflow files to install composer dependencies in order to ensure autoload was being generated on every build. I wanted to flag this in case I missed a required build process update.

Also, if there's a good place to add documentation for in progress pattern updates I'd be happy to add switching to autoload in new work and any refactors.

Closes #96

How to test the Change

Changelog Entry

Developer - Add Composer autoload.

Credits

Props @username, @username2, ...

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

Copy link
Collaborator

@dkotter dkotter left a comment

Choose a reason for hiding this comment

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

Overall this looks good but we'll need to do a few more things:

  1. We have a GitHub Action that deploys plugin assets and readme changes. That will need to be updated to run composer install as well
  2. We don't currently deploy the vendor directory so we'll need to update that or things won't work in the final release. We have both a .distignore and .gitattributes files that will need updated

mailchimp.php Outdated Show resolved Hide resolved
@MaxwellGarceau
Copy link
Collaborator Author

MaxwellGarceau commented Jan 2, 2025

Overall this looks good but we'll need to do a few more things:

  1. We have a GitHub Action that deploys plugin assets and readme changes. That will need to be updated to run composer install as well
  2. We don't currently deploy the vendor directory so we'll need to update that or things won't work in the final release. We have both a .distignore and .gitattributes files that will need updated

@dkotter I've made the requested changes.

  1. Updated .github/workflows/wordpress-plugin-asset-update.yml with the composer install and autodump commands
  2. Removed the vendor folder from distignore and gitattributes

Note: I've updated the translators comment to match an example I found in WP Core.

@MaxwellGarceau MaxwellGarceau marked this pull request as ready for review January 6, 2025 15:23
@github-actions github-actions bot added the needs:code-review This requires code review. label Jan 6, 2025
@qasumitbagthariya
Copy link
Collaborator

QA Update ✅


  • Run composer install to install dependencies and generate the autoload files. (Composer version 2.8.4) ✅

  • Verify that the vendor/autoload.php file is generated. ✅

  • Verify Functionality of Existing Features

image

@qasumitbagthariya
Copy link
Collaborator

Regression / Smoke Test Report ✅

Tested with the smoke-testing branch, it works as expected, similar to the fix-specific branch.

Testing Environment

  • WordPress: 6.7.1
  • Theme: Storefront 4.6.0
  • Theme: Twenty Twenty-Four 1.3
  • WooCommerce - 9.5.1
  • PHP: 8.0.30
  • Web Server: Nginx 1.20.2
  • Browser: Chrome
  • OS: macOS 15.2
  • Branch: smoke-testing

@github-actions github-actions bot added the needs:refresh This requires a refreshed PR to resolve. label Jan 28, 2025
@vikrampm1 vikrampm1 modified the milestones: 1.7.0, 1.6.3 Jan 28, 2025
@vikrampm1 vikrampm1 mentioned this pull request Jan 28, 2025
27 tasks
@github-actions github-actions bot removed the needs:refresh This requires a refreshed PR to resolve. label Jan 28, 2025
@dkotter
Copy link
Collaborator

dkotter commented Jan 28, 2025

@vikrampm1 @MaxwellGarceau E2E tests are failing here. Not sure if that is specific to the changes made here or something else but in getting merge conflicts cleaned up here to get this merged in for release, I think we should get those fixed up before we proceed, otherwise we'll need to fix those anyway on that release PR.

@vikrampm1
Copy link
Collaborator

@dkotter got it. @iamdharmesh can you able to assist with the above as @MaxwellGarceau is not resourced on this project anymore?

@iamdharmesh
Copy link
Collaborator

@dkotter E2E tests were failing because we are using the build release action from the develop branch, and it doesn't have the composer installation step. Due to an early return in the autoload file check, the plugin functionality was not getting enabled. I temporarily pointed the build release action to this PR, and it started working as expected.

However, we recently enabled 2FA on the OSP account, and because of this, the connection tests and tests requiring connections are failing. I tried running the tests locally with a different account, and they worked well. So, it seems we are good to proceed here.

cc: @vikrampm1

@dkotter dkotter merged commit 584b7c5 into develop Jan 29, 2025
8 of 11 checks passed
@dkotter dkotter deleted the enhancement/add-composer-autoload branch January 29, 2025 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs:code-review This requires code review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add composer autoload
6 participants