Merge lp://staging/~fginther/helipad/ci-fix-lp1205559 into lp://staging/helipad/ci

Proposed by Francis Ginther
Status: Merged
Approved by: Chris Johnston
Approved revision: 30
Merged at revision: 30
Proposed branch: lp://staging/~fginther/helipad/ci-fix-lp1205559
Merge into: lp://staging/helipad/ci
Diff against target: 120 lines (+47/-12)
3 files modified
management/commands/jenkins_pull_ci.py (+9/-2)
util/cu2d_stack.py (+29/-5)
util/jenkins_job.py (+9/-5)
To merge this branch: bzr merge lp://staging/~fginther/helipad/ci-fix-lp1205559
Reviewer Review Type Date Requested Status
Chris Johnston Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+177244@code.staging.launchpad.net

Commit message

Handle jobs missing from the db when updating the stacks.

Description of the change

Handle jobs missing from the db when updating the stacks.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:28
http://s-jenkins:8080/job/helipad-ci-ci/46/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins:8080/job/helipad-ci-ci/46/rebuild

review: Approve (continuous-integration)
Revision history for this message
Chris Johnston (cjohnston) wrote :

Traceback (most recent call last):
  File "./manage.py", line 11, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 443, in execute_from_command_line
    utility.execute()
  File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 382, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 196, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 232, in execute
    output = self.handle(*args, **options)
  File "/srv/reports.qa.ubuntu.com/ci/management/commands/jenkins_pull_ci.py", line 177, in handle
    self.update_cu2d_stacks()
  File "/srv/reports.qa.ubuntu.com/ci/management/commands/jenkins_pull_ci.py", line 106, in update_cu2d_stacks
    update_cu2d_stack_jobs(stack_list)
  File "/srv/reports.qa.ubuntu.com/ci/util/cu2d_stack.py", line 61, in update_cu2d_stack_jobs
    update_jenkins_job(stack.integration_job)
  File "/srv/reports.qa.ubuntu.com/ci/util/jenkins_job.py", line 145, in update_jenkins_job
    for jenkinsapi_build in latest_builds(jenkins_job):
  File "/srv/reports.qa.ubuntu.com/ci/util/jenkins_job.py", line 129, in latest_builds
    jenkinsapi_job = ps_jenkins.get_job(jenkins_job.name)
AttributeError: 'NoneType' object has no attribute 'name'

review: Needs Fixing
Revision history for this message
Francis Ginther (fginther) wrote :

Investigating the error.

Revision history for this message
Francis Ginther (fginther) wrote :

> Traceback (most recent call last):
...
> File "/srv/reports.qa.ubuntu.com/ci/management/commands/jenkins_pull_ci.py",
> line 106, in update_cu2d_stacks
> update_cu2d_stack_jobs(stack_list)
> File "/srv/reports.qa.ubuntu.com/ci/util/cu2d_stack.py", line 61, in
> update_cu2d_stack_jobs
> update_jenkins_job(stack.integration_job)
> File "/srv/reports.qa.ubuntu.com/ci/util/jenkins_job.py", line 145, in
> update_jenkins_job
> for jenkinsapi_build in latest_builds(jenkins_job):
> File "/srv/reports.qa.ubuntu.com/ci/util/jenkins_job.py", line 129, in
> latest_builds
> jenkinsapi_job = ps_jenkins.get_job(jenkins_job.name)
> AttributeError: 'NoneType' object has no attribute 'name'

This was called by trying to update a job that doesn't exist in the database. This is possible because the code blindly searches for jobs based on cupstream2distro-config stack names. If the job the jobs don't exist during the initial pull, the Cu2dStack will be created but not the integration_job. As a result this is None. Check for this condition and double check the condition that the child_job doesn't exist.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:29
http://s-jenkins:8080/job/helipad-ci-ci/47/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins:8080/job/helipad-ci-ci/47/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Chris Johnston (cjohnston) wrote :

There is a conflict

review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:30
http://s-jenkins:8080/job/helipad-ci-ci/48/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins:8080/job/helipad-ci-ci/48/rebuild

review: Approve (continuous-integration)
Revision history for this message
Francis Ginther (fginther) wrote :

Now it should be correct. This reverts the revision 28 and adds additional fix.

Revision history for this message
Allan LeSage (allanlesage) wrote :

Testing this locally FWIW. . . .

Revision history for this message
Chris Johnston (cjohnston) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: