for job in self.jobqueue:
# Only allow building test jobs in test mode
- if self.testmode and not job.type == "test":
+ if self.testmode and not job.test:
continue
return job
return comments
- def get_build_times_summary(self, name=None, job_type=None, arch=None):
+ def get_build_times_summary(self, name=None, arch=None):
query = "\
SELECT \
builds_times.arch AS arch, \
conditions.append("packages.name = %s")
args.append(name)
- # Filter by job types.
- if job_type:
- conditions.append("builds_times.job_type = %s")
- args.append(job_type)
-
# Filter by arch.
if arch:
conditions.append("builds_times.arch = %s")
def __lt__(self, other):
if isinstance(other, self.__class__):
- if (self.type, other.type) == ("build", "test"):
+ if not self.test and other.test:
return True
if self.build == other.build:
return self.data.uuid
@property
- def type(self):
- return self.data.type
+ def test(self):
+ return self.data.test
@property
def build_id(self):
self.send_failed_message()
# Automatically update the state of the build (not on test builds).
- if self.type == "build":
+ if not self.test:
self.build.auto_update_state()
state = property(get_state, set_state)
elif filename.endswith(".%s" % PACKAGE_EXTENSION):
# It is not allowed to upload packages on test builds.
- if self.type == "test":
+ if self.test:
return
self._add_file_package(filename)
"""
target_dirname = os.path.join(self.build.path, "logs")
- if self.type == "test":
+ if self.test:
i = 1
while True:
target_filename = os.path.join(target_dirname,
def send_finished_message(self):
# Send no finished mails for test jobs.
- if self.type == "test":
+ if self.test:
return
logging.debug("Sending finished message for job %s to %s" % \
state text DEFAULT 'building'::text NOT NULL,
severity builds_severity,
message text,
- time_created timestamp without time zone NOT NULL,
+ time_created timestamp without time zone DEFAULT now() NOT NULL,
update_year integer,
update_num integer,
depends_on integer,
distro_id integer NOT NULL,
owner_id integer,
- public builds_public DEFAULT 'Y'::builds_public NOT NULL,
+ public boolean DEFAULT true NOT NULL,
priority integer DEFAULT 0 NOT NULL,
- auto_move builds_auto_move DEFAULT 'N'::builds_auto_move NOT NULL
+ auto_move boolean DEFAULT false NOT NULL
);
builder_id integer,
tries integer DEFAULT 0 NOT NULL,
aborted_state integer DEFAULT 0 NOT NULL,
- message text
+ message text,
+ test boolean DEFAULT true NOT NULL,
+ superseeded_by integer,
+ deleted boolean DEFAULT false NOT NULL
);
--
CREATE VIEW builds_times AS
- SELECT builds.id AS build_id,
+ SELECT jobs.build_id,
jobs.arch,
- jobs.type AS job_type,
(jobs.time_finished - jobs.time_started) AS duration
- FROM (jobs
- LEFT JOIN builds ON ((jobs.build_id = builds.id)))
- WHERE (jobs.state = 'finished'::jobs_state);
+ FROM jobs
+ WHERE (((jobs.deleted IS FALSE) AND (jobs.test IS FALSE)) AND (jobs.state = 'finished'::jobs_state));
ALTER TABLE builds_times OWNER TO pakfire;
size bigint NOT NULL,
hash_sha512 text,
type integer NOT NULL,
- config filelists_config NOT NULL,
+ config boolean NOT NULL,
mode integer NOT NULL,
"user" text NOT NULL,
"group" text NOT NULL,
CREATE VIEW jobs_active AS
SELECT jobs.id,
jobs.uuid,
- jobs.type,
jobs.build_id,
jobs.state,
jobs.arch,
CREATE INDEX idx_2198063_time_finished ON jobs USING btree (time_finished);
---
--- Name: idx_2198063_type; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
---
-
-CREATE INDEX idx_2198063_type ON jobs USING btree (type);
-
-
--
-- Name: idx_2198063_uuid; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
--
CREATE INDEX jobs_buildroots_pkg_uuid ON jobs_buildroots USING btree (pkg_uuid);
+--
+-- Name: jobs_type; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
+--
+
+CREATE INDEX jobs_type ON jobs USING btree (test) WHERE (deleted IS FALSE);
+
+
--
-- Name: mirrors_checks_sort; Type: INDEX; Schema: public; Owner: pakfire; Tablespace:
--
"packages" : [p.uuid for p in job.packages],
"state" : job.state,
"time_created" : job.time_created.isoformat(),
- "type" : job.type,
+ "type" : "test" if job.test else "release",
"uuid" : job.uuid,
}
"arch" : job.arch,
"source_url" : job.build.source_download,
"source_hash_sha512" : job.build.source_hash_sha512,
- "type" : job.type,
+ "type" : "test" if job.test else "release",
"config" : job.get_config(),
}
# Iterate through all of it
for build in repo:
for job in build:
- if not job.type == "build":
+ # Skip all test jobs
+ if job.test:
continue
if not job.arch in (arch, "noarch"):
{% if job.build.type == "scratch" %}
<span class="label label-inverse pull-right" rel="tooltip" data-placement="top" title="{{ _("Scratch build") }}">S</span>
- {% elif job.type == "test" %}
+ {% elif job.test %}
<span class="label label-inverse pull-right" rel="tooltip" data-placement="top" title="{{ _("Test build") }}">T</span>
{% end %}
</td>
raise tornado.web.HTTPError(404)
# Get the summary stats.
- build_times_summary = self.pakfire.builds.get_build_times_summary(name,
- job_type="build")
+ build_times_summary = self.pakfire.builds.get_build_times_summary(name)
self.render("packages/builds/times.html", pkg=latest_build.pkg,
build_times_summary=build_times_summary)