@@ -18,6 +18,7 @@ class Config(BaseSettings):
1818 git_cache_keys : typing .Dict [str , str ] = {
1919 'rpms' : 'rpms_gitea_cache' ,
2020 'modules' : 'modules_gitea_cache' ,
21+ 'autopatch' : 'autopatch_gitea_cache' ,
2122 }
2223 cacher_sentry_environment : str = "dev"
2324 cacher_sentry_dsn : str = ""
@@ -56,9 +57,12 @@ async def run(config, logger, redis_client, gitea_client, organization):
5657 to_index = []
5758 git_names = set ()
5859 for repo in await gitea_client .list_repos (organization ):
59- if repo ['empty' ] is True :
60+ if repo ['empty' ]:
6061 logger .warning (f"Skipping empty repo { repo ['html_url' ]} " )
6162 continue
63+ if organization == 'autopatch' and repo ['archived' ]:
64+ logger .warning (f"Skipping archived repo { repo ['html_url' ]} " )
65+ continue
6266 repo_name = repo ['full_name' ]
6367 git_names .add (repo_name )
6468 repo_meta = {
@@ -79,6 +83,13 @@ async def run(config, logger, redis_client, gitea_client, organization):
7983 for result in results :
8084 cache_record = cache [result ['repo_name' ]]
8185 cache_record ['tags' ] = [tag ['name' ] for tag in result ['tags' ]]
86+ if organization == 'autopatch' :
87+ cache_record ['branches' ] = [
88+ branch
89+ for branch in result ['branches' ]
90+ if not branch ['name' ].endswith ('-deprecated' )
91+ ]
92+
8293 cache_record ['branches' ] = [
8394 branch ['name' ] for branch in result ['branches' ]
8495 ]
@@ -104,11 +115,14 @@ async def main():
104115 while True :
105116 logger .info ('Checking cache for updates' )
106117 await asyncio .gather (
118+ # projects git data live in these gitea orgs
107119 run (config , logger , redis_client , gitea_client , 'rpms' ),
108120 run (config , logger , redis_client , gitea_client , 'modules' ),
121+ # almalinux modified packages live in autopatch gitea org
122+ run (config , logger , redis_client , gitea_client , 'autopatch' ),
109123 )
110124 logger .info (
111- f 'Cache has been updated, waiting for { wait } sec for next update'
125+ 'Cache has been updated, waiting for %d secs for next update' % wait
112126 )
113127 await asyncio .sleep (wait )
114128
0 commit comments