Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
mrhlpr
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
postmarketOS
mrhlpr
Commits
ab12663b
Unverified
Commit
ab12663b
authored
11 months ago
by
Newbyte
Browse files
Options
Downloads
Patches
Plain Diff
mrhlpr.mr: Add more type hints (MR 38)
parent
2dac23a7
No related branches found
No related tags found
1 merge request
!38
mrhlpr: Allow skipping approval, reword comment request, add more type, improve auto merge robustness
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mrhlpr/mr.py
+7
-5
7 additions, 5 deletions
mrhlpr/mr.py
with
7 additions
and
5 deletions
mrhlpr/mr.py
+
7
−
5
View file @
ab12663b
...
...
@@ -160,7 +160,7 @@ def get_artifacts_zip(mr_id, no_cache=False, origin=None):
def
checkout
(
mr_id
:
int
,
no_cache
:
bool
=
False
,
fetch
:
bool
=
False
,
overwrite_remote
:
bool
=
False
):
)
->
None
:
"""
Add the MR
'
s source repository as git remote, fetch it and checkout the
branch used in the merge request.
...
...
@@ -292,7 +292,7 @@ def checkout(
mrdb
.
set
(
origin
.
host
,
origin
.
project_id
,
branch_local
,
mr_id
)
def
commits_have_mr_id
(
commits
:
list
[
str
],
mr_id
:
int
):
def
commits_have_mr_id
(
commits
:
list
[
str
],
mr_id
:
int
)
->
bool
:
"""
Check if all given commits have the MR-ID in the subject.
:param commits: return value from git.commits_on_top_of()
...
...
@@ -369,7 +369,7 @@ def commits_follow_format(commits: list[str]) -> tuple[Optional[bool], list[Any]
return
(
result
,
subj_err
)
def
commits_are_signed
(
commits
:
list
[
str
]):
def
commits_are_signed
(
commits
:
list
[
str
])
->
bool
:
"""
Check if all given commits are signed.
:param commits: return value from git.commits_on_top_of()
...
...
@@ -414,7 +414,7 @@ def run_git_filter_branch(
def
fixmsg
(
mr_id
:
int
,
skip_build
:
bool
=
False
,
ignore_count
:
bool
=
False
,
skip_vercheck
:
bool
=
False
):
)
->
None
:
"""
Add the MR-ID in each commit of the MR.
:param mr_id: merge request ID
"""
...
...
@@ -444,7 +444,9 @@ def fixmsg(
run_git_filter_branch
(
"
msg_filter_add_label.py
"
,
"
HEAD~1
"
,
label
=
"
skip_vercheck
"
)
def
finish
(
mr_id
:
int
,
comment
:
str
|
None
,
no_cache
:
bool
=
False
,
skip_approve
:
bool
=
False
):
def
finish
(
mr_id
:
int
,
comment
:
Optional
[
str
],
no_cache
:
bool
=
False
,
skip_approve
:
bool
=
False
)
->
None
:
if
"
gitlab
"
not
in
sys
.
modules
:
logging
.
error
(
"
python-gitlab is needed to run
'
finish
'"
)
exit
(
1
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment