-
Notifications
You must be signed in to change notification settings - Fork 24
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
project page update dynamically with github api #187
Conversation
@hexwhiz why are you adding ENV variable like CONTRIHUB_MENTOR etc in this is there a specific need, then tell why ? Can you please do it without changing the ENV |
@meisabhishekpatel This variable is for the mentor of contrihub-24 repo. You told me to get the name of mentor of contrihub-24 from env. If env shouldn't be changed then I would just have to hardcode the mentor in the views.py file. Or I could keep the variables in settings.py and remove them from env. |
@meisabhishekpatel should I make the changes then? |
@hexwhiz no changes I'll properly review the PR then tell you |
@hexwhiz can you update the sample env for the changes you have done |
Okay i will |
@hexwhiz doesn't seem to be working can you check. |
@hexwhiz can you explain how are you update the projects on the page, like suppose I have few projects already in my env and i want to add let say 2 more projects , how will I add that |
Add projects to AVAILABLE_PROJECTS env variable. Then hit the /populate_project endpoint. This will load the project details in database. Then opening the project page will show the projects. |
For new projects just add there name in the env variable |
Done updating the sample env |
@hexwhiz tell me will clicking on populate project endpoint will it update the description or mentor, if it's already present in the db or not, if not then please make it like populate issues end points like it updates all the active issues in the db. |
Oh! you are right. That populate_project view was set to skip the projects those were already present in database. I can just remove that check and it would then update all the projects in database when you hit populate_project. Would it be ok? |
@meisabhishekpatel do you want the projects to be updated when you hit |
i want to update all the pre - existing project such that let say I changed description of my repo in github it should be updated when I hit populate_project button, and add the projects which are not already present in the db
/populate_projects |
Ok I have that ready I will commit after a few minutes |
@meisabhishekpatel done making changes. One more thing, when I was testing the project, I hit the Github API limit. So I had to use API_TOKEN from github. I have updated the sample_env.txt for the same. Now this /populate_project endpoint updates the details of already added projects and remove any project that is in the database but not in the .env file. |
@meisabhishekpatel any update? |
@hexwhiz can you just remove API_TOKEN thing you must have reached api limit due to numerous testing |
Ok i will remove that |
@hexwhiz just make it like populate issues, see how populate issues is implemented. |
@meisabhishekpatel done making changes. Sorry for these many commits, the build test was failing a lot😥 |
@hexwhiz will review it soon |
@meisabhishekpatel would you please review this? ContriHUB is ending😅 |
@hexwhiz even if pending review will be happening even after contrihub ends and you will be awarded points |
@hexwhiz I have some doubts about it so not merging this PR but it is indeed acceptable to I'll give you points and add a hacktoberfest-accepted label so that it gets counted in hacktoberfest |
Ok thanks. I am open for feedback if I did something wrong |
Description
Added more fields (mentor, mentor url, description) in project schema in database. So, whenever admin hit the populate_project endpoint, details of any new project in the env file will get fetched from github using github API and will be populated in the database. The project homepage now updates dynamically based on the projects names present in the environment variables.
Related Issue
Fixes #177
Type of change
Motivation and Context
This change was necessary because on addition of new projects the project page was not updated automatically.
How Has This Been Tested?
I had to remove the admin status check from the populate_project view to hit the populate_project endpoint. But that change has been reversed in this PR. I had 4 projects in env file and then hit the endpoint which populated the data of projects in database. Then refreshing the project page shows the project details present in the database. The moviescreen project have no description on github that's why it shows None.
Screenshots (if appropriate):
Checklist:
Test Configuration: