Collect bugs for 4 days, fix the top 5, ship again
You build a Go triage library that ranks reported issues, validates deliberate exclusions, selects fixes and generates a Markdown release report. Use the ranking to fix the five highest-priority bugs and distribute an updated Android preview build.
Ticket
Build a Go triage library in package triage. It extracts issue severity, ranks reported bugs, validates deliberate exclusions, selects the issues to fix and generates a Markdown report.
For four days, collect feedback from the friends who installed your preview APK. Record each report as a GitHub issue with reproduction steps, expected and actual behaviour, device, reporter and severity. Apply the bug triage process to select the five highest-priority issues, fix them and build another APK using your EAS build profile. Distribute it to the same testers through APK sideloading.
Commit the final report to docs/week7-bugs.md. Record which issues you fixed, which remain open and why you deliberately excluded any issues.
The supplied tests call this exported contract:
type Issue struct {
Number int
Title string
Labels []string
Reporters []string
Body string
}
func Severity(i Issue) int
func Rank(issues []Issue) []Issue
func Plan(issues []Issue, n int) (fix, deferred []Issue, err error)
func Report(fixed, left []Issue) stringAcceptance criteria
Severityreturns1forsev1,2forsev2and3forsev3. It returns0when no severity label exists. When multiple severity labels exist, it selects the most severe one, meaning the lowest positive number. For example,sev3andsev2produce2, whilesev2,sev1andsev3produce1.Rankprioritizes severity before reporter count. Given issue #1 (sev3, three reporters), #2 (sev1, one reporter), #3 (sev2, one reporter) and #4 (sev2, two reporters), the resulting order is[2, 4, 3, 1].Rankcounts distinct reporters after trimming surrounding whitespace and ignoring capitalization. For example,Asha,ashaandASHAcount as one reporter. An issue with two distinct reporters ranks ahead of an issue with those three mentions of the same reporter when their severity is equal.Rankbreaks ties in severity and distinct reporter count using issue number in ascending order. Issues numbered9,4and6must rank as[4, 6, 9]when their other ranking values are equal.Rankdoes not modify the caller's input slice. An input ordered[3, 1]remains[3, 1]after ranking.Planselects the first five eligible issues after ranking. Given eightsev2issues numbered1through8, each with one reporter, it returns[1, 2, 3, 4, 5]asfixand[6, 7, 8]asdeferred.Plannever selects an issue labelledwontfix. Given asev1issue #1 labelledwontfixwithReason: needs a redesign, out of scope for week 7and an eligiblesev3issue #2, it returns[2]asfixand[1]asdeferred.Planrejects an issue without a severity label. For issue #12, the returned error must contain12.Planrejects awontfixissue without a non-empty reason. The following bodies must produce an error containing issue number7: an empty body,not now,Reason:andReason:.Planfixes every eligible issue when fewer than five are available. Given two eligible issues and a limit of five, it returns two fixed issues and an empty deferred slice.Reportgenerates Markdown with## Fixedbefore## Not fixed. The fixed entry for issue #2 must includeorder button dead on slow network,sev1and2 reporters. The not-fixed entry for issue #1 must includedark modeandnot worth the risk this weekwhen its body containsReason: not worth the risk this week.
Constraints
- Keep the triage library independent of external services. Use standard Go functionality so its tests can run locally without network access or cloud infrastructure.
- Do not require GitHub credentials, a real domain or external service access to run the Go package tests.
- Keep GitHub issue collection, application fixes and APK distribution separate from the Go library implementation.
- Do not modify the provided tests.
Design direction
Keep the triage logic in backend/internal/triage/triage.go. Separate the responsibilities so you can reason about each operation independently.
Treat severity extraction as a small classification operation. A private helper for reporter counting can normalize names before inserting them into a set. This avoids counting repeated mentions of the same person as independent reports.
For ranking, work on a copy of the issue slice before sorting. Compare severity first, distinct reporter count second and issue number last. This keeps ranking deterministic without changing the caller's data.
Keep planning separate from ranking. Validate the complete issue collection before selecting candidates. Partition deliberately excluded issues from eligible ones, rank only eligible candidates and then construct the fixed and deferred results.
Keep report generation independent of selection. It should format the supplied fixed and remaining issues without modifying their data.
Any layout that meets the contract passes. The implementation should remain small enough to test each operation independently.
How to check your work
Run the supplied acceptance tests from the repository root:
cd backend
make test W=7B7All 11 tests must pass. When a test fails, read the first failing assertion to identify whether the problem concerns severity extraction, reporter normalization, ordering, validation, planning or Markdown generation.
After the library passes its tests, complete the four-day feedback period. Fix the five highest-priority eligible issues, run the relevant application tests, build an updated preview APK and send it to the same testers. Commit the final decisions and report to docs/week7-bugs.md.
The reference solution passes every check for this exercise. Try the hints first; reading the answer before you have struggled with the problem teaches much less.
Production app testing
4 items
- 7.8EAS preview build profilesnot completed
- 7.9Android preview APKnot completed
- 7.10Seed the Real Canteen and Operating Accountsnot completed
- 7.11Collect bugs for 4 days, fix the top 5, ship againnot completed
Up next · Module 4 · 2 items · about 3 h 45 min
Implementation
Run locally
Write the code in your editor inside zomato-prep, then work through this list.
- All 11 W7B7 acceptance tests pass.
- Four days of tester feedback are recorded as GitHub issues with reproduction details and severity labels.
- The five highest-priority eligible bugs are fixed.
- A second Android preview APK is built and shared with the same testers.
docs/week7-bugs.mdrecords fixed issues, deferred issues and deliberate exclusions with reasons.
Commands
cd backend && make test W=7B7Tests
TestW7B7_SeverityIsTheMostSevereLabelinbackend/internal/triage/triage_test.goTestW7B7_RankOrdersBySeverityThenDistinctReportersinbackend/internal/triage/triage_test.goTestW7B7_RankCountsEachReporterOnceinbackend/internal/triage/triage_test.goTestW7B7_RankBreaksTiesWithTheLowerIssueNumberinbackend/internal/triage/triage_test.goTestW7B7_RankDoesNotMutateItsInputinbackend/internal/triage/triage_test.goTestW7B7_PlanFixesTheTopFiveAndDefersTheRestinbackend/internal/triage/triage_test.goTestW7B7_PlanNeverSelectsWontfixIssuesinbackend/internal/triage/triage_test.goTestW7B7_PlanRejectsAnUntriagedIssueinbackend/internal/triage/triage_test.goTestW7B7_PlanRejectsWontfixWithoutAWrittenReasoninbackend/internal/triage/triage_test.goTestW7B7_PlanWithFewerIssuesThanSlotsFixesAllOfTheminbackend/internal/triage/triage_test.goTestW7B7_ReportListsWhatWasFixedAndWhatWasDeliberatelyLeftinbackend/internal/triage/triage_test.go