Skip to content

BUG: Uncaught TypeError is thrown when the target repository has an unpublished/draft release. #68

@hop-along-polly

Description

@hop-along-polly

I found this error when I tried creating a new release before having published the previous release. For those forgetful human beings in the world, such as myself, the error should probably be handled better and tell the user the process failed because they have a draft release waiting to be published.

PHP Notice: Undefined index: commits in /home/derek/projects/release-notes/src/GithubClient.php on line 103
PHP Stack trace:
PHP 1. {main}() /home/derek/projects/release-notes/bin/buildRelease:0
PHP 2. Symfony\Component\Console\Application->run() /home/derek/projects/release-notes/bin/buildRelease:20
PHP 3. Symfony\Component\Console\Application->doRun() /home/derek/projects/release-notes/vendor/symfony/console/Application.php:123
PHP 4. Symfony\Component\Console\Application->doRunCommand() /home/derek/projects/release-notes/vendor/symfony/console/Application.php:192
PHP 5. Symfony\Component\Console\Command\Command->run() /home/derek/projects/release-notes/vendor/symfony/console/Application.php:844
PHP 6. Guywithnose\ReleaseNotes\BuildRelease->execute() /home/derek/projects/release-notes/vendor/symfony/console/Command/Command.php:259
PHP 7. Guywithnose\ReleaseNotes\BuildRelease->_buildRelease() /home/derek/projects/release-notes/src/BuildRelease.php:85
PHP 8. Guywithnose\ReleaseNotes\BuildRelease->_getChangesInRange() /home/derek/projects/release-notes/src/BuildRelease.php:198
PHP 9. Guywithnose\ReleaseNotes\GithubClient->getCommitsInRange() /home/derek/projects/release-notes/src/BuildRelease.php:210
PHP 10. Guywithnose\ReleaseNotes\GithubClient->getCommitsSinceTag() /home/derek/projects/release-notes/src/GithubClient.php:87
PHP Fatal error: Uncaught TypeError: Argument 1 passed to Guywithnose\ReleaseNotes\GithubCommitGraph::__construct() must be of the type array, null given, called in /home/derek/projects/release-notes/src/BuildRelease.php on line 210 and defined in /home/derek/projects/release-notes/src/GithubCommitGraph.php:16
Stack trace:
#0 /home/derek/projects/release-notes/src/BuildRelease.php(210): Guywithnose\ReleaseNotes\GithubCommitGraph->__construct(NULL)
#1 /home/derek/projects/release-notes/src/BuildRelease.php(198): Guywithnose\ReleaseNotes\BuildRelease->_getChangesInRange(Object(Guywithnose\ReleaseNotes\GithubClient), 'vtest', 'master')
#2 /home/derek/projects/release-notes/src/BuildRelease.php(85): Guywithnose\ReleaseNotes\BuildRelease->_buildRelease(Object(Symfony\Component\Console\Input\ArgvInput), Object(Guywithnose\ReleaseNotes\GithubClient), 'master', 'vtest')
#3 /home/derek/projects/release-notes/vendor/symfony/console/Command/Command.php(259): Guywithnose\ReleaseNotes\BuildRelease->execute(Object(Symfony\Component\Console in /home/derek/projects/release-notes/src/GithubCommitGraph.php on line 16

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions