← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:db-cibuild-jobs into launchpad:db-devel

 

Colin Watson has proposed merging ~cjwatson/launchpad:db-cibuild-jobs into launchpad:db-devel.

Commit message:
Add CIBuild.jobs column

Requested reviews:
  William Grant (wgrant): db
  Launchpad code reviewers (launchpad-reviewers): db

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/419156

This will allow fixing two aspects of `CIBuild` that I designed poorly to start with.

 * buildd-manager shouldn't need to fetch `.launchpad.yaml` again (requiring extra firewall rules) in order to work out which jobs to dispatch to the builder: they were known at the time the build was requested, so we should just store them at that point.

 * While buildd-manager shouldn't deal directly with storing large output files in the librarian, hence the existence of archiveuploader, we ideally shouldn't rely on archiveuploader to update `RevisionStatusReport` rows (or perhaps also to attach log files), since that's slow as well as currently only happening when the build succeeds.  It would make more sense to update `RevisionStatusReport` directly from buildd-manager based on the `jobs` field from the worker's status response, at which point we might as well also save that field in the database directly rather than having to marshal it via a `jobs.json` file on disk.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:db-cibuild-jobs into launchpad:db-devel.
diff --git a/database/schema/patch-2210-40-1.sql b/database/schema/patch-2210-40-1.sql
new file mode 100644
index 0000000..4a6a664
--- /dev/null
+++ b/database/schema/patch-2210-40-1.sql
@@ -0,0 +1,10 @@
+-- Copyright 2022 Canonical Ltd.  This software is licensed under the
+-- GNU Affero General Public License version 3 (see the file LICENSE).
+
+SET client_min_messages=ERROR;
+
+ALTER TABLE CIBuild ADD COLUMN jobs jsonb;
+
+COMMENT ON COLUMN CIBuild.jobs IS 'The status of the individual jobs in this CI build.';
+
+INSERT INTO LaunchpadDatabaseRevision VALUES (2210, 40, 1);