cu-uis / cu-starterkit-project

Development repository for Pantheon's recommended (future) Drupal 9+ upstream
1 stars 2 forks source link

Bug - Theme updates not properly installed on existing sites #85

Closed meschenbaum closed 2 years ago

meschenbaum commented 2 years ago

Describe the bug When the CU Base theme issues a new tag and the starter kit composer is updated to include the new tag, composer does not overwrite the files if the theme already exists. This has been reported by Matt E. and Tim Stalker.

To Reproduce Steps to reproduce the behavior:

  1. Go to an existing Starterkit site, that is using an older cu_base version, or create a new site with an older cu_base version.
  2. Update the composer.json to a newer cu_base version
  3. Run composer install
  4. You'll see that composer shows the install of the newer version, but if you check the directory it will not have the newer code.

Expected behavior When the composer is updated to use a newer version, I expect it to overwrite the files in the theme directory with the newer code.

This was happening on local environments and Tim noted this on his test sites.

meschenbaum commented 2 years ago

@kreynen Tim verified this in our call that he was having the same issue of the theme not updating. Deleting the theme folder and re-running composer install did install the correct theme version.

We're not sure what is causing this or what the solution may be. It may be resolved if moved it to packagist or something.

kreynen commented 2 years ago

The problem is that the .git dir is being included in the build and thus not picked up when the project is updated.

Screen Shot 2022-07-21 at 7 26 35 AM

Not sure why that happens for cu_base and not https://github.com/cu-uis/cu-starterkit-project/blob/master/composer.json#L17, but this is the reason why the cu_base dir needs to be manually deleted

kreynen commented 2 years ago

https://stackoverflow.com/questions/25981292/how-to-make-composer-not-create-a-git-directory-for-a-package suggests a few different ways to fix this.

meschenbaum commented 2 years ago

Fixed by changing reference in composer.json

meschenbaum commented 2 years ago

@kreynen @johnquest can you two check if this change will update the CU Base theme to the latest 1.0.3 tag?

kreynen commented 2 years ago

I responded in Teams, but updating the version in the info.yml will surface the version in the Drupal UI AND with any any dependencies. I opened https://github.com/cu-uis/cu_base/pull/13. Even when this is managed by Packagist, the version needs to be maintained in both places.

This is one of many things Drupal.org does for projects.

johnquest commented 2 years ago

I successfully updated the code via the pantheon dashboard with the branch set to "expose-version-in-ui" in the cu_base repo.