Package coprs :: Module models :: Class Build
[hide private]
[frames] | no frames]

Class Build

source code


Representation of one build in one copr

Instance Methods [hide private]
 
__init__(self, *args, **kwargs) source code
 
user_name(self) source code
 
group_name(self) source code
 
copr_name(self) source code
 
copr_dirname(self) source code
 
copr_full_dirname(self) source code
 
fail_type_text(self) source code
 
repos_list(self) source code
 
task_id(self) source code
 
id_fixed_width(self) source code
 
get_source_log_urls(self, admin=False)
Return a list of URLs to important build _source_ logs.
source code
 
import_log_url_distgit(self) source code
 
result_dir_url(self)
URL for the result-directory on backend (the source/SRPM build).
source code
 
_compressed_log_variant(self, basename, states_raw_log) source code
 
source_live_log_url(self)
Full URL to the builder-live.log(.gz) for the source (SRPM) build.
source code
 
source_backend_log_url(self)
Full URL to the builder-live.log(.gz) for the source (SRPM) build.
source code
 
source_json_dict(self) source code
 
started_on(self) source code
 
min_started_on(self) source code
 
ended_on(self) source code
 
max_ended_on(self) source code
 
chroots_started_on(self) source code
 
chroots_ended_on(self) source code
 
source_type_text(self) source code
 
source_metadata(self) source code
 
chroot_states(self) source code
 
get_chroots_by_status(self, statuses=None)
Get build chroots with states which present in `states` list If states == None, function returns build_chroots
source code
 
chroots_dict_by_name(self) source code
 
source_state(self)
Return text representation of status of this build
source code
 
status(self)
Return build status.
source code
 
state(self)
Return text representation of status of this build.
source code
 
cancelable(self)
Find out if this build is cancelable.
source code
 
repeatable(self)
Find out if this build is repeatable.
source code
 
finished_early(self)
Check if the build has finished, and if that happened prematurely because: - it was canceled - it failed to generate/download sources).
source code
 
finished(self)
Find out if this build is in finished state.
source code
 
blocked(self) source code
 
persistent(self)
Find out if this build is persistent.
source code
 
package_name(self) source code
 
to_dict(self, options=None, with_chroot_states=False)
Usage:
source code
 
submitter(self)
Return tuple (submitter_string, submitter_link), while the submitter_link may be empty if we are not able to detect it wisely.
source code
 
sandbox(self)
Return a string unique to project + submitter.
source code
 
resubmitted_from(self) source code
 
source_is_uploaded(self) source code
 
bootstrap_set(self)
Is bootstrap config from project/chroot overwritten by build?
source code
 
batching_user_error(self, user, modify=False)
Check if the USER can operate with this build in batches, eg create a new batch for it, or add other builds to the existing batch.
source code

Inherited from helpers.Serializer: serializable_attributes

Class Variables [hide private]
  SCM_COMMIT = 'commit'
  SCM_PULL_REQUEST = 'pull-request'
  __table_args__ = db.Index('build_canceled', "canceled"), db.In...
  id = db.Column(db.Integer, primary_key= True)
  pkgs = db.Column(db.Text)
  built_packages = db.Column(db.Text)
  pkg_version = db.Column(db.Text)
  canceled = db.Column(db.Boolean, default= False)
  repos = db.Column(db.Text)
  submitted_on = db.Column(db.Integer, nullable= False)
  result_dir = db.Column(db.Text, default= '', server_default= '...
  memory_reqs = db.Column(db.Integer, default= app.config ["DEFA...
  timeout = db.Column(db.Integer, default= app.config ["DEFAULT_...
  enable_net = db.Column(db.Boolean, default= False, server_defa...
  source_type = db.Column(db.Integer, default= helpers.BuildSour...
  source_json = db.Column(db.Text)
  fail_type = db.Column(db.Integer, default= FailTypeEnum("unset"))
  is_background = db.Column(db.Boolean, default= False, server_d...
  source_status = db.Column(db.Integer, default= StatusEnum("wai...
  srpm_url = db.Column(db.Text)
  bootstrap = db.Column(db.Text)
  user_id = db.Column(db.Integer, db.ForeignKey("user.id"), inde...
  user = db.relationship("User", backref= db.backref("builds"))
  copr_id = db.Column(db.Integer, db.ForeignKey("copr.id"), inde...
  copr = db.relationship("Copr", backref= db.backref("builds"))
  package_id = db.Column(db.Integer, db.ForeignKey("package.id")...
  package = db.relationship("Package")
  chroots = association_proxy("build_chroots", "mock_chroot")
  batch_id = db.Column(db.Integer, db.ForeignKey("batch.id"))
  batch = db.relationship("Batch", backref= db.backref("builds"))
  module_id = db.Column(db.Integer, db.ForeignKey("module.id"), ...
  module = db.relationship("Module", backref= db.backref("builds"))
  copr_dir_id = db.Column(db.Integer, db.ForeignKey("copr_dir.id...
  copr_dir = db.relationship("CoprDir", backref= db.backref("bui...
  scm_object_id = db.Column(db.Text)
  scm_object_type = db.Column(db.Text)
  scm_object_url = db.Column(db.Text)
  update_callback = db.Column(db.Text)
  submitted_by = db.Column(db.Text)
  resubmitted_from_id = db.Column(db.Integer)
  _cached_status = None
  _cached_status_set = None
Method Details [hide private]

__init__(self, *args, **kwargs)
(Constructor)

source code 
Overrides: object.__init__
(inherited documentation)

user_name(self)

source code 
Decorators:
  • @property

group_name(self)

source code 
Decorators:
  • @property

copr_name(self)

source code 
Decorators:
  • @property

copr_dirname(self)

source code 
Decorators:
  • @property

copr_full_dirname(self)

source code 
Decorators:
  • @property

fail_type_text(self)

source code 
Decorators:
  • @property

repos_list(self)

source code 
Decorators:
  • @property

task_id(self)

source code 
Decorators:
  • @property

id_fixed_width(self)

source code 
Decorators:
  • @property

get_source_log_urls(self, admin=False)

source code 

Return a list of URLs to important build _source_ logs. The list is changing as the state of build is changing.

import_log_url_distgit(self)

source code 
Decorators:
  • @property

result_dir_url(self)

source code 

URL for the result-directory on backend (the source/SRPM build).

Decorators:
  • @property

source_live_log_url(self)

source code 

Full URL to the builder-live.log(.gz) for the source (SRPM) build.

Decorators:
  • @property

source_backend_log_url(self)

source code 

Full URL to the builder-live.log(.gz) for the source (SRPM) build.

Decorators:
  • @property

source_json_dict(self)

source code 
Decorators:
  • @property

started_on(self)

source code 
Decorators:
  • @property

min_started_on(self)

source code 
Decorators:
  • @property

ended_on(self)

source code 
Decorators:
  • @property

max_ended_on(self)

source code 
Decorators:
  • @property

chroots_started_on(self)

source code 
Decorators:
  • @property

chroots_ended_on(self)

source code 
Decorators:
  • @property

source_type_text(self)

source code 
Decorators:
  • @property

source_metadata(self)

source code 
Decorators:
  • @property

chroot_states(self)

source code 
Decorators:
  • @property

chroots_dict_by_name(self)

source code 
Decorators:
  • @property

source_state(self)

source code 

Return text representation of status of this build

Decorators:
  • @property

status(self)

source code 

Return build status.

Decorators:
  • @property

state(self)

source code 

Return text representation of status of this build.

Decorators:
  • @property

cancelable(self)

source code 

Find out if this build is cancelable.

Decorators:
  • @property

repeatable(self)

source code 

Find out if this build is repeatable.

Build is repeatable only if sources has been imported.

Decorators:
  • @property

finished_early(self)

source code 

Check if the build has finished, and if that happened prematurely
because:
- it was canceled
- it failed to generate/download sources).
That said, whether it's clear that the build has finished and we don't
have to do additional SQL query to check corresponding BuildChroots.

Decorators:
  • @property

finished(self)

source code 

Find out if this build is in finished state.

Build is finished only if all its build_chroots are in finished state or the build was canceled.

Decorators:
  • @property

blocked(self)

source code 
Decorators:
  • @property

persistent(self)

source code 

Find out if this build is persistent.

This property is inherited from the project.

Decorators:
  • @property

package_name(self)

source code 
Decorators:
  • @property

to_dict(self, options=None, with_chroot_states=False)

source code 

Usage:

SQLAlchObject.to_dict() => returns a flat dict of the object
SQLAlchObject.to_dict({"foo": {}}) => returns a dict of the object
    and will include a flat dict of object foo inside of that
SQLAlchObject.to_dict({"foo": {"bar": {}}, "spam": {}}) => returns
    a dict of the object, which will include dict of foo
    (which will include dict of bar) and dict of spam.

Options can also contain two special values: __columns_only__
and __columns_except__

If present, the first makes only specified fields appear,
the second removes specified fields. Both of these fields
must be either strings (only works for one field) or lists
(for one and more fields).

SQLAlchObject.to_dict({"foo": {"__columns_except__": ["id"]},
    "__columns_only__": "name"}) =>

The SQLAlchObject will only put its "name" into the resulting dict,
while "foo" all of its fields except "id".

Options can also specify whether to include foo_id when displaying
related foo object (__included_ids__, defaults to True).
This doesn"t apply when __columns_only__ is specified.

Overrides: helpers.Serializer.to_dict
(inherited documentation)

submitter(self)

source code 

Return tuple (submitter_string, submitter_link), while the submitter_link may be empty if we are not able to detect it wisely.

Decorators:
  • @property

sandbox(self)

source code 

Return a string unique to project + submitter. At this level copr backend later applies builder user-VM separation policy (VMs are only re-used for builds which have the same build.sandbox value)

Decorators:
  • @property

resubmitted_from(self)

source code 
Decorators:
  • @property

source_is_uploaded(self)

source code 
Decorators:
  • @property

bootstrap_set(self)

source code 

Is bootstrap config from project/chroot overwritten by build?

Decorators:
  • @property

batching_user_error(self, user, modify=False)

source code 

Check if the USER can operate with this build in batches, eg create a new batch for it, or add other builds to the existing batch. Return the error message (or None, if everything is OK).


Class Variable Details [hide private]

__table_args__

Value:
db.Index('build_canceled', "canceled"), db.Index('build_order', "is_ba\
ckground", "id"), db.Index('build_filter', "source_type", "canceled"),\
 db.Index('build_canceled_is_background_source_status_id_idx', 'cancel\
ed', "is_background", "source_status", "id"), db.Index('build_copr_id_\
package_id', "copr_id", "package_id")

result_dir

Value:
db.Column(db.Text, default= '', server_default= '', nullable= False)

memory_reqs

Value:
db.Column(db.Integer, default= app.config ["DEFAULT_BUILD_MEMORY"])

timeout

Value:
db.Column(db.Integer, default= app.config ["DEFAULT_BUILD_TIMEOUT"])

enable_net

Value:
db.Column(db.Boolean, default= False, server_default= "0", nullable= F\
alse)

source_type

Value:
db.Column(db.Integer, default= helpers.BuildSourceEnum("unset"))

is_background

Value:
db.Column(db.Boolean, default= False, server_default= "0", nullable= F\
alse)

source_status

Value:
db.Column(db.Integer, default= StatusEnum("waiting"))

user_id

Value:
db.Column(db.Integer, db.ForeignKey("user.id"), index= True)

copr_id

Value:
db.Column(db.Integer, db.ForeignKey("copr.id"), index= True)

package_id

Value:
db.Column(db.Integer, db.ForeignKey("package.id"), index= True)

module_id

Value:
db.Column(db.Integer, db.ForeignKey("module.id"), index= True)

copr_dir_id

Value:
db.Column(db.Integer, db.ForeignKey("copr_dir.id"), index= True)

copr_dir

Value:
db.relationship("CoprDir", backref= db.backref("builds"))