Skip to content

Fix: MaintainerActive Signal Is Never Set — Repos Always Lose 20 Points #39

Description

@Vedant1703

The scoring engine (engine.go) awards 20 points when the MaintainerActive signal is true. However, looking at signals.go, the MaintainerActive field is never assigned — it stays at its zero value (false) for every single repository.

This means every repository recommendation silently loses 20 points regardless of actual maintainer activity, making scores consistently lower than intended.


📍 File to Change

backend/core_service/internal/orchestration/signals.go


🔍 Current Buggy Code (lines ~10–40 in signals.go)

// MaintainerActive is NEVER set — always stays false
func (s *Service) BuildRepoSignals(...) scoring.RepoSignals {
    signals := scoring.RepoSignals{}
    
    repoData, err := s.githubClient.FetchRepo(ctx, repo)
    // ... MaintainerActive is never touched here
    
    return signals
}

✅ What To Do

After fetching repoData, add a heuristic check: if the repo was pushed to within the last 7 days, consider the maintainer active.

// Add this block after the RecentActivity check in signals.go:

// Check if maintainer is active (pushed within last 7 days)
pushedTime, err := time.Parse(time.RFC3339, repoData.LastPushedAt)
if err == nil && time.Since(pushedTime).Hours() < 24*7 {
    signals.MaintainerActive = true
}

Add a brief comment explaining the heuristic so future contributors understand the logic.


🏁 Acceptance Criteria

  • signals.MaintainerActive is now set to true when the repo was pushed to within the last 7 days
  • The existing signals.RecentActivity check (30-day threshold) is untouched
  • The code compiles: go build ./... from backend/core_service must pass
  • A short comment documents the heuristic (e.g., // Active maintainer: pushed within last 7 days)

💡 Technical Hints

  • Edit backend/core_service/internal/orchestration/signals.go — specifically the BuildRepoSignals function
  • repoData.LastPushedAt is a string formatted as RFC3339 — parse it using time.Parse(time.RFC3339, ...)
  • The same parsing pattern is already used a few lines above for RecentActivity — follow the same style
  • You do not need to make any new API calls; repoData is already fetched

🚀 Getting Started

  1. Fork the repository
  2. Create a branch: git checkout -b fix/issue-3-maintainer-active-signal
  3. Edit backend/core_service/internal/orchestration/signals.go
  4. Verify it compiles: cd backend/core_service && go build ./...
  5. Open a Pull Request!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions