If a module is installed with git (either via composer or not) it does not include the relevant elements in info.yml for update.module to detect updates.

The d.o packager currently adds a number of items, for example:

# Information added by Drupal.org packaging script on 2015-08-09
version: '8.x-1.x-dev'
core: '8.x'
project: 'devel'
datestamp: 1439140152

The core element should be added by module developers anyway. The project element seems to be the "key" here as it matches the module to the d.o project name, without this nothing will show on the updates page. version and datestamp are the two elements which are used to determine the version currently being used.

This issue needs a lot of discussion about possible solutions. One would be for module maintainers to add all the items, however I'm sure there are better solutions.

Update: due to complexities of getting the module version this issue has digressed to initially just getting the project element, this can be derived from the name in compoer.json.

Comments

timmillwood created an issue. See original summary.

timmillwood’s picture

Looking at all the possible options it seems that getting git deploy module into core would be the best option.

The module is only 102 lines long and that's doing a "alter" via hook_system_info_alter(), therefore an integration into the core update module should be even simpler.

dave reid’s picture

If all modules have a composer.json, then all the basic information at least should not be necessary in the .info.yml files. And we could still report installs of Git-installed modules, but maybe just report an 'Unknown' version number back to Drupal.org?

dave reid’s picture

Also, Git Deploy makes things very slow. I would not want it in core currently.

timmillwood’s picture

@Dave Reid - Thanks for the heads up on the performance issues. I was hoping for a solution that will cover more than just the composer installed modules, but any modules without the required information in the info file.

timmillwood’s picture

Looking into this further for the last hour I think all we can derive from composer.json is $info['project'] but the version and datestamp will need to come from git.

I'm going to create two new core services, composer_parser and git_parser which will allow us to return all the info needed.

timmillwood’s picture

Title: Display update status for modules installed via git » Parse composer.json for the project name for update module
Status: Active » Needs review
StatusFileSize
new5.23 KB

This patch adds the ComposerParser service to parse a module's composer.json. The name in composer.json (eg drupal/devel) is then exploded, if the vendor namespace is drupal the project name is used.

drumm’s picture

Git deploy shells out to execute git, http://cgit.drupalcode.org/git_deploy/tree/git_deploy.module?h=8.x-2.x#n41. I wouldn't want it anywhere near a production website. There may not be known security issues, but it is a nice target.

Status: Needs review » Needs work

The last submitted patch, 7: display_update_status-2559313-7.patch, failed testing.

isntall’s picture

This patch to breaks qa.d.o testbots.

The last submitted patch, 7: display_update_status-2559313-7.patch, failed testing.

The last submitted patch, 7: display_update_status-2559313-7.patch, failed testing.

timmillwood’s picture

Issue summary: View changes

@drumm - Thanks for the input, I think for now I am just going to focus on getting the project name from composer.json, this will at least allow the module to show on the update status page, even if this is as "unknown".

@isntall - I think I know the issue, will work on a updated patch today.

timmillwood’s picture

Status: Needs work » Needs review
StatusFileSize
new5.62 KB
new1.28 KB

Added some more ifs to mitigate issues, also added "version" to the mix just incase it's set in composer.json.

Status: Needs review » Needs work

The last submitted patch, 14: parse_composer_json_for-2559313-14.patch, failed testing.

timmillwood’s picture

Status: Needs work » Needs review

Awesome, passing now.

Status: Needs review » Needs work

The last submitted patch, 14: parse_composer_json_for-2559313-14.patch, failed testing.

The last submitted patch, 14: parse_composer_json_for-2559313-14.patch, failed testing.

timmillwood’s picture

Status: Needs work » Needs review

It seems testbot is really confused by this patch.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

meramo’s picture

Version: 8.6.x-dev » 8.7.x-dev
Status: Needs review » Needs work

_system_rebuild_module_data is deprecated in Drupal 8.5.0, also the patch is failing
Seems like we have to rework it, changing status.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

longwave’s picture

The modern solution here would be to bring https://www.drupal.org/project/composer_deploy into core, right? This seems like a good idea if we are expecting most users to use Composer nowadays.

I have a site where a dist download failed during composer install some time ago and Webform was installed from source instead. This now means that Webform is missing from the available updates list following the recent security release - but there is no notification that this is the case or even that there might be a problem here. It even took me a while to track down what the actual issue was, it's not visible anywhere in the UI that there is something different about the Webform install compared to other modules.

colan’s picture

I just marked #2755745: Add packaging info to .info.yml files for extensions managed by Composer, allow Update module to work as a duplicate. If there's any work there that's not covered by what's happening here, please post it here. I marked that one as a duplicate because it's newer.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

pasqualle’s picture

For me the correct solution is to use https://packagist.org/packages/drupal-composer/info-rewrite as it does its magic at composer install.
It is a must have package when using dev releases with composer.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

xjm’s picture

A followup issue from the great git migration got marked outdated recently, which, fair enough. The remaining scope of it was that dev versions od modules deployed with git deploy and then composer did't work with update.php. This looked like the modern home of that although this seems to only about naming, rather htan version numbers, abd to be yet another duplicate in a chain?

Is there an infra issue for #38?

xjm’s picture

Related issues:

My clever retitle of one of the related issues is a little misleading about just what old technical debt this is, and that the issue has survived not only multiple deployment best practices but also multiple d.do packaging systems and even core version control systems. 🤫

xjm’s picture

Removing circular issue references.

xjm’s picture

And, if I'm reading the issue right and the scope was reduced, does that mean this was reduced to the project name only, and not supporting the version number problem?

https://packagist.org/packages/drupal-composer/info-rewrite seems to support only Composer 1 and 2.

drumm’s picture

#3489066: Add tracking for when recipes from Drupal.org are applied might have this implemented in ComposerHelper::getPackageName(), not hooked up to update module yet.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.