File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 77
88import product_versions
99
10+ # USER_AGENT constant for marketplace API calls
11+ USER_AGENT = "Mozilla_dc_core_eng"
12+
1013"""
1114This script is used to update the product versions in the helm charts descriptors (Chart.yaml).
1215It fetches the latest available version (LTS for products with LTS) from marketplace and updates the required
@@ -67,7 +70,8 @@ def product_versions_marketplace(product_key):
6770 page = 1
6871 while True :
6972 logging .debug (f'Retrieving Marketplace product versions for { product_key } : page { page } ' )
70- r = requests .get (mac_url + request_url , params = params )
73+ headers = {'User-Agent' : USER_AGENT }
74+ r = requests .get (mac_url + request_url , params = params , headers = headers )
7175 version_data = r .json ()
7276 for version in version_data ['_embedded' ]['versions' ]:
7377 if all (d .isdigit () for d in version ['name' ].split ('.' )):
@@ -130,7 +134,8 @@ def update_mesh_tag():
130134 logging .info ("Latest LTS version: %s" , version )
131135 else :
132136 logging .info ("Non-LTS product" )
133- r = requests .get (f'https://marketplace.atlassian.com/rest/2/products/key/{ product } /versions/latest' )
137+ headers = {'User-Agent' : USER_AGENT }
138+ r = requests .get (f'https://marketplace.atlassian.com/rest/2/products/key/{ product } /versions/latest' , headers = headers )
134139 version = r .json ()['name' ]
135140
136141 new_version_tag = f"{ version } { tag_suffix } "
You can’t perform that action at this time.
0 commit comments