diff --git a/peridot/builder/v1/workflow/sync.go b/peridot/builder/v1/workflow/sync.go index f734b894..aa2f0a55 100644 --- a/peridot/builder/v1/workflow/sync.go +++ b/peridot/builder/v1/workflow/sync.go @@ -568,6 +568,9 @@ func kindCatalogGroupInstallOptions(tx peridotdb.Access, req *peridotpb.SyncCata return nil, fmt.Errorf("failed to parse build groupinstall options: %w", err) } err = tx.SetBuildRootPackages(req.ProjectId.Value, srpmPackages, buildPackages) + if err != nil { + return nil, fmt.Errorf("failed to set buildroot packages for project: %w", err) + } ret.SrpmPackages = append(ret.SrpmPackages, srpmPackages...) ret.BuildPackages = append(ret.BuildPackages, buildPackages...) diff --git a/peridot/db/db.go b/peridot/db/db.go index f86a8df2..51d04a06 100644 --- a/peridot/db/db.go +++ b/peridot/db/db.go @@ -46,7 +46,7 @@ type Access interface { CreateProject(project *peridotpb.Project) (*models.Project, error) UpdateProject(id string, project *peridotpb.Project) (*models.Project, error) SetProjectKeys(projectId string, username string, password string) error - SetBuildRootPackages(projectId string, srpmPackages []string, buildPackages []string) error + SetBuildRootPackages(projectId string, srpmPackages pq.StringArray, buildPackages pq.StringArray) error CreateBuild(packageId string, packageVersionId string, taskId string, projectId string) (*models.Build, error) GetArtifactsForBuild(buildId string) (models.TaskArtifacts, error) diff --git a/peridot/db/psql/project.go b/peridot/db/psql/project.go index f93acdb7..afe6ffa7 100644 --- a/peridot/db/psql/project.go +++ b/peridot/db/psql/project.go @@ -339,7 +339,14 @@ func (a *Access) SetProjectKeys(projectId string, username string, password stri return err } -func (a *Access) SetBuildRootPackages(projectId string, srpmPackages []string, buildPackages []string) error { +func (a *Access) SetBuildRootPackages(projectId string, srpmPackages pq.StringArray, buildPackages pq.StringArray) error { + if srpmPackages == nil { + srpmPackages = pq.StringArray{} + } + if buildPackages == nil { + buildPackages = pq.StringArray{} + } + _, err := a.query.Exec( ` update projects set srpm_stage_packages = $2, build_stage_packages = $3