Amy Roberts commited on
Commit
e6861b3
1 Parent(s): 45b93db

pass the token for updates

Browse files
Files changed (1) hide show
  1. app.py +11 -11
app.py CHANGED
@@ -62,16 +62,16 @@ def run_find_similar_issues(token, n_issues, issue_no, query, issue_types):
62
  return final
63
 
64
 
65
- def update():
66
  # Archive the stored issues
67
  if os.path.exists("issues.json"):
68
  date_time = datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
69
  shutil.copy("issues.json", f"{date_time}_issues.json")
70
 
71
  # Retrieve new issues
72
- get_issues(overwrite=False, update=True, output_filename="issues.json")
73
  # Update any issues that have been updated since the last update
74
- update_issues()
75
  # Update the dictionary of issues
76
  build_issue_dict.build_json_file("issues.json", "issues_dict.json")
77
  # Update the embeddings
@@ -91,14 +91,6 @@ def update():
91
 
92
  with gr.Blocks(title="Github Bot") as demo:
93
  with gr.Tab("Find similar issues"):
94
- with gr.Row():
95
- with gr.Column():
96
- gr.Markdown("Press `Update Button` to update the stored issues. This will take a few minutes.")
97
- update_button = gr.Button(value="Update issues")
98
- update_button.click(update, outputs=[], inputs=[], trigger_mode="once")
99
- with gr.Column():
100
- pass
101
-
102
  with gr.Row():
103
  gr.Markdown("## Query settings")
104
  with gr.Row():
@@ -121,6 +113,14 @@ with gr.Blocks(title="Github Bot") as demo:
121
  issues_html = gr.HTML(label="Issue text", elem_id="issue_html")
122
  submit_button.click(run_find_similar_issues, outputs=[issues_html], inputs=[token, n_issues, issue_no, query, issue_types])
123
 
 
 
 
 
 
 
 
 
124
  with gr.Tab("Find maintainers to ping"):
125
  gr.Markdown("Find maintainers to ping for a given issue or pull request - DO NOT CURRENTLY HAVE FUNCTIONALITY")
126
  with gr.Row():
 
62
  return final
63
 
64
 
65
+ def update(token):
66
  # Archive the stored issues
67
  if os.path.exists("issues.json"):
68
  date_time = datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
69
  shutil.copy("issues.json", f"{date_time}_issues.json")
70
 
71
  # Retrieve new issues
72
+ get_issues(overwrite=False, update=True, output_filename="issues.json", token=token)
73
  # Update any issues that have been updated since the last update
74
+ update_issues(token=token)
75
  # Update the dictionary of issues
76
  build_issue_dict.build_json_file("issues.json", "issues_dict.json")
77
  # Update the embeddings
 
91
 
92
  with gr.Blocks(title="Github Bot") as demo:
93
  with gr.Tab("Find similar issues"):
 
 
 
 
 
 
 
 
94
  with gr.Row():
95
  gr.Markdown("## Query settings")
96
  with gr.Row():
 
113
  issues_html = gr.HTML(label="Issue text", elem_id="issue_html")
114
  submit_button.click(run_find_similar_issues, outputs=[issues_html], inputs=[token, n_issues, issue_no, query, issue_types])
115
 
116
+ with gr.Row():
117
+ with gr.Column():
118
+ gr.Markdown("Press `Update Button` to update the stored issues. This will take a few minutes.")
119
+ update_button = gr.Button(value="Update issues")
120
+ update_button.click(update, outputs=[], inputs=[token], trigger_mode="once")
121
+ with gr.Column():
122
+ pass
123
+
124
  with gr.Tab("Find maintainers to ping"):
125
  gr.Markdown("Find maintainers to ping for a given issue or pull request - DO NOT CURRENTLY HAVE FUNCTIONALITY")
126
  with gr.Row():