Skip to content

Commit 4c5da1e

Browse files
authored
git: option not to update series on tags
Currently, when a new tag is sent on the mailing list, the series is updated in the Git repository. The push is done with '-o ci.skip', but this seems to be something specific to GitLab. It has no effects with GitHub for example. Not to waste resources on retesting everything and sending notifications once a tag is shared, a new per-project option has been added: update_series_on_tags Not to change the current behaviour, series will continue to be updated on new tags by default, except if this option is explicitly disabled.
1 parent 831a92b commit 4c5da1e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

mods/git.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@ class GitModule(PatchewModule):
8787
desc="Publicly visible URL template for applied branch, where %t will be replaced by the applied tag name",
8888
required=True,
8989
),
90+
schema.BooleanSchema(
91+
"update_series_on_tags",
92+
"Update series on new tags",
93+
desc="Whether series are pushed (overriden) when new tags are sent on the mailing list",
94+
),
9095
],
9196
)
9297

@@ -109,7 +114,11 @@ def mark_as_pending_apply(self, series, data={}):
109114
r.save()
110115

111116
def on_tags_update(self, event, series, **params):
112-
if series.is_complete:
117+
config = self.get_project_config(series.project)
118+
update_series_on_tags = config["update_series_on_tags"] \
119+
if "update_series_on_tags" in config else False
120+
121+
if update_series_on_tags and series.is_complete:
113122
self.mark_as_pending_apply(
114123
series,
115124
{

0 commit comments

Comments
 (0)