repoactive 0.2.8.dev1__tar.gz → 0.2.8.dev2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {repoactive-0.2.8.dev1 → repoactive-0.2.8.dev2}/PKG-INFO +1 -1
- {repoactive-0.2.8.dev1 → repoactive-0.2.8.dev2}/pyproject.toml +1 -1
- {repoactive-0.2.8.dev1 → repoactive-0.2.8.dev2}/src/repoactive/platforms/gitlab.py +30 -26
- {repoactive-0.2.8.dev1 → repoactive-0.2.8.dev2}/.gitignore +0 -0
- {repoactive-0.2.8.dev1 → repoactive-0.2.8.dev2}/LICENSE +0 -0
- {repoactive-0.2.8.dev1 → repoactive-0.2.8.dev2}/README.md +0 -0
- {repoactive-0.2.8.dev1 → repoactive-0.2.8.dev2}/src/repoactive/__init__.py +0 -0
- {repoactive-0.2.8.dev1 → repoactive-0.2.8.dev2}/src/repoactive/boxquote.py +0 -0
- {repoactive-0.2.8.dev1 → repoactive-0.2.8.dev2}/src/repoactive/cli.py +0 -0
- {repoactive-0.2.8.dev1 → repoactive-0.2.8.dev2}/src/repoactive/config.py +0 -0
- {repoactive-0.2.8.dev1 → repoactive-0.2.8.dev2}/src/repoactive/constants.py +0 -0
- {repoactive-0.2.8.dev1 → repoactive-0.2.8.dev2}/src/repoactive/graph.py +0 -0
- {repoactive-0.2.8.dev1 → repoactive-0.2.8.dev2}/src/repoactive/jj.py +0 -0
- {repoactive-0.2.8.dev1 → repoactive-0.2.8.dev2}/src/repoactive/jobtree.py +0 -0
- {repoactive-0.2.8.dev1 → repoactive-0.2.8.dev2}/src/repoactive/lock.py +0 -0
- {repoactive-0.2.8.dev1 → repoactive-0.2.8.dev2}/src/repoactive/platforms/__init__.py +0 -0
- {repoactive-0.2.8.dev1 → repoactive-0.2.8.dev2}/src/repoactive/platforms/base.py +0 -0
- {repoactive-0.2.8.dev1 → repoactive-0.2.8.dev2}/src/repoactive/platforms/github.py +0 -0
- {repoactive-0.2.8.dev1 → repoactive-0.2.8.dev2}/src/repoactive/progress.py +0 -0
- {repoactive-0.2.8.dev1 → repoactive-0.2.8.dev2}/src/repoactive/runner.py +0 -0
- {repoactive-0.2.8.dev1 → repoactive-0.2.8.dev2}/src/repoactive/selection.py +0 -0
- {repoactive-0.2.8.dev1 → repoactive-0.2.8.dev2}/src/repoactive/settings.py +0 -0
- {repoactive-0.2.8.dev1 → repoactive-0.2.8.dev2}/src/repoactive/trailers.py +0 -0
- {repoactive-0.2.8.dev1 → repoactive-0.2.8.dev2}/src/repoactive/ui.py +0 -0
- {repoactive-0.2.8.dev1 → repoactive-0.2.8.dev2}/src/repoactive/updates.py +0 -0
|
@@ -94,35 +94,39 @@ class GitLabPlatform(Platform):
|
|
|
94
94
|
return web_url
|
|
95
95
|
|
|
96
96
|
def _enable_auto_merge(self, mr: ProjectMergeRequest) -> None:
|
|
97
|
-
"""Enable auto-merge on ``mr``,
|
|
98
|
-
|
|
99
|
-
The merge call sends both auto-merge parameters
|
|
100
|
-
``auto_merge`` selects the "merge when checks pass" strategy
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
97
|
+
"""Enable auto-merge on ``mr``, retrying until it is accepted.
|
|
98
|
+
|
|
99
|
+
The merge call sends both auto-merge parameters: on GitLab >= 17.11
|
|
100
|
+
``auto_merge`` selects the "merge when checks pass" strategy and older
|
|
101
|
+
GitLab ignores it and honors the deprecated
|
|
102
|
+
merge_when_pipeline_succeeds. Right after a push GitLab rejects the
|
|
103
|
+
call (405/422) while its state is still settling - the mergeability
|
|
104
|
+
check runs, the MR pipeline gets created and linked - so a rejection
|
|
105
|
+
is retried until the deadline, waiting in between for the MR to look
|
|
106
|
+
ready (re-fetched, since list/create payloads omit head_pipeline).
|
|
107
|
+
That readiness gate keeps the old-GitLab semantics: retrying without a
|
|
108
|
+
pipeline there would merge immediately and skip CI. A repo with no CI
|
|
109
|
+
never grows a pipeline; there the wait times out and one final call
|
|
109
110
|
merges immediately, the best available behavior.
|
|
110
111
|
"""
|
|
111
|
-
try:
|
|
112
|
-
mr.merge(merge_when_pipeline_succeeds=True, auto_merge=True)
|
|
113
|
-
return
|
|
114
|
-
except GitlabMRClosedError:
|
|
115
|
-
# python-gitlab wraps every merge failure in GitlabMRClosedError;
|
|
116
|
-
# this is the 422/405 "not ready yet" case, not a closed MR.
|
|
117
|
-
pass
|
|
118
112
|
iid = mr.iid
|
|
119
113
|
deadline = time.monotonic() + _AUTO_MERGE_TIMEOUT
|
|
114
|
+
final_attempt = False
|
|
120
115
|
while True:
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
116
|
+
try:
|
|
117
|
+
mr.merge(merge_when_pipeline_succeeds=True, auto_merge=True)
|
|
118
|
+
return
|
|
119
|
+
except GitlabMRClosedError as e:
|
|
120
|
+
# python-gitlab wraps every merge failure in
|
|
121
|
+
# GitlabMRClosedError; this is usually the 422/405 "not ready
|
|
122
|
+
# yet" case, not a closed MR.
|
|
123
|
+
if final_attempt:
|
|
124
|
+
print(f" warning: could not enable auto-merge ({e})")
|
|
125
|
+
return
|
|
124
126
|
time.sleep(_AUTO_MERGE_POLL_INTERVAL)
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
while True:
|
|
128
|
+
mr = self._project.mergerequests.get(iid)
|
|
129
|
+
if _ready_for_auto_merge(mr) or time.monotonic() >= deadline:
|
|
130
|
+
break
|
|
131
|
+
time.sleep(_AUTO_MERGE_POLL_INTERVAL)
|
|
132
|
+
final_attempt = time.monotonic() >= deadline
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|