| |
@@ -230,7 +230,7 @@
|
| |
class CoprFormFactory(object):
|
| |
|
| |
@staticmethod
|
| |
- def create_form_cls(mock_chroots=None, user=None, group=None):
|
| |
+ def create_form_cls(mock_chroots=None, user=None, group=None, copr=None):
|
| |
class F(FlaskForm):
|
| |
# also use id here, to be able to find out whether user
|
| |
# is updating a copr if so, we don't want to shout
|
| |
@@ -263,6 +263,14 @@
|
| |
|
| |
instructions = wtforms.TextAreaField("Instructions")
|
| |
|
| |
+ delete_after_days = wtforms.IntegerField(
|
| |
+ "Delete after days",
|
| |
+ validators=[
|
| |
+ wtforms.validators.Optional(),
|
| |
+ wtforms.validators.NumberRange(min=0, max=60),
|
| |
+ ],
|
| |
+ render_kw={'disabled': bool(copr and copr.persistent)})
|
| |
+
|
| |
repos = wtforms.TextAreaField(
|
| |
"External Repositories",
|
| |
validators=[UrlRepoListValidator()],
|
| |
@@ -275,16 +283,61 @@
|
| |
UrlSrpmListValidator()],
|
| |
filters=[StringListFilter()])
|
| |
|
| |
- disable_createrepo = wtforms.BooleanField(default=False, false_values=FALSE_VALUES)
|
| |
- unlisted_on_hp = wtforms.BooleanField("Do not display this project on home page", default=False, false_values=FALSE_VALUES)
|
| |
- persistent = wtforms.BooleanField(default=False, false_values=FALSE_VALUES)
|
| |
- auto_prune = wtforms.BooleanField("If backend auto-prunning script should be run for this project", default=True, false_values=FALSE_VALUES)
|
| |
- use_bootstrap_container = wtforms.BooleanField("Enable use_bootstrap_container mock's feature (experimental)", default=False, false_values=FALSE_VALUES)
|
| |
- follow_fedora_branching = wtforms.BooleanField("If newly branched chroots should be automatically enabled and populated.", default=True, false_values=FALSE_VALUES)
|
| |
+ disable_createrepo = wtforms.BooleanField(default=False,
|
| |
+ label="Create repositories manually",
|
| |
+ description="""When Fedora is branched from rawhide, the
|
| |
+ respective chroots for the new branch are automatically
|
| |
+ created for you (as soon as they are available) as rawhide
|
| |
+ chroot forks.""",
|
| |
+ false_values=FALSE_VALUES)
|
| |
+
|
| |
+ unlisted_on_hp = wtforms.BooleanField(
|
| |
+ "Project will not be listed on home page",
|
| |
+ default=False,
|
| |
+ false_values=FALSE_VALUES)
|
| |
+
|
| |
+ persistent = wtforms.BooleanField(
|
| |
+ "Protect project and its builds against deletion",
|
| |
+ description="""Project's builds and the project itself
|
| |
+ cannot be deleted by any means. This option is set once and
|
| |
+ for all (this option can not be changed after project is
|
| |
+ created).""",
|
| |
+ render_kw={'disabled': bool(copr)},
|
| |
+ default=False, false_values=FALSE_VALUES)
|
| |
+
|
| |
+ auto_prune = wtforms.BooleanField(
|
| |
+ "Old builds will be deleted automatically",
|
| |
+ default=True, false_values=FALSE_VALUES,
|
| |
+ description="""Build will be deleted only if there is a
|
| |
+ newer build (with respect to package version) and it is
|
| |
+ older than 14 days""")
|
| |
+
|
| |
+ use_bootstrap_container = wtforms.BooleanField(
|
| |
+ "Enable mock's use_bootstrap_container experimental feature",
|
| |
+ description="""This will make the build slower but it has an
|
| |
+ advantage that the dnf _from_ the given chroot will be used
|
| |
+ to setup the chroot (otherwise host system dnf and rpm is
|
| |
+ used)""",
|
| |
+ default=False,
|
| |
+ false_values=FALSE_VALUES)
|
| |
+
|
| |
+ follow_fedora_branching = wtforms.BooleanField(
|
| |
+ "Follow Fedora branching",
|
| |
+ description="""When Fedora is branched from rawhide, the
|
| |
+ respective chroots for the new branch are automatically
|
| |
+ created for you (as soon as they are available) as rawhide
|
| |
+ chroot forks.""",
|
| |
+ default=True,
|
| |
+ false_values=FALSE_VALUES)
|
| |
|
| |
# Deprecated, use `enable_net` instead
|
| |
- build_enable_net = wtforms.BooleanField(default=False, false_values=FALSE_VALUES)
|
| |
- enable_net = wtforms.BooleanField(default=False, false_values=FALSE_VALUES)
|
| |
+ build_enable_net = wtforms.BooleanField(
|
| |
+ "Enable internet access during builds",
|
| |
+ default=False, false_values=FALSE_VALUES)
|
| |
+
|
| |
+ enable_net = wtforms.BooleanField(
|
| |
+ "Enable internet access during builds",
|
| |
+ default=False, false_values=FALSE_VALUES)
|
| |
|
| |
@property
|
| |
def selected_chroots(self):
|
| |
@@ -301,6 +354,12 @@
|
| |
if not self.validate_mock_chroots_not_empty():
|
| |
self.errors["chroots"] = ["At least one chroot must be selected"]
|
| |
return False
|
| |
+
|
| |
+ if self.persistent.data and self.delete_after_days.data:
|
| |
+ self.delete_after_days.errors.append(
|
| |
+ "'delete after' can not be combined with persistent")
|
| |
+ return False
|
| |
+
|
| |
return True
|
| |
|
| |
def validate_mock_chroots_not_empty(self):
|
| |
@@ -984,6 +1043,11 @@
|
| |
auto_prune = wtforms.BooleanField(validators=[wtforms.validators.Optional()], false_values=FALSE_VALUES)
|
| |
use_bootstrap_container = wtforms.BooleanField(validators=[wtforms.validators.Optional()], false_values=FALSE_VALUES)
|
| |
follow_fedora_branching = wtforms.BooleanField(validators=[wtforms.validators.Optional()], false_values=FALSE_VALUES)
|
| |
+ follow_fedora_branching = wtforms.BooleanField(default=True, false_values=FALSE_VALUES)
|
| |
+ delete_after_days = wtforms.IntegerField(
|
| |
+ validators=[wtforms.validators.Optional(),
|
| |
+ wtforms.validators.NumberRange(min=-1, max=60)],
|
| |
+ filters=[(lambda x : -1 if x is None else x)])
|
| |
|
| |
# Deprecated, use `enable_net` instead
|
| |
build_enable_net = wtforms.BooleanField(validators=[wtforms.validators.Optional()], false_values=FALSE_VALUES)
|
| |
Fixes: #615