@@ -76,13 +76,22 @@ def search_repositories(self) -> Iterator[dict[str, Any]]:
76
76
# custom RetryConfig above) once
77
77
# <https://github.com/G-Node/gogs/issues/148> is resolved:
78
78
###
79
- # for datum in self.paginate("/repos/search"):
79
+ # for datum in self.paginate(
80
+ # "/repos/search", params={"private": "false", "is_private": "false"}
81
+ # ):
80
82
# yield GINRepo.from_data(datum)
81
83
###
82
84
page = 1
83
85
while True :
84
86
try :
85
- r = self .get ("/repos/search" , params = {"page" : page }, raw = True )
87
+ r = self .get (
88
+ "/repos/search" ,
89
+ # `private` and `is_private` are supported by the forgejo
90
+ # family (e.g., hub.datalad.org) but not GIN itself; for
91
+ # that, we filter on the "private" field below.
92
+ params = {"page" : page , "private" : "false" , "is_private" : "false" },
93
+ raw = True ,
94
+ )
86
95
except PrettyHTTPError as e :
87
96
if e .response .status_code == 500 :
88
97
log .warning (
@@ -102,6 +111,8 @@ def search_repositories(self) -> Iterator[dict[str, Any]]:
102
111
103
112
def get_datalad_repos (self ) -> Iterator [GINRepo ]:
104
113
for datum in self .search_repositories ():
114
+ if datum .get ("private" , False ):
115
+ continue
105
116
repo = GINRepo .from_data (datum )
106
117
if self .has_datalad_config (repo .name , datum ["default_branch" ]):
107
118
log .info ("Found DataLad repo on GIN: %r (ID: %d)" , repo .name , repo .id )
0 commit comments