Skip to content

Fix closed label #197

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

manhuu14
Copy link

@manhuu14 manhuu14 commented Jul 11, 2025

πŸ“Œ Fixes

Fix: Hide 'closed' and 'merged' labels in reviewed PRs

Bug Fix

This PR ensures that the 'reviewed PRs' section only shows the 'open' label for open PRs.

Fixes

  • ❌ Previously, 'closed' or 'merged' labels were shown for reviewed PRs.
  • βœ… Now, closed or merged reviewed PRs show no labels as per expected behavior.

Screenshot (Before & After)

(You can add a before/after screenshot if required)

---BEFORE
Screenshot From 2025-07-09 14-16-33
-AFTER
Screenshot From 2025-07-11 19-38-02

Tested manually to confirm correct behavior in:

  • Reviewed section
  • Own PR section (open/closed/merged)

Please review. Thanks!

Summary by Sourcery

Bug Fixes:

  • Stop displaying β€˜closed’ or β€˜merged’ labels for reviewed PRs as per expected behavior

Copy link
Contributor

sourcery-ai bot commented Jul 11, 2025

Reviewer's Guide

This PR refines the label-rendering logic in the reviewed-PRs section by altering the conditional checks so that only open PRs display an β€œopen” label and closed or merged PRs show no labels, aligning with expected behavior.

File-Level Changes

Change Details Files
Restrict label rendering to open PRs in reviewed section
  • Added a conditional check to skip label rendering when PR status is closed or merged
  • Removed logic that previously displayed 'closed' or 'merged' labels for reviewed PRs
  • Updated the rendering function to only emit the 'open' label for open PRs
scrum_helper

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

@sourcery-ai sourcery-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.

Hey @manhuu14 - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click πŸ‘ or πŸ‘Ž on each comment and I'll use the feedback to improve your reviews.

@manhuu14
Copy link
Author

@Preeti9764 can you please review it.

@manhuu14
Copy link
Author

@vedansh-5 can you review it

@Preeti9764
Copy link
Contributor

@manhuu14 It still shows closed label for my reviewed prs , please fix this.Thanks!
image

@manhuu14
Copy link
Author

use this code for let li;

if (sectionType === "reviewed") {
// βœ… For Reviewed PRs
if (item.state === 'open') {
console.log([ScrumHelper] Reviewed PR #${number} is OPEN);
li = <li><i>(${project})</i> - Reviewed PR (#${number}) - <a href='${html_url}'>${title}</a> ${pr_open_button}</li>;
} else {
// βœ… For merged or closed reviewed PRs: no label
console.log([ScrumHelper] Reviewed PR #${number} is CLOSED/MERGED β€” label hidden);
li = <li><i>(${project})</i> - Reviewed PR (#${number}) - <a href='${html_url}'>${title}</a></li>;
}
lastWeekArray.push(li);
continue;
} else if (item.state === 'open') {
// βœ… For your own open PRs
console.log([ScrumHelper] Own PR #${number} is OPEN);
li = <li><i>(${project})</i> - Made PR (#${number}) - <a href='${html_url}'>${title}</a> ${pr_open_button}</li>;
lastWeekArray.push(li);
continue;
} else if (item.state === 'closed') {
// βœ… For your own closed PRs β€” merged or just closed
let merged = null;
if ((githubToken || (useMergedStatus && !fallbackToSimple)) && mergedStatusResults) {
const repoParts = repository_url.split('/');
const owner = repoParts[repoParts.length - 2];
const repo = repoParts[repoParts.length - 1];
merged = mergedStatusResults[${owner}/${repo}#${number}];
}

if (merged === true) {
    console.log(`[ScrumHelper] Own PR #${number} is MERGED`);
    li = `<li><i>(${project})</i> - Made PR (#${number}) - <a href='${html_url}'>${title}</a> ${pr_merged_button}</li>`;
} else {
    console.log(`[ScrumHelper] Own PR #${number} is CLOSED but NOT merged`);
    li = `<li><i>(${project})</i> - Made PR (#${number}) - <a href='${html_url}'>${title}</a> ${pr_closed_button}</li>`;
}

lastWeekArray.push(li);
continue;

}
instead of "closed"

@manhuu14
Copy link
Author

@Preeti9764 can you explain the issue clearly
Screenshot From 2025-07-14 19-51-16
i have updated code result seems like this, can you verify this and explain issue clearly thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants