ktomk / pipelines

Pipelines - Run Bitbucket Pipelines Wherever They Dock
https://ktomk.github.io/pipelines/
GNU Affero General Public License v3.0
109 stars 10 forks source link

PHP Deprecated: trim(): ... no pipeline to run! #21

Open billyromano opened 2 years ago

billyromano commented 2 years ago

Just installed pipelines today and I'm brand new to this util. I've installed it using phive on macOS and setup my pipelines executable globally. I do have a bitbucket-pipelines.yml file setup and configured correctly. When just running the pipelines command with no additional flags in the same folder as the yaml file, it fails showing this error:

PHP Deprecated:  trim(): Passing null to parameter #1 ($string) of type string is deprecated in phar:///Users/user/.phive/phars/pipelines/vendor/ktomk/symfony-yaml/Inline.php on line 49

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in phar:///Users/user/.phive/phars/pipelines/vendor/ktomk/symfony-yaml/Inline.php on line 49
PHP Deprecated:  trim(): Passing null to parameter #1 ($string) of type string is deprecated in phar:///Users/user/.phive/phars/pipelines/vendor/ktomk/symfony-yaml/Inline.php on line 49

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in phar:///Users/user/.phive/phars/pipelines/vendor/ktomk/symfony-yaml/Inline.php on line 49
PHP Deprecated:  trim(): Passing null to parameter #1 ($string) of type string is deprecated in phar:///Users/user/.phive/phars/pipelines/vendor/ktomk/symfony-yaml/Inline.php on line 49

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in phar:///Users/user/.phive/phars/pipelines/vendor/ktomk/symfony-yaml/Inline.php on line 49
PHP Deprecated:  trim(): Passing null to parameter #1 ($string) of type string is deprecated in phar:///Users/user/.phive/phars/pipelines/vendor/ktomk/symfony-yaml/Inline.php on line 49

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in phar:///Users/user/.phive/phars/pipelines/vendor/ktomk/symfony-yaml/Inline.php on line 49
PHP Deprecated:  trim(): Passing null to parameter #1 ($string) of type string is deprecated in phar:///Users/user/.phive/phars/pipelines/vendor/ktomk/symfony-yaml/Inline.php on line 49

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in phar:///Users/user/.phive/phars/pipelines/vendor/ktomk/symfony-yaml/Inline.php on line 49
PHP Deprecated:  trim(): Passing null to parameter #1 ($string) of type string is deprecated in phar:///Users/user/.phive/phars/pipelines/vendor/ktomk/symfony-yaml/Inline.php on line 49

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in phar:///Users/user/.phive/phars/pipelines/vendor/ktomk/symfony-yaml/Inline.php on line 49
PHP Deprecated:  trim(): Passing null to parameter #1 ($string) of type string is deprecated in phar:///Users/user/.phive/phars/pipelines/vendor/ktomk/symfony-yaml/Inline.php on line 49

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in phar:///Users/user/.phive/phars/pipelines/vendor/ktomk/symfony-yaml/Inline.php on line 49
PHP Deprecated:  trim(): Passing null to parameter #1 ($string) of type string is deprecated in phar:///Users/user/.phive/phars/pipelines/vendor/ktomk/symfony-yaml/Inline.php on line 49

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in phar:///Users/user/.phive/phars/pipelines/vendor/ktomk/symfony-yaml/Inline.php on line 49
PHP Deprecated:  trim(): Passing null to parameter #1 ($string) of type string is deprecated in phar:///Users/user/.phive/phars/pipelines/vendor/ktomk/symfony-yaml/Inline.php on line 49

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in phar:///Users/user/.phive/phars/pipelines/vendor/ktomk/symfony-yaml/Inline.php on line 49
PHP Deprecated:  trim(): Passing null to parameter #1 ($string) of type string is deprecated in phar:///Users/user/.phive/phars/pipelines/vendor/ktomk/symfony-yaml/Inline.php on line 49

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in phar:///Users/user/.phive/phars/pipelines/vendor/ktomk/symfony-yaml/Inline.php on line 49
PHP Deprecated:  trim(): Passing null to parameter #1 ($string) of type string is deprecated in phar:///Users/user/.phive/phars/pipelines/vendor/ktomk/symfony-yaml/Inline.php on line 49

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in phar:///Users/user/.phive/phars/pipelines/vendor/ktomk/symfony-yaml/Inline.php on line 49
PHP Deprecated:  trim(): Passing null to parameter #1 ($string) of type string is deprecated in phar:///Users/user/.phive/phars/pipelines/vendor/ktomk/symfony-yaml/Inline.php on line 49

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in phar:///Users/user/.phive/phars/pipelines/vendor/ktomk/symfony-yaml/Inline.php on line 49
PHP Deprecated:  trim(): Passing null to parameter #1 ($string) of type string is deprecated in phar:///Users/user/.phive/phars/pipelines/vendor/ktomk/symfony-yaml/Inline.php on line 49

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in phar:///Users/user/.phive/phars/pipelines/vendor/ktomk/symfony-yaml/Inline.php on line 49
PHP Deprecated:  trim(): Passing null to parameter #1 ($string) of type string is deprecated in phar:///Users/user/.phive/phars/pipelines/vendor/ktomk/symfony-yaml/Inline.php on line 49

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in phar:///Users/user/.phive/phars/pipelines/vendor/ktomk/symfony-yaml/Inline.php on line 49
pipelines: no pipeline to run!

🙋🏻‍♂️How do I fix this deprecation issue?

PHP Info

php --version
PHP 8.1.8 (cli) (built: Jul  8 2022 12:51:36) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.8, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.8, Copyright (c), by Zend Technologies
ktomk commented 2 years ago

hello, and thanks for reporting this! @billyromano

the deprecation warning was caused by a regression in april this year and next version 0.0.67 will have it fixed.

to address the

pipelines: no pipeline to run!

message, please provide your bitbucket-pipelines.yml file in question, link to a gist is fine, if possible. the pipelines utility has some edge cases parsing the yaml file and I suspect this is the case here so that the default pipeline is not found. having the file would help to clarify on that (often there is an easy work-around).

ktomk commented 2 years ago

version 0.0.67 has been released. you can update it already with phive (e.g. phive update pipelines).

that should remove the deprecation messages. the yaml file would still help me to add a regression test so that I don't tap into mistakes as the one that happened.

I leave this issue open as I'm pretty sure that the

pipelines: no pipeline to run!

message still is the case with 0.0.67 and the bitbucket-pipelines.yml file.

billyromano commented 2 years ago

I just updated to 0.0.67 and here's the new issues showing up:

PHP Deprecated:  Return type of Ktomk\Pipelines\Value\Env\EnvFile::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///Users/user/.phive/phars/pipelines/src/Value/Env/EnvFile.php on line 54

Deprecated: Return type of Ktomk\Pipelines\Value\Env\EnvFile::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///Users/user/.phive/phars/pipelines/src/Value/Env/EnvFile.php on line 54
PHP Deprecated:  Return type of Ktomk\Pipelines\Value\Env\EnvFile::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///Users/user/.phive/phars/pipelines/src/Value/Env/EnvFile.php on line 49

Deprecated: Return type of Ktomk\Pipelines\Value\Env\EnvFile::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///Users/user/.phive/phars/pipelines/src/Value/Env/EnvFile.php on line 49
pipelines: no pipeline to run!

Here's my bitbucket-pipelines.yml file for your reference:

pipelines:
    branches:
        develop:
            -
                step:
                    name:       Deploy Node.js App to Azure
                    deployment: staging
                    script:
                        -
                            pipe: microsoft/azure-static-web-apps-deploy:main
                            variables:
                                REQUIRED_OS_PACKAGES: nasm
                                APP_LOCATION:         '$BITBUCKET_CLONE_DIR'
#                                API_LOCATION:         '$BITBUCKET_CLONE_DIR/src/pages/api'
                                OUTPUT_LOCATION:      '$BITBUCKET_CLONE_DIR/out'
                                APP_BUILD_COMMAND:    'yarn build:staging'
                                API_TOKEN:            $deployment_token
ktomk commented 2 years ago

I'll address that one as well with the next release. It is not the cause of the message thought.

Your bitbucket-pipelines.yml file has no default pipeline which would be run. see --pipeline and/or --trigger.

However mind that pipe is not fully implemented.

billyromano commented 2 years ago

Ok that makes sense now 🙂

I'll make sure to update and use default instead of branches for my testing.

When do you think the pipe structure will be implemented? This is the main thing I need to test for my setup. I'm trying to figure out why Bitbucket running this pipeline doesn't show images in Azure, but running this pipeline locally through Docker the images show up fine. I think it's an image file permissions issue, but I'm not sure yet.

duffar commented 2 years ago

I see lots of similar errors as @billyromano - even when issuing a simple $ pipelines --version command. I'm using PHP 8.1.9:

PHP 8.1.9 (cli) (built: Aug  4 2022 15:11:08) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.9, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.9, Copyright (c), by Zend Technologies
$ pipelines --version
PHP Deprecated:  Return type of Ktomk\Pipelines\Cli\Args\OptionFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/jeffryan/.composer/vendor/ktomk/pipelines/src/Cli/Args/OptionFilterIterator.php on line 67

Deprecated: Return type of Ktomk\Pipelines\Cli\Args\OptionFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/jeffryan/.composer/vendor/ktomk/pipelines/src/Cli/Args/OptionFilterIterator.php on line 67
PHP Deprecated:  Return type of Ktomk\Pipelines\Cli\Args\OptionIterator::rewind() should either be compatible with IteratorIterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/jeffryan/.composer/vendor/ktomk/pipelines/src/Cli/Args/OptionIterator.php on line 106

Deprecated: Return type of Ktomk\Pipelines\Cli\Args\OptionIterator::rewind() should either be compatible with IteratorIterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/jeffryan/.composer/vendor/ktomk/pipelines/src/Cli/Args/OptionIterator.php on line 106
PHP Deprecated:  Return type of Ktomk\Pipelines\Cli\Args\OptionIterator::valid() should either be compatible with IteratorIterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/jeffryan/.composer/vendor/ktomk/pipelines/src/Cli/Args/OptionIterator.php on line 92
...

I updated to the latest 0.0.67 version but am getting the same issue. Things worked fine earlier so I am wondering if I updated a dependency... like php

ktomk commented 2 years ago

@duffar: Yes, that are deprecation warnings from PHP 8.1. Can you share which operating system / distro you're using? And thanks for reporting. Next version should have less noise if not getting completely rid of the warnings.