IonBazan / composer-diff

Compares composer.lock changes and generates Markdown report so you can use it in PR description.
https://packagist.org/packages/ion-bazan/composer-diff
MIT License
143 stars 6 forks source link

Don't ignore ref changes in packages with dev-branch versions #9

Closed trakos closed 3 years ago

trakos commented 3 years ago

Hey 🙂

we've noticed that commit changes don't show up in composer diff. If someone stays on the same branch version, but updates the package, it won't show up in diff. I think it's worth showing all differences, so I propose a simple change to show it.

Method getPrettyVersion I've used seems to be added quite early to composer, before stable 1.0, so it should be fine? https://github.com/composer/composer/commit/99dab8aebdef0f833294268af026069f6f1368cf

Before:

image

After:

image

Also, I've updated the test composer.jsons to have roave/security-advisory, since that's the package I've happened to notice that with. I guess it's a good example, because it doesn't have any versions, yet is quite popular: https://packagist.org/packages/roave/security-advisories . I've run:

cd tests/fixtures/base
composer require 'roave/security-advisories:dev-master#ac36586'
cd ../target
composer require 'roave/security-advisories:dev-master#3c97c13'

Thanks!

codecov[bot] commented 3 years ago

Codecov Report

Merging #9 (be74acb) into main (a968372) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##                main        #9   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
  Complexity       162       162           
===========================================
  Files             19        19           
  Lines            430       430           
===========================================
  Hits             430       430           
Impacted Files Coverage Δ
src/PackageDiff.php 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update a968372...be74acb. Read the comment docs.

IonBazan commented 3 years ago

Looks good, thanks!