Skip to content

git: option not to update series on tags #143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion mods/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ class GitModule(PatchewModule):
desc="Publicly visible URL template for applied branch, where %t will be replaced by the applied tag name",
required=True,
),
schema.BooleanSchema(
"update_series_on_tags",
"Update series on new tags",
desc="Whether series are pushed (overriden) when new tags are sent on the mailing list, on by default",
default=True,
),
],
)

Expand All @@ -109,7 +115,10 @@ def mark_as_pending_apply(self, series, data={}):
r.save()

def on_tags_update(self, event, series, **params):
if series.is_complete:
config = self.get_project_config(series.project)
update_series_on_tags = config.get("update_series_on_tags", True)

if update_series_on_tags and series.is_complete:
self.mark_as_pending_apply(
series,
{
Expand Down
12 changes: 12 additions & 0 deletions tests/test_git.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,5 +257,17 @@ def test_git_push_options(self):
out, err = self.do_apply(True)
self.assertIn("ci.skip", out)

def test_no_update_series_on_tags(self):
# No need to test the opposite (default value), implicitly tested before
self.p.config["git"]["update_series_on_tags"] = False
self.p.save()
self.cli_import("0013-foo-patch.mbox.gz")
self.do_apply(True)

# Getting a new reviewed-by shouldn't trigger re-push
self.cli_import("0025-foo-patch-review.mbox.gz")
out, err = self.do_apply(True)
self.assertIn("No series need apply", out)

if __name__ == "__main__":
main()