Add manual trigger run and retry for CircleCI integration.
Review Request #11208 — Created Oct. 1, 2020 and submitted
Manual testing by adding a private GitHub repository with CircleCI integration,
checking and unchecking the "manually run" form checkbox to ensure that no
automated runs and done when a review request is made, and clicking the "Run"
button on the review request page.Verified the disabled/enabled run manually field by testing on Review Board
3.0.18, 3.0.19 and 4.0.x.Verified retry functionality when state is in ERROR and TIMEOUT states.
Unit tests have been written to verify that when the configuration is set,
the CircleCI request is not made. Another test to verify that a build is
run when the signal is emitted.
Summary | ID |
---|---|
34abce158aac41de7417d55a5a20c094c82edae6 |
Description | From | Last Updated |
---|---|---|
W293 blank line contains whitespace |
reviewbot | |
You'll need to add a load method override to this form that conditionally disables the manual run field depending on … |
david | |
Can we make the label "Run builds manually"? |
david | |
Why do we need to check if we should build again? It seems like if we shouldn't build the first … |
david | |
Can we add a blank line between these two? |
david | |
This comment doesn't add anything useful (the code is pretty clear that it's initializing variables) |
david | |
Grammar here is a little off. It sounds like it should probably have a plural "requests": "Don't build any review … |
david | |
This could all be combined together: return (bool(matching_configs), repository, vcs_type, matching_configs) |
david | |
F401 'reviewboard.reviews.signals.status_update_request_run' imported but unused |
reviewbot | |
F401 'reviewboard.reviews.signals.status_update_request_run' imported but unused |
reviewbot | |
F401 'reviewboard.reviews.signals.status_update_request_run' imported but unused |
reviewbot | |
These should use single quotes. Alternatively, Christian was suggesting we could do the import test once, up at the top … |
david | |
Given that we only need the should_build flag once now, let's remove it from the return tuple of this method … |
david | |
Can we clarify the method name here? Maybe test_manual_run_no_build_on_publish ? |
david | |
F401 'importlib' imported but unused |
reviewbot | |
F401 'importlib' imported but unused |
reviewbot | |
E501 line too long (80 > 79 characters) |
reviewbot | |
We still should have two blank lines here. |
david | |
I believe there should be a period at the end of every comment. |
jblazusi | |
I could be wrong about this when it is in regard to import statements, versus from ... import ... statements. … |
jblazusi | |
Please add a space between the = and \ |
david | |
Please put the """ on the next line here. |
david | |
Unlike docstrings everywhere else, docstrings for test cases shouldn't end in a period (since the test runner will append an … |
david | |
Same here. |
david | |
And here. |
david | |
And here. |
david |
- Description:
-
[WIP] Add manual trigger UI for CircleCI integration.
This change adds the ability for Integrations to run CircleCI manually.
A checkbox is added to the CircleCI form that indicates if CircleCI should only run manually. ~ Based on work by David Trobridge: /r/11130
~ Based on work by David Trowbridge: /r/11130
- Commits:
-
Summary ID 8e05b2c40ce97d0bd8227ec149a681dd34a9b5c1 602fb96e529ebdb73632f76e78ae979ff9ce7908
Checks run (2 succeeded)
- Change Summary:
-
Finalize this patch from [WIP] with unit tests
- Summary:
-
[WIP] Add manual trigger UI for CircleCI integration.Add manual trigger UI for CircleCI integration.
- Description:
-
~ [WIP] Add manual trigger UI for CircleCI integration.
~ Add manual trigger UI for CircleCI integration.
This change adds the ability for Integrations to run CircleCI manually.
A checkbox is added to the CircleCI form that indicates if CircleCI should only run manually. Based on work by David Trowbridge: /r/11130
+ + + for the unit tests to pass. - Testing Done:
-
Manual testing by adding a private GitHub repository with CircleCI integration,
checking and unchecking the "manually run" form checkbox to ensure that no automated runs and done when a review request is made, and clicking the "Run" button on the review request page. ~ Unit tests are TBD.
~ Unit test have been written to verify that when the configuration is set,
+ the CircleCI request is not made. - Commits:
-
Summary ID 602fb96e529ebdb73632f76e78ae979ff9ce7908 602fb96e529ebdb73632f76e78ae979ff9ce7908 0134b5a9a61a73bafb31883845cb817b10f4abec
Checks run (1 failed, 1 succeeded)
flake8
- Commits:
-
Summary ID 602fb96e529ebdb73632f76e78ae979ff9ce7908 0134b5a9a61a73bafb31883845cb817b10f4abec 602fb96e529ebdb73632f76e78ae979ff9ce7908 ab6cc12d9272509aed7199fef5722dc915ad3d56
Checks run (2 succeeded)
- Description:
-
Add manual trigger UI for CircleCI integration.
This change adds the ability for Integrations to run CircleCI manually.
A checkbox is added to the CircleCI form that indicates if CircleCI should only run manually. Based on work by David Trowbridge: /r/11130
~ ~ - for the unit tests to pass.
- Change Summary:
-
Update testing description with RB3 and RB4
- Description:
-
Add manual trigger UI for CircleCI integration.
This change adds the ability for Integrations to run CircleCI manually.
A checkbox is added to the CircleCI form that indicates if CircleCI should only run manually. Based on work by David Trowbridge: /r/11130
~ ~ - Testing Done:
-
Manual testing by adding a private GitHub repository with CircleCI integration,
checking and unchecking the "manually run" form checkbox to ensure that no automated runs and done when a review request is made, and clicking the "Run" button on the review request page. Unit test have been written to verify that when the configuration is set,
~ the CircleCI request is not made. ~ the CircleCI request is not made. These were ran on Review Board 3.0 and + Review Board 4.0 and their supported versions of Python.
- Change Summary:
-
Refactor code to reduce code duplication
- Commits:
-
Summary ID 602fb96e529ebdb73632f76e78ae979ff9ce7908 ab6cc12d9272509aed7199fef5722dc915ad3d56 602fb96e529ebdb73632f76e78ae979ff9ce7908 ab6cc12d9272509aed7199fef5722dc915ad3d56 680c67732ee6876cb4cc8b5e83892684f33edb08
Checks run (2 succeeded)
- Change Summary:
-
Add missing documentation
- Commits:
-
Summary ID 602fb96e529ebdb73632f76e78ae979ff9ce7908 ab6cc12d9272509aed7199fef5722dc915ad3d56 680c67732ee6876cb4cc8b5e83892684f33edb08 602fb96e529ebdb73632f76e78ae979ff9ce7908 ab6cc12d9272509aed7199fef5722dc915ad3d56 7712d48a9f836cc2a619671aa38ea8abb71ae01c
Checks run (2 succeeded)
- Change Summary:
-
Fix types in docstrings
- Commits:
-
Summary ID 602fb96e529ebdb73632f76e78ae979ff9ce7908 ab6cc12d9272509aed7199fef5722dc915ad3d56 7712d48a9f836cc2a619671aa38ea8abb71ae01c 602fb96e529ebdb73632f76e78ae979ff9ce7908 ab6cc12d9272509aed7199fef5722dc915ad3d56 bc1ded4209d7b5b807ebc58832aa5fe0cb079d38
Checks run (2 succeeded)
- Change Summary:
-
Fix diffset for manual run and add test for manual trigger.
- Testing Done:
-
Manual testing by adding a private GitHub repository with CircleCI integration,
checking and unchecking the "manually run" form checkbox to ensure that no automated runs and done when a review request is made, and clicking the "Run" button on the review request page. ~ Unit test have been written to verify that when the configuration is set,
~ the CircleCI request is not made. These were ran on Review Board 3.0 and ~ Review Board 4.0 and their supported versions of Python. ~ Unit tests have been written to verify that when the configuration is set,
~ the CircleCI request is not made. Another test to verify that a build is ~ run when the signal is emitted. - Commits:
-
Summary ID 602fb96e529ebdb73632f76e78ae979ff9ce7908 ab6cc12d9272509aed7199fef5722dc915ad3d56 bc1ded4209d7b5b807ebc58832aa5fe0cb079d38 602fb96e529ebdb73632f76e78ae979ff9ce7908 ab6cc12d9272509aed7199fef5722dc915ad3d56 bc1ded4209d7b5b807ebc58832aa5fe0cb079d38 15a2958e03b0e3cb8cfc8cb567e8b1088cdd52cf
Checks run (2 succeeded)
- Change Summary:
-
Minor documentation fixup
- Commits:
-
Summary ID 602fb96e529ebdb73632f76e78ae979ff9ce7908 ab6cc12d9272509aed7199fef5722dc915ad3d56 bc1ded4209d7b5b807ebc58832aa5fe0cb079d38 15a2958e03b0e3cb8cfc8cb567e8b1088cdd52cf 602fb96e529ebdb73632f76e78ae979ff9ce7908 ab6cc12d9272509aed7199fef5722dc915ad3d56 bc1ded4209d7b5b807ebc58832aa5fe0cb079d38 70117a48bb63a1c22f484715cc316232f0bc5655
Checks run (2 succeeded)
- Change Summary:
-
Attached demo video in Description
- Description:
-
Add manual trigger UI for CircleCI integration.
This change adds the ability for Integrations to run CircleCI manually.
A checkbox is added to the CircleCI form that indicates if CircleCI should only run manually. + Watch the demo video here
+ Based on work by David Trowbridge: /r/11130
-
-
You'll need to add a
load
method override to this form that conditionally disables the manual run field depending on the version of Review Board that it's running on. See the version in Review Bot for an example. -
-
Why do we need to check if we should build again? It seems like if we shouldn't build the first time, we'd never even end up creating a status update which can be run/retried.
-
-
This comment doesn't add anything useful (the code is pretty clear that it's initializing variables)
-
Grammar here is a little off. It sounds like it should probably have a plural "requests": "Don't build any review requests that don't have matching configs"
-
This could all be combined together:
return (bool(matching_configs), repository, vcs_type, matching_configs)
- Change Summary:
-
Address feedback
- Commits:
-
Summary ID 602fb96e529ebdb73632f76e78ae979ff9ce7908 ab6cc12d9272509aed7199fef5722dc915ad3d56 bc1ded4209d7b5b807ebc58832aa5fe0cb079d38 70117a48bb63a1c22f484715cc316232f0bc5655 bf3f5aef58e0a647b2d88dbe2aeabf7bc1028bf4
- Change Summary:
-
Fix typo
- Commits:
-
Summary ID bf3f5aef58e0a647b2d88dbe2aeabf7bc1028bf4 5981de035bbea6e0933866dfb7b8a0cce108d6a6
- Change Summary:
-
Ignore unused import with inline comment
- Commits:
-
Summary ID 5981de035bbea6e0933866dfb7b8a0cce108d6a6 1506ddf20b2119776611879053fe1b964e935471
- Change Summary:
-
Fix typo in can_retry extra_data
- Summary:
-
Add manual trigger UI for CircleCI integration.Add manual trigger run and retry for CircleCI integration.
- Testing Done:
-
Manual testing by adding a private GitHub repository with CircleCI integration,
checking and unchecking the "manually run" form checkbox to ensure that no automated runs and done when a review request is made, and clicking the "Run" button on the review request page. + Verified the disabled/enabled run manually field by testing on Review Board
+ 3.0.18, 3.0.19 and 4.0.x. + + Verified retry functionality when state is in ERROR and TIMEOUT states.
+ Unit tests have been written to verify that when the configuration is set,
the CircleCI request is not made. Another test to verify that a build is run when the signal is emitted. - Commits:
-
Summary ID 1506ddf20b2119776611879053fe1b964e935471 b8f547653bbf76402e9c0f143852c677ad766c08
Checks run (2 succeeded)
-
-
These should use single quotes.
Alternatively, Christian was suggesting we could do the import test once, up at the top of the file:
try: from reviewboard.reviews.signals import status_update_request_run except ImportError: status_update_request_run = None
and then here:
if status_update_request_run is None: self.disabled_fields = ['run_manually'] ...
This has the advantage of only doing the import check once, though this form is very rarely accessed so it's probably not important either way. Your call if you want to change it.
-
Given that we only need the
should_build
flag once now, let's remove it from the return tuple of this method and then where we use it, we can define it usingbool(matching_configs)
.This is important here because of the
_
. Unfortunately for us,_
has two meanings: it's common to use it in python for unused return values, but we also often use it to name the ugettext import. This line could redefine the ugettext function as whatever the return value was (at least for the scope of this method). This is error-prone, so because we can avoid it entirely, we should. -
- Change Summary:
-
Address David's comments
- Commits:
-
Summary ID b8f547653bbf76402e9c0f143852c677ad766c08 41cb5f1af90573f7ce6306723dcde49c367c1d15
- Commits:
-
Summary ID 41cb5f1af90573f7ce6306723dcde49c367c1d15 25be84789281f82311f930f0bcf429cc8050b2b1
- Change Summary:
-
Address ReviewBot issues
- Commits:
-
Summary ID 25be84789281f82311f930f0bcf429cc8050b2b1 552f4c77cb3ded0430dd17eac139d3e2ab82f6d1
Checks run (2 succeeded)
-
Awesome Work!
Unfortunately, I experienced a test failure for test #86 Testing circleCIIntegration build via a manual trigger.
I am not sure why this is the case. The steps I took for this was:1)
git checkout -b circleci
from the master branch in rbintegrations repo.
2)rbt patch -c 11208
successfully pulled downed the patch and committed the files.
3)./setup develop
successfully ran
4)rbtext test -m rbintegrations.circleci
this is where I had a test fail, am I invoking this correctly?Otherwise, I just found some small styling comments, but I am not even completely sure whether they are correct.
-
-
I could be wrong about this when it is in regard to
import
statements, versusfrom ... import ...
statements. But I think thatfrom datetime import datetime
should come beforeimport json
to preserve alphabetical order. However, please correct me if I am wrong in this specific case.
- Change Summary:
-
Address feedback
- Commits:
-
Summary ID 552f4c77cb3ded0430dd17eac139d3e2ab82f6d1 d12d7c9dbdb1d09a59cbb15230facb0383228557
Checks run (2 succeeded)
- Change Summary:
-
Adjust docstrings
- Commits:
-
Summary ID d12d7c9dbdb1d09a59cbb15230facb0383228557 d8d34e403f626c617076e6c36b16339e65ccea55