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

Fetch Project Details Dynamically from GitHub API #177

Open
4 tasks
meisabhishekpatel opened this issue Oct 17, 2024 · 11 comments · May be fixed by #187
Open
4 tasks

Fetch Project Details Dynamically from GitHub API #177

meisabhishekpatel opened this issue Oct 17, 2024 · 11 comments · May be fixed by #187
Labels

Comments

@meisabhishekpatel
Copy link
Contributor

Issue Title: Fetch Project Details Dynamically from GitHub API

Description:

Currently, the project information displayed on /projects is hardcoded in the HTML template. We want to dynamically fetch project information from the GitHub API to ensure the page stays updated with the latest information.

Requirements:

  1. Environment Variables:

    • The project names will be provided via environment variables.
    • Example: PROJECT_NAMES="project1,project2,project3"
  2. Fetch Public Repositories:

    • Use the GitHub API to fetch details of repositories from the ContriHUB organization.
    • Match the project names (from environment variables) with the names of the public repositories in ContriHUB.
  3. Pull Information:

    • For each matching repository, retrieve the following details:
      1. Project Name.
      2. Maintainer: The username of the repo owner or collaborator.
      3. About: The description (about) section of the repository.
  4. Dynamic Rendering:

    • Update the Django view to fetch the project data dynamically and pass it to the template.
    • Modify the HTML template to display this dynamically fetched data.

Tasks:

  • Read project names from environment variables.
  • Use GitHub API to fetch details of matching repositories.
  • Extract relevant information: name, maintainer, and about section.
  • Update the /projects page to display fetched data dynamically.
@meisabhishekpatel meisabhishekpatel added medium level meisabhishekpatel mentor hacktoberfest hacktoberfest bonus bonus and removed bonus bonus labels Oct 17, 2024
@samimshoaib01
Copy link

Can i get help on this :
image

@meisabhishekpatel
Copy link
Contributor Author

@samimshoaib01 try to access http:// not https://
Also if you are using google chrome try using Firefox, also turn off upgrade secure connection option from settings

@samimshoaib01
Copy link

samimshoaib01 commented Oct 19, 2024

@meisabhishekpatel
Do, I need to match the design 0f previous one or it will be new issue:
image

@samimshoaib01
Copy link

@meisabhishekpatel
kindly respond sir

@meisabhishekpatel
Copy link
Contributor Author

@samimshoaib01 ofcourse you need to manage the old design, you need to change in the existing code, not create a new page from scratch .

samimshoaib01 added a commit to samimshoaib01/ContriHUB-24 that referenced this issue Oct 19, 2024
@hexwhiz
Copy link
Contributor

hexwhiz commented Oct 21, 2024

@meisabhishekpatel whenever I open the local server using http://127.0.0.1:8000 it shows this
image

I tried using different browsers and disable secure connection option. But still the http changes to https in the browser. Can you help me with this?

@meisabhishekpatel
Copy link
Contributor Author

@hexwhiz try incognito or firefox with secure connection off

@hexwhiz
Copy link
Contributor

hexwhiz commented Oct 21, 2024

@meisabhishekpatel there are some things I want to ask.

  • From the API fetch request, I get the details of all the repos. But there is no key in the fetched json that names the mentor of the repo. To get the mentor of a repo, I am using the GitHub username of the account from where the repos is forked to @ContriHUB. This is done by sending api requests for each AVAILABLE_PROJECT to fetch the username of the parent account. So, should I just display the usernames directly or fetch the name of the mentor with separate API request? It might exceed GitHub API limit.
  • Also, there are projects that don't have a parent owner. Take this one for example. This repo is not forked from your account, so I don't get your username in my return object. How should I handle that

@meisabhishekpatel
Copy link
Contributor Author

@hexwhiz

  1. username is just fine no need to fetch the exact name.
  2. there will be only one such project only in contrihub which is Contrihub-24 for that you can get name of maintainer from env only since the maintainer which change each year.

Also I would like to clarify that do always make API call each time I hit /project instead store the project information in database and new project should be added when I hit populate issues end points then only.

@hexwhiz hexwhiz linked a pull request Oct 22, 2024 that will close this issue
14 tasks
@hexwhiz
Copy link
Contributor

hexwhiz commented Oct 22, 2024

@meisabhishekpatel PR submitted. And it somehow shows "Review required" with red color. Should I be worried about that?

@meisabhishekpatel
Copy link
Contributor Author

meisabhishekpatel commented Oct 22, 2024

@hexwhiz We've added protection to the repository to ensure that no pull request can be merged without proper review and approval.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants