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

After 'lando rebuild -y' git status shows changes #37

Open
pyrello opened this issue Feb 26, 2021 · 7 comments
Open

After 'lando rebuild -y' git status shows changes #37

pyrello opened this issue Feb 26, 2021 · 7 comments

Comments

@pyrello
Copy link

pyrello commented Feb 26, 2021

Hello. I've been trying out this tool and I notice that when I go to the web directory after lando rebuild -y and run git status, that I am seeing the following output:

	modified:   composer.json
	modified:   composer.lock
	modified:   composer/Metapackage/CoreRecommended/composer.json
	modified:   composer/Metapackage/PinnedDevDependencies/composer.json

If you are careful with running your git commands you can avoid any issues, but it also makes it more likely that someone (me) is going to make a mistake by running git -am at some point.

I'm just wondering if it is possible to resolve this? Thanks!

@gitressa
Copy link
Contributor

It's because Drush is added with Composer and composer run-script drupal-phpunit-upgrade is run: https://github.com/thinktandem/drupal-contributions/blob/9.x/.lando.yml#L16

See also #35.

I have created a PR (#41) which removes composer run-script drupal-phpunit-upgrade in Drupal 9, since it is not necessary. If you remove Drush, Git is back at the starting point.

To try it out, pull down and check out the PR :

$ git clone [email protected]:thinktandem/drupal-contributions.git && cd drupal-contributions
$ git fetch origin pull/41/head:testing_pr_41
$ git checkout testing_pr_41
$ lando rebuild -y

Remove Drush and see that Git status is unchanged:

$ cd web
$ composer remove drush/drush
[...]
$ git status
On branch 9.2.x
Your branch is up to date with 'origin/9.2.x'.

nothing to commit, working tree clean

@cdubz
Copy link

cdubz commented May 21, 2021

Although #41 was merged this still seems to be happening. I set up this project yesterday following the README instructions and still end up with those modifications --

 > git status
On branch 9.3.x
Your branch is up to date with 'origin/9.3.x'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   composer.json
        modified:   composer.lock
        modified:   composer/Metapackage/CoreRecommended/composer.json
        modified:   composer/Metapackage/PinnedDevDependencies/composer.json

@gitressa
Copy link
Contributor

The composer run-script drupal-phpunit-upgrade command added a lot of extra changes in composer.json and composer.lock, and #41 took care of that bit.

However, you still need to remove Drush as outlined above, to get to a clean Git status.

@cdubz
Copy link

cdubz commented May 21, 2021

Got it. Thanks, @gitressa. That worked. 👍

@gitressa
Copy link
Contributor

Sounds good @cdubz, feel free to also check out #35, where the Git issue might get figured out -- or perhaps in this issue?

It would be great if Drush could get added, without touching the four .json and .lock files, I wonder if that's possible?

@serundeputy
Copy link
Contributor

@pyrello @gitressa @cdubz I didn't test this, but maybe here: https://github.com/thinktandem/drupal-contributions/blob/9.x/.lando.yml#L14

we could:

    run:
      - cd /app/web && composer require drush/drush && composer install
      - git checkout composer.json composer.lock
      - mkdir -p private/browsertest_output
      - yarn install --non-interactive --cwd /app/web/core

i think drush would still work and the git tree would be clean, but I did not test it.

@murilohpucci
Copy link
Contributor

I've recently opened a MR with your solution @serundeputy, testing here it looks like it fixes, it would be nice to have a review there. #58

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants