mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-05 11:48:33 +08:00
defer commit of module entry until we set the context and validate
This commit is contained in:
@@ -621,6 +621,7 @@ class ModuleBuild(MBSBase):
|
||||
rebuild_strategy=None,
|
||||
scratch=False,
|
||||
srpms=None,
|
||||
commit=True,
|
||||
**kwargs
|
||||
):
|
||||
now = datetime.utcnow()
|
||||
@@ -650,7 +651,8 @@ class ModuleBuild(MBSBase):
|
||||
module.buildrequires.append(base_module)
|
||||
|
||||
db_session.add(module)
|
||||
db_session.commit()
|
||||
if commit:
|
||||
db_session.commit()
|
||||
return module
|
||||
|
||||
def transition(self, db_session, conf, state, state_reason=None, failure_type="unspec"):
|
||||
|
||||
@@ -701,6 +701,8 @@ def submit_module_build(db_session, username, stream_or_packager, params, module
|
||||
reused_module_id=params.get("reuse_components_from"),
|
||||
scratch=params.get("scratch"),
|
||||
srpms=params.get("srpms"),
|
||||
# don't commit now, we do it ourselves below
|
||||
commit=False,
|
||||
)
|
||||
module.build_context, module.runtime_context, module.context, \
|
||||
module.build_context_no_bms = module.contexts_from_mmd(module.modulemd)
|
||||
|
||||
Reference in New Issue
Block a user