Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Alternative to #174 for #171: instead of a separate chart, each team's own row is highlighted on the existing scoreboard graphs, without revealing anything on an anonymized scoreboard.
www/api/graphs.go: the services, scores and uptimes endpoints mark the caller's own series withSelf, based on the logged-in team. When scrubbing, every other series stays"Team"with ID 0 and the shuffle is unchanged; only the caller's own row keeps its ID so it still links to their services page. Responses now sendCache-Control: private, no-store, since they differ per caller.static/templates/pages/graphs.html: the viewer's team is shown by color alone, with no extra label text. It is pinned to the top row of the Service Status and Uptime heatmaps with a bold purple label, drawn as a thick purple line on top in Scores Over Time, and shown as a purple bar on the Leaderboard. Labels are matched by position because anonymized labels are all"Team". Purple is dropped from the other series' palette so it stays unique.Tests
tests/integration/graphs_test.gocovers all three endpoints as the team itself, red team, logged out, and admin. It checks that only the caller's series is marked, other IDs stay 0, no team names appear in anonymized responses, the cache header is set, and admins still see real names.tests/testutil: addsResetCompetitionState, because the new test starts the competition and the persistedStartedAtotherwise brokeTestImportedInjectScheduleAnchorsOnceToActualStart.gofmtandgo vetpass. The page was also rendered headless with mocked data in light and dark mode for anonymized/named/no-team viewers, including after a resize.