Skip to content

Score completed project contributors#321

Merged
redreceipt merged 4 commits into
mainfrom
codex/update-points-for-project-contributions
May 8, 2026
Merged

Score completed project contributors#321
redreceipt merged 4 commits into
mainfrom
codex/update-points-for-project-contributions

Conversation

@redreceipt
Copy link
Copy Markdown
Member

Motivation

  • Award the 15-point weekly completed-project bonus to people who actually contributed completed issues (were assigned to any completed issue in the project) rather than to everyone listed as a project member.

Description

  • Fetch completed project issues in the Linear projects query and normalize assignee display names into completedIssueAssignees in linear/projects.py via _normalize_project_participants.
  • Change the cycle project scoring in leaderboard.py (_calculate_cycle_project_points) to award the 15pt/week bonus to completedIssueAssignees (contributors) instead of the members list.
  • Update user-facing labels and Slack copy from “member” to “contributor” in app.py and jobs.py, and clarify the constant comment in constants.py.
  • Add/modify tests in tests/test_leaderboard.py and tests/test_linear_projects.py to cover contributor-based scoring and project normalization of completed issue assignees.

Testing

  • Ran formatter with python -m ruff format ... and python -m ruff check . which completed successfully.
  • Ran unit tests with python -m unittest discover -s tests -p 'test_*.py' (67 tests) which passed (OK).
  • Ran targeted tests python -m unittest tests.test_leaderboard tests.test_linear_projects which passed.
  • Ran static checks with python -m mypy . which completed without blocking errors.

Codex Task

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a912d3023a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread linear/projects.py Outdated
displayName
}
}
issues(first: 50, filter: { state: { type: { in: ["completed"] } } }) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Paginate completed issues before scoring contributors

For projects with more than 50 completed issues, this nested issues(first: 50, ...) connection only returns the first page, so any assignee who only appears on later pages is omitted from completedIssueAssignees and receives no 15pts/week despite contributing a completed issue. Since contributor scoring now depends entirely on this field, the issue connection needs pagination or a separate project-issue query that collects all completed assignees.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@codex address this feedback

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Summary

  • Added a dedicated paginated Linear issues query for completed project issue assignees, using pageInfo.hasNextPage / endCursor to collect contributors beyond the first 50 completed issues.
  • Updated project normalization to populate completedIssueAssignees from the paginated per-project issue query when a project id is available, while preserving a fallback for preloaded issue nodes.
  • Removed the nested first-page-only completed issues connection from the project list query so contributor scoring no longer depends on an unpaginated nested field.
  • Expanded the Linear projects unit test to cover project pagination plus multi-page completed issue assignee collection, including a contributor who appears only on the later issue page.
  • Committed the changes with commit ed41012 and created the follow-up PR titled “Paginate completed project issue assignees.”

Testing

  • ⚠️ source venv/bin/activate && python -m unittest tests.test_linear_projects — environment limitation: this checkout does not contain venv/bin/activate.
  • python -m unittest tests.test_linear_projects
  • ruff format linear/projects.py tests/test_linear_projects.py && ruff check linear/projects.py tests/test_linear_projects.py && python -m unittest discover -s tests -p 'test_*.py'
  • ruff format linear/projects.py && mypy .
  • ruff check .

View task →

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6d1a829914

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread linear/projects.py Outdated
Comment on lines +64 to +65
if project_id:
project["completedIssueAssignees"] = _get_completed_project_issue_assignees(project_id)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid fetching assignees for every project consumer

When get_projects() is used by /partials/team/content, /team/<slug>'s project section, post_project_updates(), or get_support_slugs(), those callers only read project metadata, leads, and members, but this line now performs a separate paginated Linear issues query for every project before returning. In workspaces with dozens of active/old projects, those pages/jobs turn from one projects request into N+1 GraphQL requests and can time out or fail on an unrelated project's issues fetch; consider making completed assignees opt-in for leaderboard scoring or fetching them only for completed projects.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@codex address this feedback

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Summary

  • Made completed issue assignee collection opt-in on get_projects(), so metadata-only consumers avoid the extra per-project Linear issues queries by default.
  • Restricted opt-in assignee fetching to completed projects; non-completed projects get an empty completedIssueAssignees list only when the opt-in is requested.
  • Updated leaderboard project scoring to explicitly request completed issue assignees, preserving contributor-based scoring without affecting other project consumers.
  • Added/updated tests to verify default project fetching only performs project pagination calls, while the opt-in path paginates completed issue assignees only for completed projects.
  • Updated leaderboard tests to verify scoring requests the opt-in assignee data.
  • Committed the changes with commit 49f39f1 and created the follow-up PR titled “Make completed project assignee fetch opt-in.”

Testing

  • python -m unittest tests.test_leaderboard tests.test_linear_projects
  • ruff check .
  • mypy .
  • python -m unittest discover -s tests -p 'test_*.py'

View task →

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 00ddbb446f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread linear/projects.py Outdated
Comment on lines +72 to +74
if project_id and _is_completed_project(project):
project["completedIssueAssignees"] = _get_completed_project_issue_assignees(
project_id
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Filter stale projects before fetching issue assignees

When the leaderboard asks for include_completed_issue_assignees=True, this branch fetches completed issue assignees for every completed project returned by Linear before _calculate_cycle_project_points later discards projects whose target window is outside the requested days range. For a weekly leaderboard in a workspace with many old completed projects, the route/job still paginates all historical project issues even though none of those projects can score, which can make the leaderboard slow or fail on unrelated old projects; consider applying the scoring date/status filters before issuing these per-project issue queries.

Useful? React with 👍 / 👎.

Previously get_projects(include_completed_issue_assignees=True) made an
extra paginated Linear issues query for every completed project, even
ones whose target window fell entirely outside the leaderboard's days
range. Move the assignee fetch into leaderboard.py so it only runs for
projects that will actually score, eliminating the wasted N+1 on stale
projects. Drop the now-unused parameter and the dead preloaded-issues
fallback in linear/projects.py.
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 483a9e41e4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread leaderboard.py
contributors = (
{
contributor
for contributor in get_completed_project_issue_assignees(project_id)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Skip assignee pagination for lead-only scoring

When calculate_cycle_project_lead_points() is called, this shared helper still paginates completed issue assignees even though the returned lead score does not use them. I checked app.py:_build_leaderboard_entries and jobs.py:post_leaderboard; both call the lead wrapper and then the member wrapper, so every in-window completed project now performs the Linear issues pagination twice, and the lead-only call can fail or time out because of an unrelated assignee fetch. Consider only fetching contributors for member scoring or returning both maps from one public call and reusing the result.

Useful? React with 👍 / 👎.

@redreceipt redreceipt merged commit d5e67fe into main May 8, 2026
8 checks passed
@redreceipt redreceipt deleted the codex/update-points-for-project-contributions branch May 8, 2026 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant