ALBS-931 Added integration with AlmaLinux Build System (errata feed) #3

Merged
kzhukov merged 4 commits from ALBS-931 into main 2023-01-20 11:49:11 +00:00
Owner
No description provided.
kzhukov added 1 commit 2023-01-19 12:24:44 +00:00
soksanichenko requested changes 2023-01-19 12:41:50 +00:00
@ -0,0 +12,4 @@
"""
def __init__(self, url: str, token: str, timeout: int):
if url.endswith('/'):
First-time contributor

It's not necessary if you fix comments below.

It's not necessary if you fix comments below.
kzhukov marked this conversation as resolved
@ -0,0 +27,4 @@
endpoint = '/api/v1/platforms/'
headers = {'accept': 'application/json',
'Authorization': f'Bearer {self.token}'}
response = requests.get(url=self.url+endpoint,
First-time contributor

self.url+endpoint don't do the same, please :)

from urllib.parse import urljoin
urljoin(url + '/', some_uri)

That code join part of an URL right in all cases

`self.url+endpoint` don't do the same, please :) ``` from urllib.parse import urljoin urljoin(url + '/', some_uri) ``` That code join part of an URL right in all cases
kzhukov marked this conversation as resolved
@ -0,0 +31,4 @@
headers=headers,
timeout=self.timeout)
response.raise_for_status()
res = {}
First-time contributor

That looks more pretty I guess

res = {platform['name']: platform['id'] for platform in response.json()}
That looks more pretty I guess ``` res = {platform['name']: platform['id'] for platform in response.json()} ```
@ -0,0 +60,4 @@
params = {'id': errata_id, 'platformId': platform_id}
headers = {'accept': 'application/json',
'Authorization': f'Bearer {self.token}'}
response = requests.get(url=self.url+endpoint,
First-time contributor

same as above

same as above
kzhukov marked this conversation as resolved
@ -0,0 +68,4 @@
# errata_id was not found
if response_json['total_records'] == 0:
return None
First-time contributor

jfyi, return None is redundunt form of return

jfyi, `return None` is redundunt form of `return`
Korulag approved these changes 2023-01-19 12:52:05 +00:00
kzhukov added 1 commit 2023-01-19 21:13:16 +00:00
kzhukov added 1 commit 2023-01-19 21:15:57 +00:00
soksanichenko approved these changes 2023-01-20 11:14:37 +00:00
kzhukov added 1 commit 2023-01-20 11:41:54 +00:00
kzhukov merged commit e5f23da079 into main 2023-01-20 11:49:11 +00:00
kzhukov deleted branch ALBS-931 2023-01-20 11:49:21 +00:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: kzhukov/albs-oval-errata-diff#3
No description provided.