Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

fix(batch-changes): fix zero division error resulting in wrong stats computaion#63547

Merged
BolajiOlajide merged 1 commit into
mainfrom
bolaji-srch-636-batch-changes-overflow-when-calculating-percent-complete
Jun 28, 2024
Merged

fix(batch-changes): fix zero division error resulting in wrong stats computaion#63547
BolajiOlajide merged 1 commit into
mainfrom
bolaji-srch-636-batch-changes-overflow-when-calculating-percent-complete

Conversation

@BolajiOlajide

Copy link
Copy Markdown
Contributor

Closes SRCH-636

Test plan

Added unit tests

Changelog

@BolajiOlajide BolajiOlajide requested a review from a team June 28, 2024 15:10
@BolajiOlajide BolajiOlajide self-assigned this Jun 28, 2024
@cla-bot cla-bot Bot added the cla-signed label Jun 28, 2024
if noOfIncludedChangesets == 0 {
return 100
}
return int32((mergedAndClosed / noOfIncludedChangesets) * 100)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I was under the assumption that a division by 0 will panic 🤔

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Same. Tested in Go playground, it does not panic.

@BolajiOlajide BolajiOlajide merged commit 06c57b7 into main Jun 28, 2024
@BolajiOlajide BolajiOlajide deleted the bolaji-srch-636-batch-changes-overflow-when-calculating-percent-complete branch June 28, 2024 15:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants