Skip to content

Add milestone anomaly warnings#502

Open
SAN-MUYUN wants to merge 13 commits intoCATcher-org:mainfrom
SAN-MUYUN:feature/milestone-anomalies-warnings
Open

Add milestone anomaly warnings#502
SAN-MUYUN wants to merge 13 commits intoCATcher-org:mainfrom
SAN-MUYUN:feature/milestone-anomalies-warnings

Conversation

@SAN-MUYUN
Copy link
Copy Markdown
Contributor

@SAN-MUYUN SAN-MUYUN commented Jul 27, 2025

Summary:

Fixes #459

Type of change:

  • ✨ New Feature/ Enhancement
  • 🧪 Tests Update

Changes Made:

Implemented a new model MilestoneAnomaly to represent a milestone anomaly.

When milestone has one of the following anomalies, a warning will be shown above the issues and PRs section. The warning will display both the milestone title and its anomaly.

  • Milestone with no deadline
  • Open milestone that has gone past deadline
  • Closed milestone with open issues or unmerged PR
  • Multiple active milestones

Milestone anomalies will only be displayed when users set the Group By filter to Milestone. When set to Assignee, the warning card will not be displayed.

Screenshots:

Before:

No warning is shown for milestone anomalies:

image

After:

When any milestones has anomalies:
image

When there are too many milestone anomalies, it will be kept at a fixed height. The component will become scrollable
Width of this component will follow the width of the issues/PRs section

image

When Group By filter is set to Assignee, no milestone anomaly warnings will be shown
image

Proposed Commit Message:

Implement warnings to display basic milestone anomalies for milestones

There is no warning if a milestone does not have a deadline or has
gone past deadline.

Let's display a warning above the milestone filter if a milestone
without a deadline or has gone past deadline is selected.

Checklist:

  • I have tested my changes thoroughly.
  • I have created tests for any new code files created in this PR or provided a link to a issue/PR that addresses this.
  • I have added or modified code comments to improve code readability where necessary.
  • I have updated the project's documentation as necessary.

Copy link
Copy Markdown

@TobyCyan TobyCyan left a comment

Choose a reason for hiding this comment

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

Thank you for making your code clean and readable with comments! Really liked how you encapsulated each anomaly type into their own classes. You could consider my comments that I left for this PR regarding naming conventions and typo issues. Otherwise, overall LGTM!

isDraft: false
});

export const OPEN_ISSUE_WITH_CLOSED_MMILESTONE = new GithubIssue({
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I could be wrong but is this a typo? If so maybe could fix this?

Comment on lines +4 to +12
export abstract class MilestoneAnomaly {
anomaly: string;

constructor(anomaly: string) {
this.anomaly = anomaly;
}

abstract getDescription(): string;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks for creating an abstract base class to make this feature more extensible 😄 ! However since this class only holds an anomaly string, maybe could call this Anomaly instead? And have another MilestoneAnomaly that inherits from this. Considering we could have other kinds of anomalies in the future.

}
}

export class GeneralMilestoneAnomaly extends MilestoneAnomaly {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Since the only difference between this class and the SingleMilestoneAnomaly class is that this holds multiple milestones instead of one, perhaps can call this MultipleMilestoneAnomaly instead? Do correct me if I'm understanding this wrongly!

@SAN-MUYUN
Copy link
Copy Markdown
Contributor Author

Thank you for the suggestions and spotting the typo! I have updated the PR to fix the typo issue and created a new abstract class Anomaly, to make it more extensible in the future as suggested. Appreciate the feedbacks!

I did not rename the MultipleMilestoneAnomaly method, reason being it might mislead future developers into think that it represents multiple milestone anomalies, rather than a single milestone anomaly but involves multiple milestones. GeneralMilestoneAnomaly sounds slightly better in my opinion. Open to other suggestions as well!

Copy link
Copy Markdown
Contributor

@NorbertLoh NorbertLoh left a comment

Choose a reason for hiding this comment

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

I quite like this feature. It would be useful in ensuring the correct usage of milestones.

Perhaps instead of showing it in all the layouts, we can keep it to Group by -> Milestones.
Maybe the design of the box could be better.

Here are some inspirations you can take from
(I quite like this)
image

image

@SAN-MUYUN
Copy link
Copy Markdown
Contributor Author

@NorbertLoh Hi, thank you for the feedback! I have made the changes accordingly.

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.

'Currently active' view: Show a warning for milestone anomalies

4 participants