TreewareEarth / plant

Composer plugin that bothers the consumer of Treeware packages.
MIT License
13 stars 0 forks source link

Show tree count in the composer message #1

Closed jamesmills closed 3 years ago

jamesmills commented 3 years ago

This will get the total trees in the Treeware forest for all packages using Treeware

https://api.ecologi.com/users/treeware/trees'

This is what we use to get a count for a specific package

$response = (new Client())->request('get', 'https://api.ecologi.com/users/treeware/trees', [
                'query' => [
                    'ref' => md5(Str::lower($package->owner . '/' . $package->package_name)),
                ],
            ]);
ostark commented 3 years ago

https://github.com/TreewareEarth/plant/blob/main/tests/__snapshots__/OutputTest__package_list_of_command__1.txt Added in https://github.com/TreewareEarth/plant/commit/7f1ed40643613f7ec9f88a87bc0bb5fdff963788

jamesmills commented 3 years ago

I've just run a test install of a package using this package but I didn't get the above message. Am I missing something?

ostark commented 3 years ago

The test mocks the actual API call and the real integration wasn't tested.

ostark commented 3 years ago

The "tree count" output is visible for the composer treeware command only.

Intention: It involves API calls. Running them during the actual composer require / update is risky to me. It's shouldn't break, but it could.

jamesmills commented 3 years ago

Makes sense, thanks.