scout-apm-php icon indicating copy to clipboard operation
scout-apm-php copied to clipboard

CI: "roave-backwards-compatibility-check" should not be run if "github.base_ref" not set

Open asgrim opened this issue 3 years ago • 1 comments

Currently roave-backwards-compatibility-check runs always, but because the script wrapper we have, which swallows errors (which is a problem in itself), we don't notice when github.base_ref is not set.

Example:

https://github.com/scoutapp/scout-apm-php/actions/runs/3461969241/jobs/5780869417

  .github/workflows/roave-backwards-compatibility-check.sh --install-development-dependencies --from=origin/
  shell: /usr/bin/bash -e {0}
  env:
    COMPOSER_PROCESS_TIMEOUT: 0
    COMPOSER_NO_INTERACTION: 1
    COMPOSER_NO_AUDIT: 1
Running BC check, please wait...

In execute.php line 156:
                                                                               
  Shell command "git 'rev-parse' 'origin/'" returned an exit code of "128".    
                                                                               
  STDOUT:                                                                      
      origin/                                                                  
                                                                               
                                                                               
  STDERR:                                                                      
      fatal: ambiguous argument 'origin/': unknown revision or path not in the working tree.                                                              
      Use '--' to separate paths from revisions, like this:                    
      'git <command> [<revision>...] -- [<file>...]'                           
                                                                               

roave-backwards-compatibility-check:assert-backwards-compatible [--from [FROM]] [--to TO] [--format [FORMAT]] [--install-development-dependencies]
Lines with [BC] not filtered: 0
Stated breaks: roave-backwards-compatibility-check:assert-backwards-compatible out of expected 2
EXIT 0

Two things to fix here:

  • The wrapper script should fail if the tool fails (to avoid false positives)
  • The CI job should be skipped if github.base_ref is not set

asgrim avatar Nov 14 '22 14:11 asgrim

Note: roave-backwards-compatibility-check.sh script can probably be dropped now too.

asgrim avatar Nov 16 '22 10:11 asgrim