You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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()
inapp.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:
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 tobackend/db/config.py
and add an entry to theCONFIG
andCONFIG_LOCAL
dictionaries so that it also grabsGH_LIMITED_PERSONAL_ACCESS_TOKEN
. Then inapp.py
, importCONFIG
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
The text was updated successfully, but these errors were encountered: