Skip to content

Commit

Permalink
Merge pull request #32 from Code4GovTech/dev
Browse files Browse the repository at this point in the history
Fix: PR status - Merged before closed.
  • Loading branch information
karntrehan authored Jul 15, 2024
2 parents dbf06a4 + 9c90a2d commit 3dd5819
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ def get_issues_by_owner_id(owner, issue):
"""
try:
print('inside get issues')
SUPABASE_DB = SupabaseInterface().get_instance()
response = SUPABASE_DB.client.table('dmp_issue_updates').select('*').eq('owner', owner).eq('issue_number', issue).execute()
if not response.data:
Expand Down Expand Up @@ -335,4 +336,4 @@ def check_secret_key():
app.register_blueprint(v2, url_prefix='/v2')

if __name__ == '__main__':
app.run(debug=True)
app.run(debug=True)
5 changes: 4 additions & 1 deletion v2_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,15 @@ def get_issues_by_owner_id_v2(owner, issue):
transformed = {"pr_details": []}
if pr_Data.data:
for pr in pr_Data.data:
pr_status = pr.get("status", "")
if pr_status == "closed" and pr.get("merged_at"):
pr_status = "merged"
transformed["pr_details"].append({
"id": pr.get("pr_id", ""),
"name": pr.get("title", ""),
"week": determine_week(pr['created_at']),
"link": pr.get("link", ""),
"status": pr.get("status", ""),
"status": pr_status ,
})

res['pr_details'] = transformed['pr_details']
Expand Down

0 comments on commit 3dd5819

Please sign in to comment.