Skip to content

Commit 86792ee

Browse files
BigCat20196msyyc
andauthored
[Release issue status] fix date bug and serve Python only (Azure#23491)
* add assignee * update function * fix bug * delete old code * fix bug * fix bug * fix pipeline id * fix auto-ask-check bug * update sdk administrators * fix utils * Set up CI with Azure Pipelines [skip ci] * Update release_issue_status.yml for Azure Pipelines * Update release_issue_status.yml for Azure Pipelines * Update release_issue_status.yml for Azure Pipelines * Update main.py * Update main.py * Update main.py Co-authored-by: Yuchao Yan <[email protected]>
1 parent 0707184 commit 86792ee

File tree

1 file changed

+9
-4
lines changed
  • scripts/release_issue_status

1 file changed

+9
-4
lines changed

scripts/release_issue_status/main.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,8 @@ def main():
190190
rest_repo = g.get_repo('Azure/azure-rest-api-specs')
191191
sdk_repo = g.get_repo('Azure/azure-sdk-for-python')
192192
label1 = request_repo.get_label('ManagementPlane')
193-
open_issues = request_repo.get_issues(state='open', labels=[label1])
193+
label2 = request_repo.get_label('Python')
194+
open_issues = request_repo.get_issues(state='open', labels=[label1, label2])
194195
issue_status = []
195196
issue_status_python = []
196197
duplicated_issue = dict()
@@ -205,9 +206,13 @@ def main():
205206
issue.link = f'https://github.com/Azure/sdk-release-request/issues/{item.number}'
206207
issue.author = item.user.login
207208
issue.package = _extract(item.body.split('\n'), 'azure-.*')
208-
issue.target_date = [x.split(':')[-1].strip() for x in item.body.split('\n') if 'Target release date' in x][0]
209-
issue.days_from_target = int(
210-
(time.mktime(time.strptime(issue.target_date, '%Y-%m-%d')) - time.time()) / 3600 / 24)
209+
try:
210+
issue.target_date = [x.split(':')[-1].strip() for x in item.body.split('\n') if 'Target release date' in x][0]
211+
issue.days_from_target = int(
212+
(time.mktime(time.strptime(issue.target_date, '%Y-%m-%d')) - time.time()) / 3600 / 24)
213+
except Exception:
214+
issue.target_date = 'fail to get.'
215+
issue.days_from_target = 1000 # make a ridiculous data to remind failure when error happens
211216
issue.create_date = item.created_at.timestamp()
212217
issue.delay_from_create_date = int((time.time() - item.created_at.timestamp()) / 3600 / 24)
213218
issue.latest_update = item.updated_at.timestamp()

0 commit comments

Comments
 (0)