-
Notifications
You must be signed in to change notification settings - Fork 31
CDSK-904 - add codebases_arg to Trigger links #354
CDSK-904 - add codebases_arg to Trigger links #354
Conversation
882b17a
to
6c0fc1f
Compare
|
||
self.assertEqual(len(trigger_step_status.urls), 1) | ||
self.assertEqual(len(trigger_links), 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we check this link? I mean checking the assertion value of the trigger_links
element.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can see 1 problem with checking values of trigger_links
- trigger_links[0] is not a string but is a 3-elements tuple. Data for this tuple comes from stubbed method getURLForBuild (+codebase_arg). And if I start checking values I won't do an unittest for real tuple but stub tuple
Maybe I should check if this tuple has exactly 3 elements instead of checking values?
brids = self.build.brids | ||
db_results = yield self.build.builder.master.db.buildrequests\ | ||
.getBuildRequestForStartbrids(brids) | ||
master = self.build.builder.master | ||
for build in db_results: | ||
friendly_name = master.status.getFriendlyName(build['buildername']) | ||
url = master.status.getURLForBuild(build['buildername'], build['number'], | ||
url = master.status.getURLForBuild(build['buildername'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to pass codebases_arg
to the getURLForBuild
method?
I think that since this method prepares URL already, we can add codebase_arg
as nonrequired parameter and delegate to it the whole URL building process including GET parameters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about it but getURLForBuild
has already +getCodebasesArg(sourcestamps=sourcestamps)
If I add next parameter codebase_arg
I need to do something with this computation of getCodebasesArg
.
And then which parameter is more important? Can I use sourcestamps
and codebase_arg
together or not? Should I merge this 2 parameters before creating url params?
The simplest way was joining url with codebases_arg in prepare_trigger_links
master/buildbot/status/buildstep.py
Outdated
@@ -380,27 +380,28 @@ def upgradeToVersion5(self): | |||
self.wasUpgraded = True | |||
|
|||
@defer.inlineCallbacks | |||
def prepare_trigger_links(self): | |||
def prepare_trigger_links(self, codebases_arg): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: It would be nice to add a docstring
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
d3da1b6
to
3894214
Compare
Add missing codebase_arg