Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DB refresh button: Adding functionality #376

Closed
Tracked by #260
joeflack4 opened this issue Jun 6, 2023 · 0 comments · Fixed by #375
Closed
Tracked by #260

DB refresh button: Adding functionality #376

joeflack4 opened this issue Jun 6, 2023 · 0 comments · Fixed by #375
Assignees
Labels
new feature New feature or request

Comments

@joeflack4
Copy link
Member

joeflack4 commented Jun 6, 2023

Overview

Adding functionality to the "DB Refresh" button of the "Help / About" page. Should trigger this GitHub Action.

Katherine recently added a button in the "Help / About" page, as well as a placeholder route called db_refresh_route() in app.py.

@hugwuoke What I'd like you to do is to see if you can finish off the code in that route that will initiate the action.
I opened up a pull request, and in the db_refresh_route(), I added a comment with a working cURL command that ChatGPT created for me.

You can continue working off my branch by doing:

# gets latest updates from GitHub; might not be necessary
git fetch
# checks out the branch
git checkout origin/db-refresh-button-functionality -b db-refresh-button-functionality

For Python to be able to get the token, this is one of those situations where we don't want to hard-code it. You'll want to add the following to your .env file: GH_LIMITED_PERSONAL_ACCESS_TOKEN=<TOKEN>, where <TOKEN> is a token that I'll send you on Teams. Next, go to backend/db/config.py and add an entry to the CONFIG and CONFIG_LOCAL dictionaries so that it also grabs GH_LIMITED_PERSONAL_ACCESS_TOKEN. Then in app.py, import CONFIG and use it in your code to get the token.

I'm not sure what the nature of the code will look like, but it will likely use the requests library and probably not be too many lines of code. The prompt I used in ChatGPT to create the cURL might give you some idea of what you could try asking it or googling. However you wanna go about solving it!

Additional info

One way to check that this works is, when you click the "DB Refresh" button and it calls your Python code, you should actually see a new job spinning up on this page. It should be no problem to just let it run, but if you want to cancel the run, you can click the ellipses on the right, and there should be a menu w/ a "cancel workflow run" option.

Related issues

@joeflack4 joeflack4 added the new feature New feature or request label Jun 6, 2023
@joeflack4 joeflack4 added this to TermHub Jun 6, 2023
@joeflack4 joeflack4 moved this from Todo to Soon in TermHub Jun 6, 2023
@github-project-automation github-project-automation bot moved this to Todo in TermHub Jun 6, 2023
@joeflack4 joeflack4 linked a pull request Jun 6, 2023 that will close this issue
@github-project-automation github-project-automation bot moved this from Soon to Done in TermHub Jun 8, 2023
@joeflack4 joeflack4 changed the title DB Refresh Button: Adding functionality DB refresh button: Adding functionality Jun 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New feature or request
Projects
Status: 5. Done
Development

Successfully merging a pull request may close this issue.

2 participants