Merge lp://staging/~danilo/launchpad/bug-685624 into lp://staging/launchpad

Proposed by Данило Шеган
Status: Merged
Approved by: Данило Шеган
Approved revision: no longer in the source branch.
Merged at revision: 12098
Proposed branch: lp://staging/~danilo/launchpad/bug-685624
Merge into: lp://staging/launchpad
Diff against target: 71 lines (+23/-2)
3 files modified
lib/lp/translations/model/translationtemplatesbuild.py (+4/-1)
lib/lp/translations/model/translationtemplatesbuildjob.py (+13/-1)
lib/lp/translations/tests/test_translationtemplatesbuildjob.py (+6/-0)
To merge this branch: bzr merge lp://staging/~danilo/launchpad/bug-685624
Reviewer Review Type Date Requested Status
Brad Crittenden (community) code Approve
Review via email: mp+44035@code.staging.launchpad.net

Commit message

[r=bac][ui=none][bug=685624] Provide TranslationTemplatesBuildJob.build property linking to TranslationTemplatesBuild objects to stop polluting build-manager logs.

Description of the change

= Bug 685624 =

Translation template generation happens on the build farm and is triggered by a commit to a branch for upstream projects.

TranslationTemplatesBuildJob (TTBJ) is at the same time a BranchJob (runs on commits) and a BuildFarmJobOld (old-style build farm job, used for queueing template generation jobs on the build farm). Since we are in the middle of the migration to the new model for the build farm, translations also provides a new-style BuildFarmJob in TranslationTemplatesBuild (TTB). However, there is no way to get the new-style BFJ from the old-style one, yet buildmaster currently expects that. This won't be needed in the future when the full migration is done.

== Proposed fix ==

There is no algorithmic way to get from TTBJ to the TTB, so we have to store the link on TTBJ. But TTBJ is both a BranchJob and a BuildFarmJob, and we can't easily extend it to store TTB ID (because it's using the BranchJob table, and we don't want to add the 'build' column there). However, BranchJob provides a generic metadata field in json format as json_data, and we're already using it to pass public branch URL around.

We'll also add TTB.id there as 'build_id', and implement a property TTBJ.build which fetches a TTB based on this 'build_id'.

Note that this is a temporary solution that will not be needed as soon as buildmaster is switched to the new model exclusively.

== Pre-implementation notes ==

I've discussed this with Michael Nelson and William Grant.

== Tests ==

bin/test -cvvt translationtemplatesbuildjob.*create_with_build

== Demo and Q/A ==

I'll still have to check with the Soyuz guys on how do I best QA this. In general, it's about creating a translation templates build job, and then seeing if buildd-manager reports the problem like mentioned in the bug.

= Launchpad lint =

Checking for conflicts and issues in changed files.

Linting changed files:
  lib/lp/translations/model/translationtemplatesbuildjob.py
  lib/lp/translations/model/translationtemplatesbuild.py
  lib/lp/translations/tests/test_translationtemplatesbuildjob.py

To post a comment you must log in.
Revision history for this message
Brad Crittenden (bac) wrote :

This branch looks good Danilos. It has a kludgy elegance to it but should suffice until the next pass happens real soon now.

review: Approve (code)

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.