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
Anjan Momi
mrhlpr
Commits
7fce8005
Verified
Commit
7fce8005
authored
11 months ago
by
Zach DeCook
Committed by
Newbyte
11 months ago
Browse files
Options
Downloads
Patches
Plain Diff
mrtest: fix origin using new GitLabOrigin object (MR 40)
parent
afc979c5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
mrhlpr/mr.py
+2
-2
2 additions, 2 deletions
mrhlpr/mr.py
mrtest/__init__.py
+1
-1
1 addition, 1 deletion
mrtest/__init__.py
mrtest/add_packages.py
+1
-1
1 addition, 1 deletion
mrtest/add_packages.py
mrtest/origin.py
+20
-16
20 additions, 16 deletions
mrtest/origin.py
with
24 additions
and
20 deletions
mrhlpr/mr.py
+
2
−
2
View file @
7fce8005
...
...
@@ -127,7 +127,7 @@ def get_artifacts_zip(mr_id, no_cache=False, origin=None):
:returns: path to downloaded artifacts.zip file
"""
# Get the latest pipeline (without cache so we don't miss newer ones)
url_mr
=
"
/projects/{}/merge_requests/{}
"
.
format
(
origin
[
"
api_project_id
"
]
,
mr_id
)
url_mr
=
"
/projects/{}/merge_requests/{}
"
.
format
(
origin
.
api_project_id
,
mr_id
)
api
=
gitlab
.
download_json
(
origin
,
url_mr
,
no_cache
=
True
)
if
"
pipeline
"
not
in
api
:
logging
.
error
(
"
ERROR: no pipeline found in merge request
"
)
...
...
@@ -155,7 +155,7 @@ def get_artifacts_zip(mr_id, no_cache=False, origin=None):
exit
(
1
)
# Download artifacts zip (with cache)
return
gitlab
.
download_artifacts_zip
(
origin
[
"
api
"
]
,
pipeline_project_id
,
job
)
return
gitlab
.
download_artifacts_zip
(
origin
.
api
,
pipeline_project_id
,
job
)
def
checkout
(
...
...
This diff is collapsed.
Click to expand it.
mrtest/__init__.py
+
1
−
1
View file @
7fce8005
...
...
@@ -17,7 +17,7 @@ def get_virtual_group(origin, mr_id):
packages from a merge request.
:param origin: gitlab origin information, see gitlab.parse_git_origin()
:param mr_id: merge request ID
"""
return
f
"
.mrtest-
{
mr_id
}
-
{
origin
[
'
project
'
]
}
"
return
f
"
.mrtest-
{
mr_id
}
-
{
origin
.
project
}
"
def
is_root_user
():
...
...
This diff is collapsed.
Click to expand it.
mrtest/add_packages.py
+
1
−
1
View file @
7fce8005
...
...
@@ -73,7 +73,7 @@ def confirm_mr_id(origin, mr_id):
:param origin: gitlab origin information, see gitlab.parse_git_origin()
:param mr_id: merge request ID
"""
link
=
f
"
https://
{
origin
[
'
host
'
]
}
/
{
origin
[
'
project_id
'
]
}
/-/merge_requests/
{
mr_id
}
"
link
=
f
"
https://
{
origin
.
host
}
/
{
origin
.
project_id
}
/-/merge_requests/
{
mr_id
}
"
status
=
mrhlpr
.
mr
.
get_status
(
mr_id
,
origin
=
origin
)
...
...
This diff is collapsed.
Click to expand it.
mrtest/origin.py
+
20
−
16
View file @
7fce8005
...
...
@@ -3,20 +3,24 @@
"""
Origin information about gitlab instances relevant to mrtest, in the format
needed for mrhlpr.gitlab.parse_git_origin().
"""
pmaports
=
{
"
api
"
:
"
https://gitlab.com/api/v4
"
,
"
api_project_id
"
:
"
postmarketOS%2Fpmaports
"
,
"
full
"
:
"
git@gitlab.com:postmarketOS/pmaports.git
"
,
"
project
"
:
"
postmarketOS
"
,
"
project_id
"
:
"
postmarketOS/pmaports
"
,
"
host
"
:
"
gitlab.com
"
,
}
from
mrhlpr.gitlab
import
GitLabOrigin
aports
=
{
"
api
"
:
"
https://gitlab.alpinelinux.org/api/v4
"
,
"
api_project_id
"
:
"
alpine%2Faports
"
,
"
full
"
:
"
git@gitlab.alpinelinux.org:alpine/aports.git
"
,
"
project
"
:
"
alpine
"
,
"
project_id
"
:
"
alpine/aports
"
,
"
host
"
:
"
gitlab.alpinelinux.org
"
,
}
pmaports
=
GitLabOrigin
(
api
=
"
https://gitlab.com/api/v4
"
,
api_project_id
=
"
postmarketOS%2Fpmaports
"
,
full
=
"
git@gitlab.com:postmarketOS/pmaports.git
"
,
project
=
"
postmarketOS
"
,
project_id
=
"
postmarketOS/pmaports
"
,
host
=
"
gitlab.com
"
,
username
=
None
,
)
aports
=
GitLabOrigin
(
api
=
"
https://gitlab.alpinelinux.org/api/v4
"
,
api_project_id
=
"
alpine%2Faports
"
,
full
=
"
git@gitlab.alpinelinux.org:alpine/aports.git
"
,
project
=
"
alpine
"
,
project_id
=
"
alpine/aports
"
,
host
=
"
gitlab.alpinelinux.org
"
,
username
=
None
,
)
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