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

Rector 0.10 with minimal changes. #144

Merged
merged 65 commits into from
Jun 7, 2021
Merged

Conversation

damontgomery
Copy link
Contributor

@damontgomery damontgomery commented May 3, 2021

This is the work in #134, but without the developer tool changes.

Remaining work

If people want to merge this in as a beta release while we work on documentation / support, I'm open to suggestions. See below for a bit more questions around that.

  • Review from an end user perspective
  • Review of the README from a getting started perspective
  • Review of the README from an update perspective
    • This needs to be added, particularly moving from .yml to .php for the configuration file
  • Review of README from a developer perspective
    • I think some of the classes have shifted and we should check if any of the documentation in the README references these old processes. I know we had code examples on various videos / blog posts, but not sure about in the repo.
  • Adding comments back to the default configuration file

Release process request for feedback

Does this make sense as a beta release?

With the changes to the end user and developer experiences, should we coordinate a blog post / video about changes?

  • Users are often coming across this tool for the first and only time and supporting resources have been helpful in making that a good experience.

Testing notes

Requirements

Drupal Rector needs to be installed as a package on a Drupal 8 site. If you would like to use the drupal-rector-sandbox project, this may make testing easier since it includes a step to link the examples into the modules folder and creates a drupal-rector folder inside the repository where you can use Git to check out branches. If you want to use an existing Drupal 8 project to test this, you will need to update repositories in composer.json and make sure you download this branch.

Set up a local testing environment

  • Use the drupal-rector-sandbox project, https://github.com/palantirnet/drupal-rector-sandbox
  • Check out this branch in the drupal-rector-sandbox/drupal-rector folder.
    • From within drupal-rector-sandbox, cd drupal-rector
    • Use this feature branch
      • git fetch --all
      • git checkout origin/rector-0.10-minimal-changes
  • Update composer packages on drupal-rector-sandbox
    • composer update palantirnet/drupal-rector -W
  • Copy the new .php configuration file into the sandbox
    • rm rector.yml from the drupal-rector-sandbox folder
    • cp drupal-rector/rector.php . from the drupal-rector-sandbox folder

End user testing notes

  • Run vendor/bin/rector process --dry-run web/modules/custom/rector_examples/db_select.php or something similar from drupal-rector-sandbox.

Developer testing notes

  • Run composer install from the drupal-rector folder
  • Run vendor/bin/behat from the drupal-rector folder

Attributions

This is all Matt Glaman's work that was built on the work by Tomas Votruba.

Matt also included a lot of great automated testing / developer tools. Unfortunately, I was not able to get them to work myself, so I wanted to include the work I could verify and keep the (probably temporary) functional Behat tests so that I could test locally / on Github Actions.

If anyone would like to help with the update to the tools that Matt worked on including testing and documentation, it would be greatly appreciated.

TomasVotruba and others added 30 commits September 12, 2020 22:32
# Conflicts:
#	.editorconfig
#	composer.json
#	config/drupal-8/drupal-8.0-deprecations.yml
Also adds PHPStan workflow to catch unused calls.
@damontgomery damontgomery mentioned this pull request May 3, 2021
2 tasks
@goba
Copy link
Contributor

goba commented May 5, 2021

Not sure of the status of this. I see it was cut back, which I generally agree makes reviewing easier. There was lots of testing of the other PR though at DrupalCon, etc. Do we consider that covered this or does this need more eyes?

@damontgomery
Copy link
Contributor Author

@goba,

I think it would be good to get a few additional people to run the tool locally to see if it works as expected.

It sounds like people were able to provide feedback from the end user perspective.

I'll add a few remaining tasks to the description and I can probably take a look next week.

@KarinG

This comment has been minimized.

@KarinG

This comment has been minimized.

@KarinG

This comment has been minimized.

@damontgomery

This comment has been minimized.

@KarinG
Copy link

KarinG commented May 10, 2021

@damontgomery - I am a dev and a user: I'm a Drupal module maintainer.

I successfully used Drupal rector last year to help get our code base from D8->D9 and I was able to easily install @mglaman 's #134 PR during DrupalCon -> and with that PR I was able to successfully run rector on a number of Drupal module projects - including a sizeable one like Webform module and our own Webform CiviCRM module. And yes I did this on a Drupal 8 site (same infra/dev I had previously used Matt's PR on).

I really just tried testing this PR b/c @goba asked me to do so. Sorry I couldn't get it working.

@damontgomery
Copy link
Contributor Author

Thanks again for the feedback, @KarinG.

@shaal
Copy link
Contributor

shaal commented May 10, 2021

👍
I tested this PR the same way I tested #134 before, and it ran successfully 💯

Testing Instructions

Open a Drupal project (I used DDEV + Gitpod)
https://gitpod.io/#https://github.com/shaal/ddev-gitpod

Important: Make sure it's Drupal 8 (and NOT Drupal 9)

ddev composer require "drupal/core-recommended:^8.9" "drupal/core-project-message:^8.9" "drupal/core-composer-scaffold:^8.9"

Configure it to use latest drupal-rector

ddev composer config repositories.1 vcs https://github.com/palantirnet/drupal-rector.git

Require the specific branch for this PR

ddev composer require palantirnet/drupal-rector:dev-rector-0.10-minimal-changes

Configure it

cp vendor/palantirnet/drupal-rector/rector.php .

Grab the example

cp -r vendor/palantirnet/drupal-rector/rector_examples web/modules/
php vendor/bin/rector process web/modules/rector_examples --dry-run

Or test with your own modules

php vendor/bin/rector process web/modules/custom --dry-run

@damontgomery
Copy link
Contributor Author

Thanks for testing @shaal and for the testing notes!

Copy link
Collaborator

@mglaman mglaman left a comment

Choose a reason for hiding this comment

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

Cursory overview, it contains the right stuff 👍

@damontgomery damontgomery added the help wanted Extra attention is needed label Jun 3, 2021
@agentrickard
Copy link
Contributor

I have created a Drupal.org issue to cover this PR, and recommend that we merge it as a 0.10.x branch, pinned to main here.

https://www.drupal.org/project/rector/issues/3217419

@agentrickard agentrickard merged commit a2a0a38 into master Jun 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants