Skip to content

Improving time logs

Bikkumalla Sai Krishna requested to merge improving_time_logs into dev

# Merge Request: Project Rebranding and Accuracy Enhancements for Activity Tracking

## Overview

This MR implements a major project rebranding from `GitLab Compliance Checker` to `Internship Activity Tracker`, alongside significant improvements to time-spent data accuracy and the introduction of a robust hierarchical filtering system (Batch -> Team -> Member) across all UI modules.

## What does this MR do and why?

1. **Project Rebranding**: Standardizes the project name and package structure to reflect its focus as an "Internship Activity Tracker."

2. **Time Tracking Accuracy**: Resolves discrepancies in time-spent calculations by improving the precision of timelog fetching and providing direct traceability via GitLab links.

3. **Enhanced Filtering**: Replaces flat selectors with a hierarchical Batch-Team-Member selection system to support larger scales of interns and more granular data views.

4. **Stability & Performance**: Fixes critical bugs (e.g., `corpus_username` KeyError) and optimizes the data aggregation pipeline.

## Changes Made

### 🏗️ Core & Infrastructure

- **[RENAME]** Refactored `src/gitlab_compliance_checker` to `src/internship_activity_tracker`.

- **[MODIFY]** `infrastructure/gitlab/timelogs.py`: Enhanced timelog fetching logic to ensure high-precision data retrieval and metadata association (IDs, URLs).

- **[MODIFY]** `infrastructure/gitlab/batch.py`: Updated batch processing to align with the new project structure and metadata requirements.

### 💻 UI & Experience

- **[NEW]** Implemented `_render_hierarchical_selector` in `ui/leaderboard.py`, `ui/weekly_performance.py`, and `ui/batch.py`.

- **[MODIFY]** Added clickable GitLab URLs for all MRs and Issues in the detailed breakdown views.

- **[MODIFY]** Improved session state management for persistent filters across navigation.

### 🧪 Testing & Quality

- **[MODIFY]** Updated all test modules (`tests/`) to use the new `internship_activity_tracker` package path.

- **[NEW]** Added unit tests for hierarchical selection logic in `test_weekly_performance_ui_extended.py`.

- **[FIX]** Resolved `KeyError` related to missing `corpus_username` during data aggregation.

## Type of Change

- [x] 🐛 Bug fix (non-breaking change that fixes an issue)

- [x] New feature (non-breaking change that adds functionality)

- [x] 💥 Breaking change (package rename requires updated import paths)

- [x] ️ Refactor (major rebranding and directory restructuring)

- [x] Performance improvement (more accurate data fetching)

## Related Issues / References

- Addresses time-spent discrepancy reported in previous performance tracking audits.

- Implements feedback for better navigation between the tracker and GitLab.

## Screenshots or Screen Recordings

image.png

image.png

image.png

## How to Validate Locally

1. **Environment Setup**:

```bash

uv sync

  1. Run the App:

    bash

    streamlit run src/internship_activity_tracker/main.py

  2. Verify Selectors: Navigate to "Weekly Performance" or "Leaderboard" and verify the "Batch -> Team -> Member" cascading filter logic.

  3. Verify Links: Open a "Per-Item Breakdown" and click on any MR/Issue link to ensure it redirects correctly to GitLab.

Testing Done

  •  Unit tests updated and passing
    •  Package import integrity verified
    •  Pre-commit hooks passed (Ruff, Mypy, etc.)

Test Cases Covered:

Scenario Expected Result Status
Hierarchical Selection Selecting a Batch filters Teams; selecting a Team filters Members
Time Accuracy Sum of detailed timelogs matches total time spent in summary cards
Rebranding Check All import gitlab_compliance_checker replaced with internship_activity_tracker

Test Commands Run:

bash

# Run all tests

pytest

# Verify linting and formatting

pre-commit run --all-files

Edited by Bikkumalla Sai Krishna

Merge request reports

Loading