Skip to content

Commit

Permalink
fix(github): send null job_id to fix 422 during resubmission (#269)
Browse files Browse the repository at this point in the history
If a submission is failed, the tool will check and adjust/resubmit
again with a newly generated job_id. For GitHub Actions, this needs
to be null again.
  • Loading branch information
vchrombie authored Mar 2, 2021
1 parent f42e10a commit 54be754
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions coveralls/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,14 @@ def wear(self, dry_run=False):
# attach a random value to ensure uniqueness
# TODO: an auto-incrementing integer might be easier to reason
# about if we could fetch the previous value
new_id = '{}-{}'.format(
self.config.get('service_job_id', 42),
random.randint(0, sys.maxsize))
# N.B. Github Actions fails if this is not set to null.
# Other services fail if this is set to null. Sigh x2.
if os.environ.get('GITHUB_REPOSITORY'):
new_id = None
else:
new_id = '{}-{}'.format(
self.config.get('service_job_id', 42),
random.randint(0, sys.maxsize))
print('resubmitting with id {}'.format(new_id))

self.config['service_job_id'] = new_id
Expand Down

0 comments on commit 54be754

Please sign in to comment.