Code review comment for lp://qastaging/~doanac/qa-dashboard/smoke-pull-regression

Revision history for this message
Chris Johnston (cjohnston) wrote :

 review approve
 merge approved

On Mon, Dec 2, 2013 at 11:47 AM, Andy Doan <email address hidden>wrote:

> Andy Doan has proposed merging
> lp:~doanac/qa-dashboard/smoke-pull-regression into lp:qa-dashboard.
>
> Commit message:
> fix bug regression in our smoke pull script
>
> the ran_at field has two paths. 1 for utah yaml results and 1 for
> non-utah yaml. The utah path sends ran_at as a string while the
> other path sends it as a datetime object. This makes the pull logic
> smart enough to only convert when needed.
>
> Requested reviews:
> PS Jenkins bot (ps-jenkins): continuous-integration
> Canonical CI Engineering (canonical-ci-engineering)
>
> For more details, see:
>
> https://code.launchpad.net/~doanac/qa-dashboard/smoke-pull-regression/+merge/197416
>
> The dashboard is hitting an exception due to type mismatches that causing
> us to not be able to update bugs when build descriptions change:
>
> fix bug regression in our smoke pull script
>
> the ran_at field has two paths. 1 for utah yaml results and 1 for
> non-utah yaml. The utah path sends ran_at as a string while the
> other path sends it as a datetime object. This makes the pull logic
> smart enough to only convert when needed.
> --
>
> https://code.launchpad.net/~doanac/qa-dashboard/smoke-pull-regression/+merge/197416
> Your team QA Dashboard Developers is subscribed to branch lp:qa-dashboard.
>
> === modified file 'smokeng/management/commands/jenkins_pull_smokeng.py'
> --- smokeng/management/commands/jenkins_pull_smokeng.py 2013-11-21
> 16:58:17 +0000
> +++ smokeng/management/commands/jenkins_pull_smokeng.py 2013-12-02
> 16:45:59 +0000
> @@ -201,6 +201,12 @@
>
> jenkins_builds.delete()
>
> + @staticmethod
> + def _to_datetime(ran_at):
> + if type(ran_at) == str:
> + ran_at = datetime.datetime.strptime(ran_at, '%Y-%m-%d
> %H:%M:%S')
> + return ran_at
> +
> def add_result(self, dashboard_data):
> """ Add smoke data to the database. """
>
> @@ -229,8 +235,7 @@
> )
>
> if not new_result:
> - result.ran_at = datetime.datetime.strptime(
> - dashboard_data['ran_at'], '%Y-%m-%d %H:%M:%S')
> + result.ran_at = self._to_datetime(dashboard_data['ran_at'])
> result.pass_count = dashboard_data['passes']
> result.fail_count = dashboard_data['failures']
> result.error_count = dashboard_data['errors']
>
>
>

review: Approve

« Back to merge proposal