projectsyn/commodore

Exit code is 0 when catalog cannot be pushed

mhutter opened this issue · 1 comments

When commodore can clone the cluster-catalog but not push to it, the command still exits without an error.

Since we use commodore in Gitlab pipelines, the pipeline is marked as "successful" even though no push to the catalog occurred.

See Jira ticket for example

Steps to Reproduce the Problem

  1. set up an access token that can clone the cluster-catalog but cannot push to the main/master branch
  2. run commodore with a change

Actual Behavior

commodore exits with code 0

Logs:

 > Commiting changes...
 > Pushing catalog to remote...
Error lines received while fetching: error: failed to push some refs to 'https://gitlab-ci-token:[MASKED]@....git'
Catalog compiled! 🎉

Expected Behavior

commodore exits with a code != 0

simu commented

Found the issue: we're currently not checking the result of the push to the catalog repo in

repo.remotes.origin.push()