feat:Adding Projects feature to the Gitlab Compilance Checker
What does this MR do?
This merge request enhances the User Profile Overview feature in the GitLab Compliance Checker by displaying user project information in a clear and permission-safe way.
It adds: A list of projects associated with a GitLab user
Clear distinction between Personal and Contributed projects
Accurate project counts derived from accessible repositories
Validation and status display for the GitLab Profile README
Motivation / Use Case
GitLab restricts access to several user-level APIs (such as project count, groups, and issues), which previously caused missing data or errors in the UI. This change ensures:
The application works reliably under restricted permissions
Users can clearly see what projects they own versus contribute to
Profile completeness (README presence) is validated and guided
This makes the compliance checker more practical and user-friendly for real GitLab users.
Implementation Notes
Project data is fetched using the GitLab projects API, limited to repositories accessible by the token. Personal vs Contributed projects are identified using the project namespace comparison with the username. Restricted count APIs were replaced with safe, derived metrics (e.g., len(user_projects)). Clear UI messaging was added to explain permission limitations. Profile README is checked using the / project convention. No breaking changes were introduced.
How to Test
Pull this branch locally.
Create a .env file in the project root with:
GITLAB_URL=https://code.swecha.org GITLAB_TOKEN=<your_gitlab_token>
Install dependencies:
pip install -r requirements.txt pip install python-dotenv
Run the application:
streamlit run app.py
Navigate to User Profile Overview.
Enter a valid GitLab username and click Fetch User Info & Check README.
Verify:
Project list is displayed
Personal and contributed projects are correctly tagged
Project counts are accurate
Profile README status is shown
Checklist
Feature is documented via UI labels and messages
- Code is clean, readable, and follows existing structure
- No breaking changes introduced
- Manual testing completed locally
- Feature works correctly under restricted GitLab permissions
Related Issues or Discussions
Improves User Profile Overview reliability under GitLab permission constraints