Diff URLs truncated
xurizaemon opened this issue · 4 comments
Just testing this out (thanks!) and noticed that some of the URLs provided for compare are truncated. Eg:
| drupal/entity_reference_revisions | 1.7.0 | 1.8.0 | https://git.drupalcode.org/project/entity_reference_revisions/compare/8.x-1.7...8.x-1.8 |
| drupal/fast_404 | 1.0.0-alpha4 | 1.0.0-alpha5 | https://git.drupalcode.org/project/fast_404/compare/8.x-1.0.0-alph...8.x-1.0.0-alph |
| drupal/page_manager | 4.0.0-beta4 | 4.0.0-beta5 | https://git.drupalcode.org/project/page_manager/compare/8.x-4.0.0-bet...8.x-4.0.0-bet |
| drupal/views_data_export | 1.0.0-beta4 | 1.0.0-rc1 | https://git.drupalcode.org/project/views_data_export/compare/8.x-1.0.0-bet...8.x-1.0.0-r |
(I've intentionally excerpted to show a single correct URL and some that are not working links.)
These output URLs do not provide comparison views correctly, while most do:
- https://git.drupalcode.org/project/fast_404/compare/8.x-1.0.0-alph...8.x-1.0.0-alph
- https://git.drupalcode.org/project/page_manager/compare/8.x-4.0.0-bet...8.x-4.0.0-bet
- https://git.drupalcode.org/project/views_data_export/compare/8.x-1.0.0-bet...8.x-1.0.0-r
In worst case this might result in deceptive output (eg diff vs -beta1 links to -beta, or diff vs -beta11 links to -beta1).
tput cols returns 236; these are not shortened due to limitations of the console AFAICT. See screenshot below.
The cause isn't obvious to me either. It would be remiss to not share this E_NOTICE output, even though I don't think it's related.
PHP Notice: Undefined property: stdClass::$source in /vagrant/.composer/vendor/davidrjonas/composer-lock-diff/composer-lock-diff on line 212
PHP Stack trace:
PHP 1. {main}() /vagrant/.composer/vendor/davidrjonas/composer-lock-diff/composer-lock-diff:0
PHP 2. diff() /vagrant/.composer/vendor/davidrjonas/composer-lock-diff/composer-lock-diff:9
PHP 3. makeCompareUrl() /vagrant/.composer/vendor/davidrjonas/composer-lock-diff/composer-lock-diff:65
PHP Notice: Trying to get property 'url' of non-object in /vagrant/.composer/vendor/davidrjonas/composer-lock-diff/composer-lock-diff on line 212
PHP Stack trace:
PHP 1. {main}() /vagrant/.composer/vendor/davidrjonas/composer-lock-diff/composer-lock-diff:0
PHP 2. diff() /vagrant/.composer/vendor/davidrjonas/composer-lock-diff/composer-lock-diff:9
PHP 3. makeCompareUrl() /vagrant/.composer/vendor/davidrjonas/composer-lock-diff/composer-lock-diff:65
(that appears twice in the output, but not as many times as there are truncated URLs, therefore I doubt it's the cause ... but it is coming from makeCompareUrl so maybe I'm wrong!)
If I can't track the problem down I'll attach a sample composer.json & lock to demo 😁
The truncation is strange. The second line of your example is truncated at 14 characters and the next two are at 13. The only place in the code that manipulates the version received from the lock files is 75 and that truncates to 7 places for git hashes. Can you provide the source files?
Also, are you using a current version? Line 212 is
return call_user_func($func, @$pkg->source->url, $diff[$pkg->name][0], $diff[$pkg->name][1]);
The @ should suppress those notices.
I think this is corrected with the changes to drupalcode handling in 1.6.0. Please reopen if it is not.
