Skip to content

Enhance User Profile Overview with Commits and Activity Reporting

Praveena Veeranki requested to merge prav into dev

What does this MR do?

This merge request enhances the User Profile Overview in the GitLab Compliance Checker by adding a working commits tracking feature and a detailed activity report view.

It enables the application to:

  • Reliably fetch user commits from GitLab (project-wise)
  • Display commits with date, time, and working-hour classification
  • Lay the foundation for a detailed activity report dashboard covering commits, issues, merge requests, and projects

This improves visibility into actual user contributions, beyond just summary counts.


Motivation / Use Case

Previously, the dashboard only showed aggregate counts (projects, issues, MRs), and commits were either missing or unreliable due to GitLab API constraints.

As a mentor/admin, it is important to:

  • Verify when and how actively a user is contributing
  • Track work during defined working hours
  • Review detailed contribution data when needed

This feature addresses that gap by providing accurate commit-level insights and a pathway to detailed reporting.


Implementation Notes

  • Commits are fetched project-by-project using the GitLab API (/projects/{project_id}/repository/commits), which is the only reliable approach on the target GitLab instance.

  • Commit data is processed to extract:

    • Commit message
    • Date
    • Time
  • Commits are classified into working-hour slots:

    • Morning: 09:00–12:00
    • Afternoon: 14:00–17:00
  • Only commits within these slots are displayed in the UI.

  • The implementation is read-only and does not introduce any breaking changes.

  • Existing dashboard features remain fully backward compatible.


How to Test

  1. Pull this branch:

    git checkout prav
  2. Create and activate virtual environment (if not already):

    python3 -m venv venv
    source venv/bin/activate
  3. Install dependencies:

    pip install -r requirements.txt
  4. Set GitLab credentials in .env:

    GITLAB_URL=https://code.swecha.org
    GITLAB_TOKEN=your_access_token
  5. Run the application:

    streamlit run app.py
  6. Navigate to User Profile Overview

  7. Enter a valid GitLab username and fetch user info

  8. Verify:

    • Commits are displayed under Commits Activity
    • Each commit shows date, time, and time slot (Morning/Afternoon)

Checklist

  • Feature is documented (README updated where applicable)
  • Code is clean, readable, and follows project structure
  • No breaking changes introduced
  • Feature tested locally
  • Commits feature works as intended with GitLab API constraints

Related Issues or Discussions

  • Enhancement to User Profile Overview for activity visibility
  • Internal improvement for reliable commit tracking on GitLab

Screenshot_from_2026-02-08_15-04-54Screenshot_from_2026-02-08_15-04-49

Merge request reports

Loading