Skip to content

[WEB-6060] fix: module percentage calculation#8595

Merged
dheeru0198 merged 1 commit intopreviewfrom
chore-module-percentage-calculation
Jan 29, 2026
Merged

[WEB-6060] fix: module percentage calculation#8595
dheeru0198 merged 1 commit intopreviewfrom
chore-module-percentage-calculation

Conversation

@NarayanBavisetti
Copy link
Collaborator

@NarayanBavisetti NarayanBavisetti commented Jan 29, 2026

Description

this pull request fixes the calculation of completed issues versus total issues for a specific module.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Summary by CodeRabbit

  • Refactor
    • Optimized issue count calculations in modules for improved accuracy and performance when displaying completed, cancelled, started, unstarted, and backlog issue statuses.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 29, 2026

📝 Walkthrough

Walkthrough

Modified Django ORM aggregation logic in the module view layer by changing the grouping target for issue count annotations from the nested state group path to the direct issue_module relation. This affects how five issue count fields (completed, cancelled, started, unstarted, and backlog) are aggregated per module.

Changes

Cohort / File(s) Summary
Module Issue Count Aggregation
apps/api/plane/app/views/workspace/module.py
Changed grouping field in Count annotations for completed_issues, cancelled_issues, started_issues, unstarted_issues, and backlog_issues from issue_module__issue__state__group to issue_module. Filters and distinct logic remain unchanged.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Five counts now grouped with cleaner grace,
From nested paths to a simpler place—
Issues bundled where they belong,
The module view now sings its song! 📦✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly indicates the specific bug fix relating to module percentage calculation, which aligns with the main change in the changeset.
Description check ✅ Passed The description includes the required Description section explaining the fix and marks Bug fix as the Type of Change, but is missing Screenshots/Media and Test Scenarios sections.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@NarayanBavisetti NarayanBavisetti linked an issue Jan 29, 2026 that may be closed by this pull request
1 task
@makeplane
Copy link

makeplane bot commented Jan 29, 2026

Linked to Plane Work Item(s)

This comment was auto-generated by Plane

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR corrects workspace-level module metrics so that the counts of completed and other categorized issues correctly reflect the number of issues, rather than the number of distinct state groups.

Changes:

  • Updated WorkspaceModulesEndpoint annotations for completed_issues, cancelled_issues, started_issues, unstarted_issues, and backlog_issues to count "issue_module" (with filters) instead of "issue_module__issue__state__group", ensuring the counts match the actual number of issues.
  • Kept filters and distinct=True consistent with the existing total_issues annotation, aligning percentage calculations for module progress.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dheeru0198 dheeru0198 merged commit b8d3b3c into preview Jan 29, 2026
22 of 23 checks passed
@dheeru0198 dheeru0198 deleted the chore-module-percentage-calculation branch January 29, 2026 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug]: Inconsistent module completion percentages

2 participants