diff --git a/app/blueprints/packages/releases.py b/app/blueprints/packages/releases.py index b4c370aa..f58d68ba 100644 --- a/app/blueprints/packages/releases.py +++ b/app/blueprints/packages/releases.py @@ -274,10 +274,15 @@ def set_update_config(package, form): package.update_config.ref = nonEmptyOrNone(form.ref.data) package.update_config.make_release = form.action.data == "make_release" - if package.update_config.last_commit is None: - last_release = package.releases.first() - if last_release and last_release.commit_hash: - package.update_config.last_commit = last_release.commit_hash + if package.update_config.trigger == PackageUpdateTrigger.COMMIT: + if package.update_config.last_commit is None: + last_release = package.releases.first() + if last_release and last_release.commit_hash: + package.update_config.last_commit = last_release.commit_hash + elif package.update_config.trigger == PackageUpdateTrigger.TAG: + # Only create releases for tags created after this + package.update_config.last_commit = None + package.update_config.last_tag = None package.update_config.outdated_at = None package.update_config.auto_created = False diff --git a/app/blueprints/todo/__init__.py b/app/blueprints/todo/__init__.py index e4790677..be972593 100644 --- a/app/blueprints/todo/__init__.py +++ b/app/blueprints/todo/__init__.py @@ -214,7 +214,7 @@ def apply_all_updates(username): makeVCSRelease.apply_async((rel.id, ref), task_id=rel.task_id) - msg = "Created release {} (Applied all Git Update Config)".format(rel.title) + msg = "Created release {} (Applied all Git Update Detection)".format(rel.title) addNotification(package.maintainers, current_user, NotificationType.PACKAGE_EDIT, msg, rel.getEditURL(), package) addAuditLog(AuditSeverity.NORMAL, current_user, msg, package.getDetailsURL(), package) diff --git a/app/tasks/importtasks.py b/app/tasks/importtasks.py index aa225ab7..960830b5 100644 --- a/app/tasks/importtasks.py +++ b/app/tasks/importtasks.py @@ -327,6 +327,9 @@ def check_update_config_impl(package): else: raise TaskError("Unknown update trigger") + if commit is None: + return + if config.last_commit == commit: if tag and config.last_tag != tag: config.last_tag = tag