Skip to content

Fix import button bug and enhance security#665

Open
AnishkumarProjects05 wants to merge 1 commit into
komalharshita:mainfrom
AnishkumarProjects05:features/devpath
Open

Fix import button bug and enhance security#665
AnishkumarProjects05 wants to merge 1 commit into
komalharshita:mainfrom
AnishkumarProjects05:features/devpath

Conversation

@AnishkumarProjects05
Copy link
Copy Markdown

Summary

This PR Fixes the Import from Github Button which was non Functionable.Clicking the Button Import From GitHub will Navigate to an Dialog Box where the user can fetch the Respective Github Username and Fetch the Languages used from the Username's Repo and Autofill in this Text Box. Follows the Github Authentication Security Path by using OAuth Flow instead of Manually Checking Flow

Related Issue

The problem is that Flask was setting up your blueprint routes before the secret_key for the application was actually set, so the session signing system had a blank context. Also, your server was running from a subfolder, so load_dotenv() was looking in the wrong place for your .env config file, and failing to find it.

Closes #659

Type of Change

  • Bug fix — resolves a broken behaviour
  • Feature — adds new functionality
  • Data — adds new projects to data/projects.json
  • Documentation — updates docs, README, or code comments only
  • Style — CSS or visual changes only, no logic change
  • Refactor — restructures code without changing behaviour
  • Test — adds or updates tests

What Was Changed

OAuth GitHub Login Route → New feature to redirect users to authenticate with GitHub before accessing the repositories. GitHub Callback Route → New feature to receive an authorisation code after successful login to GitHub.
New feature to securely exchange authorisation code from GitHub for an access token. Access Token Retrieval API

Session Storage → New feature to temporarily store the access token for GitHub account.
User Repositories API” → New feature to get all the repositories the user has access to on GitHub.
Repository Import API → Ability to import repositories from GitHub to application.
redirect() Feature → New feature to automatically redirect users from one page to another.
Use of requests Library → Add new feature to interact with GitHub RESTful APIs using requests library of python.

File Change made
utils/recommender.py Added clear_cache() function
tests/test_basic.py Added test for cache invalidation

How to Test This PR

  1. Clone this branch: git checkout features/devpath
  2. Install dependencies: pip install -r requirements.txt
  3. Run the app: python app.py
  4. Open http://127.0.0.1:5000 and...
  5. Run the tests: python tests/test_basic.py

Expected test output:

27 passed, 0 failed out of 27 tests

Test Results

Test Check :

 `PASS`  test_projects_json_loads
  `PASS`  test_each_project_has_required_fields
  `PASS`  test_find_project_by_id_found
  `PASS`  test_find_project_by_id_missing
  `PASS`  test_parse_skills_basic
  `PASS`  test_parse_skills_empty_string
  `PASS`  test_parse_skills_single_entry
  `PASS`  test_score_single_project_full_match
  `PASS`  test_score_single_project_no_match
  `PASS`  test_score_single_project_alias_matching
  `PASS`  test_get_recommendations_returns_results
  `PASS`  test_get_recommendations_max_three
  `PASS`  test_get_recommendations_no_match_returns_empty
  `PASS`  test_get_recommendations_result_format
  `PASS`  test_validate_all_valid
  `PASS`  test_validate_missing_skills
  `PASS`  test_validate_missing_level
  `PASS`  test_validate_missing_interest
  `PASS`  test_validate_missing_time
  `PASS`  test_validate_all_missing
  `PASS`  test_home_route
  `PASS`  test_security_headers_present
  `PASS`  test_recommend_api_valid
  `PASS`  test_recommend_api_interest_not_available
  `PASS`  test_recommend_api_missing_field
  `PASS`  test_recommend_api_empty_body
  `PASS`  test_project_detail_found
  `PASS`  test_project_detail_not_found
  `PASS`  test_internal_server_error_page
  `PASS`  test_view_code_found
  `PASS`  test_download_code_found
  `PASS`  test_health_check
  `PASS`  test_scoring_weights_has_all_keys
  `PASS`  test_sitemap_returns_200
  `PASS`  test_sitemap_content_type
  `PASS`  test_sitemap_contains_homepage
  `PASS`  test_sitemap_contains_all_project_ids
  `PASS`  test_robots_txt_returns_200
  `PASS`  test_robots_txt_references_sitemap
  `PASS`  test_project_links_have_noopener
40 passed, 0 failed out of 40 tests
paste output here

Screenshots

Before After
image image

Self-Review Checklist

  • I have read CONTRIBUTING.md and followed all guidelines
  • My branch name follows the convention: feat/, fix/, docs/, data/, style/, test/
  • I have run python tests/test_basic.py and all 27 tests pass
  • I have run flake8 . locally and there are no errors
  • I have not introduced any print() or console.log() debug statements
  • Every new function I wrote has a docstring
  • I have not modified files outside the scope of the linked issue
  • If I changed the UI, I tested it at 375px (mobile) and 1280px (desktop)
  • If I added a project to the dataset, it has all required JSON fields

Notes for Reviewer

None

@vercel
Copy link
Copy Markdown

vercel Bot commented May 28, 2026

@AnishkumarProjects05 is attempting to deploy a commit to the komalsony234-1530's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for submitting your first pull request to DevPath.

Before review:

  • Complete the PR template fully
  • Ensure all tests pass
  • Link your PR to an issue
  • Keep changes scoped to the issue

A maintainer will review your contribution soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant