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:

go
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) string

Acceptance criteria

  • Severity returns 1 for sev1, 2 for sev2 and 3 for sev3. It returns 0 when no severity label exists. When multiple severity labels exist, it selects the most severe one, meaning the lowest positive number. For example, sev3 and sev2 produce 2, while sev2, sev1 and sev3 produce 1.
  • Rank prioritizes 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].
  • Rank counts distinct reporters after trimming surrounding whitespace and ignoring capitalization. For example, Asha, asha and ASHA count 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.
  • Rank breaks ties in severity and distinct reporter count using issue number in ascending order. Issues numbered 9, 4 and 6 must rank as [4, 6, 9] when their other ranking values are equal.
  • Rank does not modify the caller's input slice. An input ordered [3, 1] remains [3, 1] after ranking.
  • Plan selects the first five eligible issues after ranking. Given eight sev2 issues numbered 1 through 8, each with one reporter, it returns [1, 2, 3, 4, 5] as fix and [6, 7, 8] as deferred.
  • Plan never selects an issue labelled wontfix. Given a sev1 issue #1 labelled wontfix with Reason: needs a redesign, out of scope for week 7 and an eligible sev3 issue #2, it returns [2] as fix and [1] as deferred.
  • Plan rejects an issue without a severity label. For issue #12, the returned error must contain 12.
  • Plan rejects a wontfix issue without a non-empty reason. The following bodies must produce an error containing issue number 7: an empty body, not now, Reason: and Reason: .
  • Plan fixes 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.
  • Report generates Markdown with ## Fixed before ## Not fixed. The fixed entry for issue #2 must include order button dead on slow network, sev1 and 2 reporters. The not-fixed entry for issue #1 must include dark mode and not worth the risk this week when its body contains Reason: 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:

bash
cd backend
make test W=7B7

All 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.

Finished Exercise 7.11?

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

Order RPC interface

Up next · Module 4 · 2 items · about 3 h 45 min

Start module 4

Implementation

Run locally

Write the code in your editor inside zomato-prep, then work through this list.

  1. All 11 W7B7 acceptance tests pass.
  2. Four days of tester feedback are recorded as GitHub issues with reproduction details and severity labels.
  3. The five highest-priority eligible bugs are fixed.
  4. A second Android preview APK is built and shared with the same testers.
  5. docs/week7-bugs.md records fixed issues, deferred issues and deliberate exclusions with reasons.

Commands

terminal
cd backend && make test W=7B7

Tests

  • TestW7B7_SeverityIsTheMostSevereLabel in backend/internal/triage/triage_test.go
  • TestW7B7_RankOrdersBySeverityThenDistinctReporters in backend/internal/triage/triage_test.go
  • TestW7B7_RankCountsEachReporterOnce in backend/internal/triage/triage_test.go
  • TestW7B7_RankBreaksTiesWithTheLowerIssueNumber in backend/internal/triage/triage_test.go
  • TestW7B7_RankDoesNotMutateItsInput in backend/internal/triage/triage_test.go
  • TestW7B7_PlanFixesTheTopFiveAndDefersTheRest in backend/internal/triage/triage_test.go
  • TestW7B7_PlanNeverSelectsWontfixIssues in backend/internal/triage/triage_test.go
  • TestW7B7_PlanRejectsAnUntriagedIssue in backend/internal/triage/triage_test.go
  • TestW7B7_PlanRejectsWontfixWithoutAWrittenReason in backend/internal/triage/triage_test.go
  • TestW7B7_PlanWithFewerIssuesThanSlotsFixesAllOfThem in backend/internal/triage/triage_test.go
  • TestW7B7_ReportListsWhatWasFixedAndWhatWasDeliberatelyLeft in backend/internal/triage/triage_test.go