From 4d9e57eb150fee8d24ff32fb4a8a414c77d246e6 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Thu, 10 Apr 2025 15:09:06 +0200 Subject: syz-cluster: provide API for uploading artifacts archive The archive would be a useful source of debugging information. Provide an HTTP endpoint that accepts a multipart form request with the archived data. Provide an *api.Client method to encapsulate the encoding of the data. Add a test. --- syz-cluster/pkg/db/entities.go | 15 ++++++++------- syz-cluster/pkg/db/migrations/1_initialize.up.sql | 1 + 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'syz-cluster/pkg/db') diff --git a/syz-cluster/pkg/db/entities.go b/syz-cluster/pkg/db/entities.go index 43f0a4968..688bb8971 100644 --- a/syz-cluster/pkg/db/entities.go +++ b/syz-cluster/pkg/db/entities.go @@ -106,13 +106,14 @@ func (s *Session) SetSkipReason(reason string) { } type SessionTest struct { - SessionID string `spanner:"SessionID"` - BaseBuildID spanner.NullString `spanner:"BaseBuildID"` - PatchedBuildID spanner.NullString `spanner:"PatchedBuildID"` - UpdatedAt time.Time `spanner:"UpdatedAt"` - TestName string `spanner:"TestName"` - Result string `spanner:"Result"` - LogURI string `spanner:"LogURI"` + SessionID string `spanner:"SessionID"` + BaseBuildID spanner.NullString `spanner:"BaseBuildID"` + PatchedBuildID spanner.NullString `spanner:"PatchedBuildID"` + UpdatedAt time.Time `spanner:"UpdatedAt"` + TestName string `spanner:"TestName"` + Result string `spanner:"Result"` + LogURI string `spanner:"LogURI"` + ArtifactsArchiveURI string `spanner:"ArtifactsArchiveURI"` } type Finding struct { diff --git a/syz-cluster/pkg/db/migrations/1_initialize.up.sql b/syz-cluster/pkg/db/migrations/1_initialize.up.sql index e7a1b396d..c8938ca53 100644 --- a/syz-cluster/pkg/db/migrations/1_initialize.up.sql +++ b/syz-cluster/pkg/db/migrations/1_initialize.up.sql @@ -72,6 +72,7 @@ CREATE TABLE SessionTests ( BaseBuildID STRING(36), PatchedBuildID STRING(36), LogURI STRING(256) NOT NULL, + ArtifactsArchiveURI STRING(256) NOT NULL, CONSTRAINT FK_SessionResults FOREIGN KEY (SessionID) REFERENCES Sessions (ID), CONSTRAINT ResultEnum CHECK (Result IN ('passed', 'failed', 'error', 'running')), CONSTRAINT FK_BaseBuild FOREIGN KEY (BaseBuildID) REFERENCES Builds (ID), -- cgit mrf-deployment