Update for changes in Travis CI's webhook payload format.

Review Request #10970 — Created March 26, 2020 and submitted

Information

rbintegrations
release-1.0.x
9ab860b...

Reviewers

Travis CI has made some changes to their webhook payload. These are
currently effective on travis-ci.com, and will likely be making it to
travis-ci.org soon.

The biggest of these is that the global_env key is completely gone.
There's a top-level env key, but that's in a weird hard-to-parse
format. I've changed it to pull the relevant keys out of the matrix data
instead.

Second, I was encountering a new errored state for some builds. I've
added handling for this and logging for any future states which we don't
handle.

Posted some changes that triggered Travis CI builds and saw the webhook
handler work correctly.

Description From Last Updated

Can you add unit tests for the configuration parsing, errors around it, and the error states?

chipx86chipx86

Can we also end up with an IndexError due to the [0]?

chipx86chipx86

It'd be nice to have something in here to reference maybe the build, or configuration, or something. Otherwise we have …

chipx86chipx86

E501 line too long (80 > 79 characters)

reviewbotreviewbot

F811 redefinition of unused 'test_webhook_bad_integration_config' from line 371

reviewbotreviewbot

E501 line too long (80 > 79 characters)

reviewbotreviewbot
chipx86
  1. 
      
  2. Show all issues

    Can you add unit tests for the configuration parsing, errors around it, and the error states?

  3. rbintegrations/travisci/views.py (Diff revision 1)
     
     
     
     
    Show all issues

    Can we also end up with an IndexError due to the [0]?

  4. rbintegrations/travisci/views.py (Diff revision 1)
     
     
     
    Show all issues

    It'd be nice to have something in here to reference maybe the build, or configuration, or something. Otherwise we have little to go off of for reproducing.

  5. 
      
david
Review request changed
Change Summary:

Add unit tests.

Commit:
edc37a20a9e366de882005f5529108b0bf5037e7
0c1762ed4710a734a5ee5dd3b66b7a0eca12398d

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

david
chipx86
  1. Ship It!
  2. 
      
david
Review request changed
Status:
Completed
Change Summary:
Pushed to release-1.0.x (6db9ab3)