# Insert the build into the database
build = await self.db.insert(
Build,
- build_repo = repo,
+ repo = repo,
pkg = package,
owner = owner,
build_group_id = group.id if group else None,
owner = sqlalchemy.orm.relationship("User", foreign_keys=[owner_id], lazy="joined")
- # Build Repo ID
+ # Repo ID
- build_repo_id = Column(Integer, ForeignKey("repositories.id"), nullable=False)
+ repo_id = Column(Integer, ForeignKey("repositories.id"), nullable=False)
- # Build Repo
+ # Repo
- build_repo = sqlalchemy.orm.relationship("Repo", lazy="selectin")
+ repo = sqlalchemy.orm.relationship("Repo", lazy="selectin")
# Distro
@functools.cached_property
def distro(self):
- return self.build_repo.distro
+ return self.repo.distro
# Group ID
"""
# Remaster the build repository?
if build:
- await self.build_repo.changed()
+ await self.repo.changed()
# Remaster all other repositories
for repo in self.repos:
AND
other_builds.pkg_id = other_packages.id
AND
- other_builds.build_repo_id = builds.build_repo_id
+ other_builds.repo_id = builds.repo_id
-- Start with this build
WHERE
# Launch test build
t = await self.backend.builds.create(
# Use the same build repository
- repo=self.build_repo,
+ repo=self.repo,
package=build.pkg,
owner=self.owner,
group=group,
"""
Creates a clone of this build
"""
+ # Clone into the same repository if none given
+ if repo is None:
+ repo = self.repo
+
# Create a new build from the same package
clone = await self.backend.builds.create(
# Build the same package
owner = owner,
# Repository
- repo = repo or self.build_repo,
+ repo = repo,
)
log.info("Cloned %s as %s" % (self, clone))
# Group jobs by their build repository
for job in jobs:
try:
- repos[job.build.build_repo].append(job)
+ repos[job.build.repo].append(job)
except KeyError:
- repos[job.build.build_repo] = [job]
+ repos[job.build.repo] = [job]
# Run the dependency check for all jobs
for repo, jobs in repos.items():
"""
Generate the Pakfire configuration for this job
"""
- return self.build.build_repo.pakfire(arch=self.arch, **kwargs)
+ return self.build.repo.pakfire(arch=self.arch, **kwargs)
async def installcheck(self):
"""
Perform install check
"""
- await self.build.build_repo.installcheck([self])
+ await self.build.repo.installcheck([self])
# Return whether the check succeeded or not
return self.installcheck_succeeded
jobs ON builds.id = jobs.build_id
-- Only from this repository
WHERE
- builds.build_repo_id = %s
+ builds.repo_id = %s
-- Builds must not be deleted
AND
builds.deleted_at IS NULL
pkg_id integer NOT NULL,
severity text,
created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
- build_repo_id integer NOT NULL,
+ repo_id integer NOT NULL,
owner_id integer,
priority integer DEFAULT 0 NOT NULL,
finished_at timestamp without time zone,
ADD CONSTRAINT builds_build_group_id FOREIGN KEY (build_group_id) REFERENCES public.build_groups(id);
---
--- Name: builds builds_build_repo_id; Type: FK CONSTRAINT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.builds
- ADD CONSTRAINT builds_build_repo_id FOREIGN KEY (build_repo_id) REFERENCES public.repositories(id);
-
-
--
-- Name: build_comments builds_comments_build_id; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ADD CONSTRAINT builds_pkg_id FOREIGN KEY (pkg_id) REFERENCES public.packages(id);
+--
+-- Name: builds builds_repo_id; Type: FK CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY public.builds
+ ADD CONSTRAINT builds_repo_id FOREIGN KEY (repo_id) REFERENCES public.repositories(id);
+
+
--
-- Name: job_packages job_packages_job_id; Type: FK CONSTRAINT; Schema: public; Owner: -
--