Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
swh-lister
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nicolas Dandrimont
swh-lister
Commits
aefb260f
Verified
Commit
aefb260f
authored
4 years ago
by
Antoine R. Dumont
Browse files
Options
Downloads
Patches
Plain Diff
gitlab: Add support for last_update information during listing
parent
1a19b2c7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
swh/lister/gitlab/lister.py
+2
-2
2 additions, 2 deletions
swh/lister/gitlab/lister.py
swh/lister/gitlab/tests/test_lister.py
+3
-0
3 additions, 0 deletions
swh/lister/gitlab/tests/test_lister.py
with
5 additions
and
2 deletions
swh/lister/gitlab/lister.py
+
2
−
2
View file @
aefb260f
...
...
@@ -9,6 +9,7 @@ import random
from
typing
import
Any
,
Dict
,
Iterator
,
Optional
,
Tuple
from
urllib.parse
import
parse_qs
,
urlparse
import
iso8601
import
requests
from
requests.exceptions
import
HTTPError
from
requests.status_codes
import
codes
...
...
@@ -174,8 +175,7 @@ class GitLabLister(Lister[GitLabListerState, PageResult]):
lister_id
=
self
.
lister_obj
.
id
,
url
=
repo
[
"
http_url_to_repo
"
],
visit_type
=
"
git
"
,
# TODO: Support "last_activity_at" as update information
# last_update=repo["last_activity_at"],
last_update
=
iso8601
.
parse_date
(
repo
[
"
last_activity_at
"
]),
)
def
commit_page
(
self
,
page_result
:
PageResult
)
->
None
:
...
...
This diff is collapsed.
Click to expand it.
swh/lister/gitlab/tests/test_lister.py
+
3
−
0
View file @
aefb260f
...
...
@@ -53,6 +53,7 @@ def test_lister_gitlab(datadir, swh_scheduler, requests_mock):
for
listed_origin
in
scheduler_origins
:
assert
listed_origin
.
visit_type
==
"
git
"
assert
listed_origin
.
url
.
startswith
(
f
"
https://
{
instance
}
"
)
assert
listed_origin
.
last_update
is
not
None
def
gitlab_page_response
(
datadir
,
instance
:
str
,
page_id
:
int
)
->
List
[
Dict
]:
...
...
@@ -94,6 +95,7 @@ def test_lister_gitlab_with_pages(swh_scheduler, requests_mock, datadir):
for
listed_origin
in
scheduler_origins
:
assert
listed_origin
.
visit_type
==
"
git
"
assert
listed_origin
.
url
.
startswith
(
f
"
https://
{
instance
}
"
)
assert
listed_origin
.
last_update
is
not
None
def
test_lister_gitlab_incremental
(
swh_scheduler
,
requests_mock
,
datadir
):
...
...
@@ -155,6 +157,7 @@ def test_lister_gitlab_incremental(swh_scheduler, requests_mock, datadir):
for
listed_origin
in
scheduler_origins
:
assert
listed_origin
.
visit_type
==
"
git
"
assert
listed_origin
.
url
.
startswith
(
f
"
https://
{
instance
}
"
)
assert
listed_origin
.
last_update
is
not
None
def
test_lister_gitlab_rate_limit
(
swh_scheduler
,
requests_mock
,
datadir
,
mocker
):
...
...
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