Skip to content

Fix 'is_merged' not being available on the Issue#3843

Merged
arkid15r merged 2 commits intomainfrom
fix-accessing-issues-page
Feb 8, 2026
Merged

Fix 'is_merged' not being available on the Issue#3843
arkid15r merged 2 commits intomainfrom
fix-accessing-issues-page

Conversation

@kasya
Copy link
Collaborator

@kasya kasya commented Feb 8, 2026

The view issues page on the module level was failing after recent update to get rid of N +1.
This PR introduces a fix for that.

I also updated frontend representation of labels for issues that have merged PRs. They will now say Closed instead of Merged as Issue can not be merged. But it will show purple color for issue with merged PR and red for issue that was just closed - this matches GitHub representation.

Resolves #3841

Screenshot 2026-02-07 at 5 16 19 PM

Checklist

  • Required: I followed the contributing workflow
  • Required: I verified that my code works as intended and resolves the issue as described
  • Required: I ran make check-test locally: all warnings addressed, tests passed
  • I used AI for code, documentation, tests, or communication related to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 8, 2026

Summary by CodeRabbit

  • Refactor

    • Improved backend query performance for loading issue data by optimizing how merged pull requests are retrieved and prefetched alongside related information.
  • Style

    • Updated issue status labels throughout the application to display "Closed" instead of "Merged" for consistency across all user-facing components.

Walkthrough

Replaced an Exists/OuterRef annotation with a module-level Prefetch (MERGED_PULL_REQUESTS_PREFETCH) for detecting merged pull requests in the Issue node; propagated that prefetch into mentorship issue queries; and updated frontend/UI and tests to display "Closed" (instead of "Merged") for merged issues.

Changes

Cohort / File(s) Summary
Issue node (backend)
backend/apps/github/api/internal/nodes/issue.py
Added MERGED_PULL_REQUESTS_PREFETCH (Prefetch of closed & merged PRs to merged_pull_requests), removed Exists/OuterRef imports/annotation, and refactored is_merged resolver to use pre-fetched merged_pull_requests.
Mentorship queries (backend)
backend/apps/mentorship/api/internal/nodes/module.py, backend/apps/mentorship/api/internal/queries/mentorship.py
Imported and added MERGED_PULL_REQUESTS_PREFETCH to prefetch_related calls for issue lists and single-issue lookups to ensure merged_pull_requests is pre-fetched.
Frontend UI
frontend/src/app/my/mentorship/programs/.../issues/[issueId]/page.tsx, frontend/src/components/IssuesTable.tsx
Changed displayed status label for merged issues from "Merged" to "Closed" (badge text only; styling/control flow preserved).
Frontend tests
frontend/__tests__/unit/components/IssuesTable.test.tsx, frontend/__tests__/unit/pages/IssuesPage.test.tsx, frontend/__tests__/unit/pages/ModuleIssueDetailsPage.test.tsx
Updated assertions to expect "Closed" instead of "Merged" for cases where an issue is closed and isMerged is true.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The PR title accurately captures the main issue: fixing the 'is_merged' attribute that became unavailable on the Issue model/resolver.
Description check ✅ Passed The PR description is related to the changeset, explaining the N+1 query fix, the resolver issue, and the frontend label updates for merged/closed states.
Linked Issues check ✅ Passed The PR fully addresses issue #3841 by replacing the Exists/OuterRef annotation with a Prefetch approach, making is_merged safe to resolve regardless of queryset path.
Out of Scope Changes check ✅ Passed All changes are in-scope: backend optimization for is_merged resolution, frontend label text updates from 'Merged' to 'Closed', and corresponding test updates are all related to issue #3841.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-accessing-issues-page

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
backend/apps/github/api/internal/nodes/issue.py (1)

59-62: Minor: state="closed" filter is redundant.

A PR with merged_at__isnull=False is by definition closed (GitHub sets state to "closed" upon merge). The extra filter is harmless but adds no value. Keeping it as a defensive guard is acceptable.


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.

cubic-dev-ai[bot]
cubic-dev-ai bot previously approved these changes Feb 8, 2026
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 8 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

coderabbitai[bot]
coderabbitai bot previously approved these changes Feb 8, 2026
@kasya kasya marked this pull request as ready for review February 8, 2026 01:08
@kasya kasya requested a review from arkid15r as a code owner February 8, 2026 01:08
@codecov
Copy link

codecov bot commented Feb 8, 2026

Codecov Report

❌ Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 93.68%. Comparing base (152206e) to head (8e772a2).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
backend/apps/github/api/internal/nodes/issue.py 75.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3843      +/-   ##
==========================================
+ Coverage   90.24%   93.68%   +3.44%     
==========================================
  Files         463      463              
  Lines       14416    14420       +4     
  Branches     1937     1939       +2     
==========================================
+ Hits        13009    13509     +500     
+ Misses        988      535     -453     
+ Partials      419      376      -43     
Flag Coverage Δ
backend 95.65% <75.00%> (+4.67%) ⬆️
frontend 88.17% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
[...Key]/modules/[moduleKey]/issues/[issueId]/page.tsx](https://app.codecov.io/gh/OWASP/Nest/pull/3843?src=pr&el=tree&filepath=frontend%2Fsrc%2Fapp%2Fmy%2Fmentorship%2Fprograms%2F%5BprogramKey%5D%2Fmodules%2F%5BmoduleKey%5D%2Fissues%2F%5BissueId%5D%2Fpage.tsx&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=OWASP#diff-ZnJvbnRlbmQvc3JjL2FwcC9teS9tZW50b3JzaGlwL3Byb2dyYW1zL1twcm9ncmFtS2V5XS9tb2R1bGVzL1ttb2R1bGVLZXldL2lzc3Vlcy9baXNzdWVJZF0vcGFnZS50c3g=) 87.28% <100.00%> (ø)
frontend/src/components/IssuesTable.tsx 91.66% <ø> (ø)
backend/apps/github/api/internal/nodes/issue.py 89.28% <75.00%> (+0.39%) ⬆️

... and 46 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 152206e...8e772a2. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 8, 2026

@arkid15r arkid15r enabled auto-merge February 8, 2026 21:31
Copy link
Collaborator

@arkid15r arkid15r left a comment

Choose a reason for hiding this comment

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

👍

@arkid15r arkid15r added this pull request to the merge queue Feb 8, 2026
Merged via the queue into main with commit 1e1da21 Feb 8, 2026
38 checks passed
@arkid15r arkid15r deleted the fix-accessing-issues-page branch February 8, 2026 21:51
arkid15r added a commit that referenced this pull request Feb 10, 2026
* Run make update

* Clean up snapshot generated videos

* Update backend/data/nest.dump

* feat(ui): revamp corporate supporters carousel (Infinite Marquee + Dark Mode fix) (#3837)

* feat(ui): revamp corporate supporters carousel (Infinite Marquee + Dark Mode fix)

* fix: resolve failing test case

* fix: add fallback text for unnamed sponsors

* docs: add docstrings to satisfy coverage requirements

* Run make check and fix tests.

---------

Co-authored-by: Kate <kate@kgthreads.com>

* Fix/redundant typescript assertion (#3834)

* Fix Sonar S4325 by narrowing session user fields instead of casting

* Fix unused ExtendedSession in mentorship page

* fix: redundant-typescript-assertion

* Fix stale latest date displayed in Project Health Dashboard metrics (#3842)

* Fixed latest date in proejct health dashboard

* updated order

* Update code

* Update code

---------

Co-authored-by: Arkadii Yakovets <arkadii.yakovets@owasp.org>

* feat: improve backend test coverage to 96% (#3840)

* feat: improve backend test coverage to 96%

* fix comments

* fix issues

* fix issue

* fix cubic-dev-ai comments

* Update code

* Fix tests

---------

Co-authored-by: Arkadii Yakovets <arkadii.yakovets@owasp.org>
Co-authored-by: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>

* Fix: merge consecutive RUN instructions in frontend Dockerfile (#3644)

* Fix: merge consecutive RUN instructions in frontend Dockerfile

* fix: comment Dockerfile note to prevent syntax error

* Update code

* Update code

---------

Co-authored-by: Arkadii Yakovets <arkadii.yakovets@owasp.org>
Co-authored-by: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>

* Fix 'is_merged' not being available on the Issue (#3843)

* Fix 'is_merged' not being available on the Issue

* Update code

---------

Co-authored-by: Arkadii Yakovets <arkadii.yakovets@owasp.org>

* CI:  Add ansible-lint workflow for Ansible playbooks (#3796)

* ci: add ansible-lint workflow

Signed-off-by: Muhammad Hassaan Saleem <iamhassaans@gmail.com>

* Update .github/workflows/lint-ansible.yaml

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* ci: add ansible-lint make target and workflow

Signed-off-by: Muhammad Hassaan Saleem <iamhassaans@gmail.com>

* ci: add ansible-lint pre-commit hook

Signed-off-by: Muhammad Hassaan Saleem <iamhassaans@gmail.com>

* fix: whitespace & version

Signed-off-by: Muhammad Hassaan Saleem <iamhassaans@gmail.com>

* Update Makefile

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>

* ci: enable ansible-lint scanning and add requirements.yml

Signed-off-by: Muhammad Hassaan Saleem <iamhassaans@gmail.com>

* chore(ansible):align linting and module usage

Signed-off-by: Muhammad Hassaan Saleem <iamhassaans@gmail.com>

* ci(ansible): install collections before deploy playbooks

Signed-off-by: Muhammad Hassaan Saleem <iamhassaans@gmail.com>

* Update code

* Update code

* Update .github/workflows/run-ci-cd.yaml

---------

Signed-off-by: Muhammad Hassaan Saleem <iamhassaans@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Co-authored-by: Arkadii Yakovets <arkadii.yakovets@owasp.org>

* Fix ElevenLabs API error (#3861)

* use default liam voice

* bump speed by 0.10

---------

Co-authored-by: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>

* Add Ime Iyonsi to MENTORS.md (#3866)

* Add mentor profile for Ime Iyonsi

Added Ime Iyonsi's mentor profile.

* Fix GitHub link for Ime Iyonsi

Corrected GitHub link for Ime Iyonsi.

* Update code

---------

Co-authored-by: Arkadii Yakovets <arkadii.yakovets@owasp.org>

* Update MENTORS.md

* Enabled Strict Mode (#3776)

* Enabled Strict Mode

* fixed ai review

* fix

* fixed review

* fix

* update test

* Update code

---------

Co-authored-by: Arkadii Yakovets <arkadii.yakovets@owasp.org>
Co-authored-by: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>

* Resolve case-sensitivity in QueryParser to support Chapters/Members search (#3844)

* resolve query parser blocker

* use case_sensitive flag in QueryParser

* feat: add case_sensitive option to QueryParser and update tests

* Update code

---------

Co-authored-by: Arkadii Yakovets <arkadii.yakovets@owasp.org>
Co-authored-by: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>

* Update dependencies (#3874)

* Update dependencies

* Bump django-ninja version

* fix(proxy): pin nginx and certbot images (#3848)

* fix(proxy): pin nginx and certbot images

Signed-off-by: Muhammad Hassaan Saleem <iamhassaans@gmail.com>

* fix stable verssions

Signed-off-by: Muhammad Hassaan Saleem <iamhassaans@gmail.com>

---------

Signed-off-by: Muhammad Hassaan Saleem <iamhassaans@gmail.com>
Co-authored-by: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>

* Update docker-compose/proxy/compose.yaml

* Update backend/pyproject.toml

* Update ansible lint configuration (#3880)

* Update .github/ansible/.ansible-lint.yaml

* Improve frontend test coverage above 80% and add missing test files (#3864)

* Imrove test coverage to 80% and added test

* Fixed coderabbit review

* update code

* fixed coderabbit ai

* fixed soanrqube warning

* fixed review

* update

* fixed aloglia cache_key (#3825)

* fixed aloglia cache_key

* change separator val to be semicolon (;)

* Update code

* add tests + use json filters

* add trailing newline

* Update code

---------

Co-authored-by: Arkadii Yakovets <arkadii.yakovets@owasp.org>
Co-authored-by: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>

* fix: remove unused className prop from AnchorTitle component (#3822)

* fix: remove unused className prop from AnchorTitle component

Fixes #3805

The className prop was defined in AnchorTitleProps but never used
in the component implementation. Removing it resolves Sonar rule
typescript:S6767 and improves code maintainability.

* fix: use className prop instead of removing it

- Added className back to AnchorTitleProps interface
- Accept className parameter in component
- Apply className to root div element
- Resolves reviewer feedback on PR #3822

* Update code

---------

Co-authored-by: Arkadii Yakovets <arkadii.yakovets@owasp.org>
Co-authored-by: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>

---------

Signed-off-by: Muhammad Hassaan Saleem <iamhassaans@gmail.com>
Co-authored-by: Arkadii Yakovets <arkadii.yakovets@owasp.org>
Co-authored-by: Yashraj Pahuja <yashrajpahuja9999@gmail.com>
Co-authored-by: Kate <kate@kgthreads.com>
Co-authored-by: CodeAritraDhank <aritradhank21@gmail.com>
Co-authored-by: Anurag Yadav <143180737+anurag2787@users.noreply.github.com>
Co-authored-by: Harshit Verma <harshit1092004@gmail.com>
Co-authored-by: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>
Co-authored-by: Shuban Mutagi <shubanmutagi55@gmail.com>
Co-authored-by: Muhammad Hassaan Saleem <iamhassaans@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Co-authored-by: emaybu <152900874+emaybu@users.noreply.github.com>
Co-authored-by: sai chethana <saichethanavesireddy@gmail.com>
Co-authored-by: Rahul Paul <179798584+Mr-Rahul-Paul@users.noreply.github.com>
Co-authored-by: Lavanya <lavanyayadawad30@gmail.com>
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.

Issue.isMerged GraphQL resolver fails due to missing annotation attribute

2 participants