)]}'
{"doc/source/examples.rst":[{"author":{"_account_id":6987,"name":"Khai Do","email":"zaro0508@gmail.com","username":"zaro0508"},"change_message_id":"2ca28771d1d1c11845d9d132b852d09278814929","unresolved":false,"context_lines":[{"line_number":153,"context_line":""},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"Example 9: Working with Build Promotions"},{"line_number":156,"context_line":"-------------------------------------"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"Requires the `Promoted Builds Plugin"},{"line_number":159,"context_line":"\u003chttps://wiki.jenkins-ci.org/display/JENKINS/Promoted+Builds+Plugin\u003e`_"}],"source_content_type":"text/x-rst","patch_set":2,"id":"fa69d971_2c7f50ac","line":156,"updated":"2016-01-06 00:41:32.000000000","message":"nit: need a few more dashes here","commit_id":"013187edb644a7c81b20ea0df4341e9ab7056e73"},{"author":{"_account_id":9943,"name":"Guido Günther","email":"agx@sigxcpu.org","username":"agx"},"change_message_id":"c651acf4757269336cbcb58df1a5756c9713dd53","unresolved":false,"context_lines":[{"line_number":153,"context_line":""},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"Example 9: Working with Build Promotions"},{"line_number":156,"context_line":"-------------------------------------"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"Requires the `Promoted Builds Plugin"},{"line_number":159,"context_line":"\u003chttps://wiki.jenkins-ci.org/display/JENKINS/Promoted+Builds+Plugin\u003e`_"}],"source_content_type":"text/x-rst","patch_set":2,"id":"da6ed579_021bae73","line":156,"in_reply_to":"fa69d971_2c7f50ac","updated":"2016-01-12 17:46:53.000000000","message":"Done","commit_id":"013187edb644a7c81b20ea0df4341e9ab7056e73"},{"author":{"_account_id":6987,"name":"Khai Do","email":"zaro0508@gmail.com","username":"zaro0508"},"change_message_id":"2ca28771d1d1c11845d9d132b852d09278814929","unresolved":false,"context_lines":[{"line_number":163,"context_line":""},{"line_number":164,"context_line":"::"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"    server.create_promotion(\u0027passed_qa\u0027, \u0027foo\u0027, xml)"},{"line_number":167,"context_line":"    server.promotion_exists(\u0027passed_qa\u0027, \u0027foo\u0027)"},{"line_number":168,"context_line":"    print server.get_promotions(\u0027foo\u0027)"},{"line_number":169,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"fa69d971_eeb36298","line":166,"updated":"2016-01-06 00:41:32.000000000","message":"what is \u0027xml\u0027 object here?  I think a more complete example would be to go thru the process of creating a job then create a promotion from that job.  Also it would be nice to create a sample \u0027PROMO_XML\u0027 object and reference it like it\u0027s done for the create job example (line 42).","commit_id":"013187edb644a7c81b20ea0df4341e9ab7056e73"},{"author":{"_account_id":6987,"name":"Khai Do","email":"zaro0508@gmail.com","username":"zaro0508"},"change_message_id":"5fc86183f987caa584e7aab33dd4e835db04511a","unresolved":false,"context_lines":[{"line_number":163,"context_line":""},{"line_number":164,"context_line":"::"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"    server.create_promotion(\u0027passed_qa\u0027, \u0027foo\u0027, xml)"},{"line_number":167,"context_line":"    server.promotion_exists(\u0027passed_qa\u0027, \u0027foo\u0027)"},{"line_number":168,"context_line":"    print server.get_promotions(\u0027foo\u0027)"},{"line_number":169,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"da6ed579_c5ab52d5","line":166,"in_reply_to":"da6ed579_423f66b4","updated":"2016-01-12 23:47:32.000000000","message":"looks good","commit_id":"013187edb644a7c81b20ea0df4341e9ab7056e73"},{"author":{"_account_id":9943,"name":"Guido Günther","email":"agx@sigxcpu.org","username":"agx"},"change_message_id":"c651acf4757269336cbcb58df1a5756c9713dd53","unresolved":false,"context_lines":[{"line_number":163,"context_line":""},{"line_number":164,"context_line":"::"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"    server.create_promotion(\u0027passed_qa\u0027, \u0027foo\u0027, xml)"},{"line_number":167,"context_line":"    server.promotion_exists(\u0027passed_qa\u0027, \u0027foo\u0027)"},{"line_number":168,"context_line":"    print server.get_promotions(\u0027foo\u0027)"},{"line_number":169,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"da6ed579_423f66b4","line":166,"in_reply_to":"fa69d971_eeb36298","updated":"2016-01-12 17:46:53.000000000","message":"I\u0027ve extended the example. It\u0027s not that simple since the\njob config needs to be correct too (which is already handled\nnicely by jenkins-job-builder). Hope it\u0027s o.k. now.","commit_id":"013187edb644a7c81b20ea0df4341e9ab7056e73"},{"author":{"_account_id":6987,"name":"Khai Do","email":"zaro0508@gmail.com","username":"zaro0508"},"change_message_id":"6f52834c8d5763fb641a3ec5c642a566eacf6659","unresolved":false,"context_lines":[{"line_number":196,"context_line":"    server.promotion_exists(\u0027prom_name\u0027, \u0027prom_job\u0027)"},{"line_number":197,"context_line":"    print server.get_promotions(\u0027prom_job\u0027)"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"    server.reconfig_promotion(\u0027prom_name\u0027, \u0027prom_job\u0027, new_xml)"},{"line_number":200,"context_line":"    print server.get_promotion_config(\u0027prom_name\u0027, \u0027prom_job\u0027)"},{"line_number":201,"context_line":""},{"line_number":202,"context_line":"    server.delete_promotion(\u0027prom_name\u0027, \u0027prom_job\u0027)"}],"source_content_type":"text/x-rst","patch_set":3,"id":"da6ed579_3764e847","line":199,"updated":"2016-01-12 23:47:17.000000000","message":"Sorry, didn\u0027t notice this last time but how about creating a PROMO_RECONFIG_XML for new_xml?","commit_id":"d858a1e0dc6185f8464f40dc758caecabfe0615d"},{"author":{"_account_id":9943,"name":"Guido Günther","email":"agx@sigxcpu.org","username":"agx"},"change_message_id":"112a32b5520a8e47c2ba736cf5376b5b6162ce0e","unresolved":false,"context_lines":[{"line_number":196,"context_line":"    server.promotion_exists(\u0027prom_name\u0027, \u0027prom_job\u0027)"},{"line_number":197,"context_line":"    print server.get_promotions(\u0027prom_job\u0027)"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"    server.reconfig_promotion(\u0027prom_name\u0027, \u0027prom_job\u0027, new_xml)"},{"line_number":200,"context_line":"    print server.get_promotion_config(\u0027prom_name\u0027, \u0027prom_job\u0027)"},{"line_number":201,"context_line":""},{"line_number":202,"context_line":"    server.delete_promotion(\u0027prom_name\u0027, \u0027prom_job\u0027)"}],"source_content_type":"text/x-rst","patch_set":3,"id":"da6ed579_41f408f1","line":199,"in_reply_to":"da6ed579_3764e847","updated":"2016-01-13 16:50:11.000000000","message":"Done (and retested the docs).","commit_id":"d858a1e0dc6185f8464f40dc758caecabfe0615d"}],"jenkins/__init__.py":[{"author":{"_account_id":6987,"name":"Khai Do","email":"zaro0508@gmail.com","username":"zaro0508"},"change_message_id":"2ca28771d1d1c11845d9d132b852d09278814929","unresolved":false,"context_lines":[{"line_number":111,"context_line":"DELETE_VIEW \u003d \u0027view/%(name)s/doDelete\u0027"},{"line_number":112,"context_line":"SCRIPT_TEXT \u003d \u0027scriptText\u0027"},{"line_number":113,"context_line":"PROMOTION_NAME \u003d \u0027%(folder_url)sjob/%(short_name)s/promotion/process/%(name)s/api/json?tree\u003dname\u0027"},{"line_number":114,"context_line":"PROMOTION_INFO \u003d \u0027%(folder_url)sjob/%(short_name)s/promotion/api/json\u0027"},{"line_number":115,"context_line":"DELETE_PROMOTION \u003d \u0027%(folder_url)sjob/%(short_name)s/promotion/process/%(name)s/doDelete\u0027"},{"line_number":116,"context_line":"CREATE_PROMOTION \u003d \u0027%(folder_url)sjob/%(short_name)s/promotion/createProcess?name\u003d%(name)s\u0027"},{"line_number":117,"context_line":"CONFIG_PROMOTION \u003d \u0027%(folder_url)sjob/%(short_name)s/promotion/process/%(name)s/config.xml\u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa69d971_61fa2345","line":114,"updated":"2016-01-06 00:41:32.000000000","message":"Is there a depth that you can specify for this endpoint, similar to job or build info?  if so it might be nice to allow users to specify that.","commit_id":"013187edb644a7c81b20ea0df4341e9ab7056e73"},{"author":{"_account_id":9943,"name":"Guido Günther","email":"agx@sigxcpu.org","username":"agx"},"change_message_id":"c651acf4757269336cbcb58df1a5756c9713dd53","unresolved":false,"context_lines":[{"line_number":111,"context_line":"DELETE_VIEW \u003d \u0027view/%(name)s/doDelete\u0027"},{"line_number":112,"context_line":"SCRIPT_TEXT \u003d \u0027scriptText\u0027"},{"line_number":113,"context_line":"PROMOTION_NAME \u003d \u0027%(folder_url)sjob/%(short_name)s/promotion/process/%(name)s/api/json?tree\u003dname\u0027"},{"line_number":114,"context_line":"PROMOTION_INFO \u003d \u0027%(folder_url)sjob/%(short_name)s/promotion/api/json\u0027"},{"line_number":115,"context_line":"DELETE_PROMOTION \u003d \u0027%(folder_url)sjob/%(short_name)s/promotion/process/%(name)s/doDelete\u0027"},{"line_number":116,"context_line":"CREATE_PROMOTION \u003d \u0027%(folder_url)sjob/%(short_name)s/promotion/createProcess?name\u003d%(name)s\u0027"},{"line_number":117,"context_line":"CONFIG_PROMOTION \u003d \u0027%(folder_url)sjob/%(short_name)s/promotion/process/%(name)s/config.xml\u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"da6ed579_a29bc2c8","line":114,"in_reply_to":"fa69d971_61fa2345","updated":"2016-01-12 17:46:53.000000000","message":"Didn\u0027t know about depth so far but it exists and works. Added.","commit_id":"013187edb644a7c81b20ea0df4341e9ab7056e73"},{"author":{"_account_id":6987,"name":"Khai Do","email":"zaro0508@gmail.com","username":"zaro0508"},"change_message_id":"2ca28771d1d1c11845d9d132b852d09278814929","unresolved":false,"context_lines":[{"line_number":1326,"context_line":"        request \u003d Request(self._build_url(CONFIG_VIEW, locals()))"},{"line_number":1327,"context_line":"        return self.jenkins_open(request)"},{"line_number":1328,"context_line":""},{"line_number":1329,"context_line":"    def get_promotion_name(self, name, jobname):"},{"line_number":1330,"context_line":"        \u0027\u0027\u0027Return the name of a promotion using the API."},{"line_number":1331,"context_line":""},{"line_number":1332,"context_line":"        That is roughly an identity method which can be used to"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa69d971_21be6b65","line":1329,"updated":"2016-01-06 00:41:32.000000000","message":"we prefer \u0027job_name\u0027 instead of \u0027jobname\u0027.","commit_id":"013187edb644a7c81b20ea0df4341e9ab7056e73"},{"author":{"_account_id":9943,"name":"Guido Günther","email":"agx@sigxcpu.org","username":"agx"},"change_message_id":"c651acf4757269336cbcb58df1a5756c9713dd53","unresolved":false,"context_lines":[{"line_number":1326,"context_line":"        request \u003d Request(self._build_url(CONFIG_VIEW, locals()))"},{"line_number":1327,"context_line":"        return self.jenkins_open(request)"},{"line_number":1328,"context_line":""},{"line_number":1329,"context_line":"    def get_promotion_name(self, name, jobname):"},{"line_number":1330,"context_line":"        \u0027\u0027\u0027Return the name of a promotion using the API."},{"line_number":1331,"context_line":""},{"line_number":1332,"context_line":"        That is roughly an identity method which can be used to"}],"source_content_type":"text/x-python","patch_set":2,"id":"da6ed579_82aa3ed3","line":1329,"in_reply_to":"fa69d971_21be6b65","updated":"2016-01-12 17:46:53.000000000","message":"Done","commit_id":"013187edb644a7c81b20ea0df4341e9ab7056e73"},{"author":{"_account_id":6987,"name":"Khai Do","email":"zaro0508@gmail.com","username":"zaro0508"},"change_message_id":"2ca28771d1d1c11845d9d132b852d09278814929","unresolved":false,"context_lines":[{"line_number":1373,"context_line":"        :param name: Name of Jenkins promotion, ``str``"},{"line_number":1374,"context_line":"        :returns: ``True`` if Jenkins promotion exists"},{"line_number":1375,"context_line":"        \u0027\u0027\u0027"},{"line_number":1376,"context_line":"        if self.get_promotion_name(name, jobname) \u003d\u003d name:"},{"line_number":1377,"context_line":"            return True"},{"line_number":1378,"context_line":""},{"line_number":1379,"context_line":"    def get_promotions_info(self, jobname):"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa69d971_21bc2bdb","line":1376,"updated":"2016-01-06 00:41:32.000000000","message":"This method will return None if the promo does not exist which probably should be false instead.  I see you followed the pattern for jobs_exists() which I think should return \u0027False\u0027 if job doesn\u0027t exist as well.  How about adding an else to this and add a test to verify?","commit_id":"013187edb644a7c81b20ea0df4341e9ab7056e73"},{"author":{"_account_id":9943,"name":"Guido Günther","email":"agx@sigxcpu.org","username":"agx"},"change_message_id":"c651acf4757269336cbcb58df1a5756c9713dd53","unresolved":false,"context_lines":[{"line_number":1373,"context_line":"        :param name: Name of Jenkins promotion, ``str``"},{"line_number":1374,"context_line":"        :returns: ``True`` if Jenkins promotion exists"},{"line_number":1375,"context_line":"        \u0027\u0027\u0027"},{"line_number":1376,"context_line":"        if self.get_promotion_name(name, jobname) \u003d\u003d name:"},{"line_number":1377,"context_line":"            return True"},{"line_number":1378,"context_line":""},{"line_number":1379,"context_line":"    def get_promotions_info(self, jobname):"}],"source_content_type":"text/x-python","patch_set":2,"id":"da6ed579_42ad26e8","line":1376,"in_reply_to":"fa69d971_21bc2bdb","updated":"2016-01-12 17:46:53.000000000","message":"Done","commit_id":"013187edb644a7c81b20ea0df4341e9ab7056e73"},{"author":{"_account_id":6987,"name":"Khai Do","email":"zaro0508@gmail.com","username":"zaro0508"},"change_message_id":"2ca28771d1d1c11845d9d132b852d09278814929","unresolved":false,"context_lines":[{"line_number":1396,"context_line":"            raise JenkinsException(\"Could not parse JSON info for \""},{"line_number":1397,"context_line":"                                   \"promotions of job[%s]\" % jobname)"},{"line_number":1398,"context_line":""},{"line_number":1399,"context_line":"    def get_promotions(self, jobname):"},{"line_number":1400,"context_line":"        \"\"\"Get list of promotions running."},{"line_number":1401,"context_line":""},{"line_number":1402,"context_line":"        Each promotion is a dictionary with \u0027name\u0027 and \u0027url\u0027 keys."}],"source_content_type":"text/x-python","patch_set":2,"id":"fa69d971_01ea47ac","line":1399,"updated":"2016-01-06 00:41:32.000000000","message":"Would it make sense to call this method without specifying a job_name so that users can get all promotions from all jobs?  or specify a job_name if they want to get promotions on a specific job?","commit_id":"013187edb644a7c81b20ea0df4341e9ab7056e73"},{"author":{"_account_id":6987,"name":"Khai Do","email":"zaro0508@gmail.com","username":"zaro0508"},"change_message_id":"5fc86183f987caa584e7aab33dd4e835db04511a","unresolved":false,"context_lines":[{"line_number":1396,"context_line":"            raise JenkinsException(\"Could not parse JSON info for \""},{"line_number":1397,"context_line":"                                   \"promotions of job[%s]\" % jobname)"},{"line_number":1398,"context_line":""},{"line_number":1399,"context_line":"    def get_promotions(self, jobname):"},{"line_number":1400,"context_line":"        \"\"\"Get list of promotions running."},{"line_number":1401,"context_line":""},{"line_number":1402,"context_line":"        Each promotion is a dictionary with \u0027name\u0027 and \u0027url\u0027 keys."}],"source_content_type":"text/x-python","patch_set":2,"id":"da6ed579_ba78bd2c","line":1399,"in_reply_to":"da6ed579_a2e9821c","updated":"2016-01-12 23:47:32.000000000","message":"Sorry, I don\u0027t understand what you mean.  I was thinking this could work like get_all_jobs() method.  which in this case will iterate over all jobs to get all promotions. if a specific job is passed in then it will only return promo info for that one specific job.  Although i guess it\u0027s not required for this change but maybe can add a get_all_promotions on a separate change?","commit_id":"013187edb644a7c81b20ea0df4341e9ab7056e73"},{"author":{"_account_id":9943,"name":"Guido Günther","email":"agx@sigxcpu.org","username":"agx"},"change_message_id":"e7d9a3009769dae399bb0cfe49668db9a14e8cfd","unresolved":false,"context_lines":[{"line_number":1396,"context_line":"            raise JenkinsException(\"Could not parse JSON info for \""},{"line_number":1397,"context_line":"                                   \"promotions of job[%s]\" % jobname)"},{"line_number":1398,"context_line":""},{"line_number":1399,"context_line":"    def get_promotions(self, jobname):"},{"line_number":1400,"context_line":"        \"\"\"Get list of promotions running."},{"line_number":1401,"context_line":""},{"line_number":1402,"context_line":"        Each promotion is a dictionary with \u0027name\u0027 and \u0027url\u0027 keys."}],"source_content_type":"text/x-python","patch_set":2,"id":"da6ed579_e19bbc70","line":1399,"in_reply_to":"da6ed579_ba78bd2c","updated":"2016-01-13 16:53:09.000000000","message":"Yes, we can do a get_all_promotions() it would need to return a ditionary:\n\n{ \u0027jobname1\u0027: [ \u0027promo1\u0027, \u0027promo2\u0027, ], \u0027jobname2\u0027: [], \u0027jobnam3\u0027: [ \u0027promofoo\u0027, \u0027promobar\u0027 ] } \n\nor similar since promotions are tied to jobs (you can\u0027t just reuse the promotion from another job (without copying it\u0027s xml).\n\nI\u0027d be happy to add this but would prefer to do this in a follow up since it might spark more discussion on this topic (and doesn\u0027t affect the current API).","commit_id":"013187edb644a7c81b20ea0df4341e9ab7056e73"},{"author":{"_account_id":9943,"name":"Guido Günther","email":"agx@sigxcpu.org","username":"agx"},"change_message_id":"c651acf4757269336cbcb58df1a5756c9713dd53","unresolved":false,"context_lines":[{"line_number":1396,"context_line":"            raise JenkinsException(\"Could not parse JSON info for \""},{"line_number":1397,"context_line":"                                   \"promotions of job[%s]\" % jobname)"},{"line_number":1398,"context_line":""},{"line_number":1399,"context_line":"    def get_promotions(self, jobname):"},{"line_number":1400,"context_line":"        \"\"\"Get list of promotions running."},{"line_number":1401,"context_line":""},{"line_number":1402,"context_line":"        Each promotion is a dictionary with \u0027name\u0027 and \u0027url\u0027 keys."}],"source_content_type":"text/x-python","patch_set":2,"id":"da6ed579_a2e9821c","line":1399,"in_reply_to":"fa69d971_01ea47ac","updated":"2016-01-12 17:46:53.000000000","message":"Promotions are always tied to a job so we can\u0027t get them individually.","commit_id":"013187edb644a7c81b20ea0df4341e9ab7056e73"},{"author":{"_account_id":6987,"name":"Khai Do","email":"zaro0508@gmail.com","username":"zaro0508"},"change_message_id":"2ca28771d1d1c11845d9d132b852d09278814929","unresolved":false,"context_lines":[{"line_number":1420,"context_line":"            raise JenkinsException(\u0027delete[%s] from job[%s] failed\u0027 %"},{"line_number":1421,"context_line":"                                   (name, jobname))"},{"line_number":1422,"context_line":""},{"line_number":1423,"context_line":"    def create_promotion(self, name, jobname, config_xml):"},{"line_number":1424,"context_line":"        \u0027\u0027\u0027Create a new Jenkins promotion"},{"line_number":1425,"context_line":""},{"line_number":1426,"context_line":"        :param name: Name of Jenkins promotion, ``str``"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa69d971_61f0e391","line":1423,"updated":"2016-01-06 00:41:32.000000000","message":"having an example config_xml would be very handy, maybe something similar to EMPTY_JOB_CONFIG above","commit_id":"013187edb644a7c81b20ea0df4341e9ab7056e73"},{"author":{"_account_id":9943,"name":"Guido Günther","email":"agx@sigxcpu.org","username":"agx"},"change_message_id":"c651acf4757269336cbcb58df1a5756c9713dd53","unresolved":false,"context_lines":[{"line_number":1420,"context_line":"            raise JenkinsException(\u0027delete[%s] from job[%s] failed\u0027 %"},{"line_number":1421,"context_line":"                                   (name, jobname))"},{"line_number":1422,"context_line":""},{"line_number":1423,"context_line":"    def create_promotion(self, name, jobname, config_xml):"},{"line_number":1424,"context_line":"        \u0027\u0027\u0027Create a new Jenkins promotion"},{"line_number":1425,"context_line":""},{"line_number":1426,"context_line":"        :param name: Name of Jenkins promotion, ``str``"}],"source_content_type":"text/x-python","patch_set":2,"id":"da6ed579_42dbe67c","line":1423,"in_reply_to":"fa69d971_61f0e391","updated":"2016-01-12 17:46:53.000000000","message":"Done","commit_id":"013187edb644a7c81b20ea0df4341e9ab7056e73"}],"tests/test_promotion.py":[{"author":{"_account_id":6987,"name":"Khai Do","email":"zaro0508@gmail.com","username":"zaro0508"},"change_message_id":"2ca28771d1d1c11845d9d132b852d09278814929","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"fa69d971_a10edb38","updated":"2016-01-06 00:41:32.000000000","message":"Thanks for adding tests.  If you run \u0027tox -ecover\u0027 locally and open cover/index.html  you\u0027ll see that there a few lines not tested.   Would you closing the gap there?   There\u0027s an entire suite of tests for jobs in tests/jobs so that might help.","commit_id":"013187edb644a7c81b20ea0df4341e9ab7056e73"},{"author":{"_account_id":9943,"name":"Guido Günther","email":"agx@sigxcpu.org","username":"agx"},"change_message_id":"c651acf4757269336cbcb58df1a5756c9713dd53","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"da6ed579_62caaaa3","in_reply_to":"fa69d971_a10edb38","updated":"2016-01-12 17:46:53.000000000","message":"Should hopefully be o.k. now.","commit_id":"013187edb644a7c81b20ea0df4341e9ab7056e73"}]}
