Skip to content

chore: refactor site handler to take cache dir#21918

Merged
spikecurtis merged 1 commit intomainfrom
spike/internal-1300-site-takes-cache-dir
Feb 6, 2026
Merged

chore: refactor site handler to take cache dir#21918
spikecurtis merged 1 commit intomainfrom
spike/internal-1300-site-takes-cache-dir

Conversation

@spikecurtis
Copy link
Contributor

@spikecurtis spikecurtis commented Feb 4, 2026

relates to: coder/internal#1300

Refactors the options to the site handler to take the cache directory, rather than expecting the caller to call ExtractOrReadBinFS and pass the results.

This is important in this stack because we need direct access to the cache directory for compressed file caching.

Copy link
Contributor

@coder-tasks coder-tasks bot left a comment

Choose a reason for hiding this comment

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

Code Review

Reviewed refactoring of site handler to take cache directory. The refactoring improves encapsulation by moving the ExtractOrReadBinFS call into the site package. Found 2 minor issues to address.

Summary

Architecture: Good encapsulation improvement - site package now owns the extraction logic
Error handling: Proper error propagation replacing panics
Tests: All test updates handle new error return correctly
⚠️ Minor issues: Error message could be more specific, unnecessary import in test

Issues Found

  1. Error message lacks specificity - The Fatal log message could better indicate the root cause
  2. Unused import in test - The golang.org/x/exp/maps import adds complexity for test setup that could be simplified

@spikecurtis spikecurtis force-pushed the spike/internal-1300-site-takes-cache-dir branch from 174915d to 55ff2fc Compare February 4, 2026 10:11
@spikecurtis spikecurtis force-pushed the spike/internal-1300-handler-is-struct branch from 0320b65 to 8251b2e Compare February 4, 2026 10:11
@spikecurtis spikecurtis force-pushed the spike/internal-1300-site-takes-cache-dir branch from 55ff2fc to f220d00 Compare February 4, 2026 10:19
@spikecurtis spikecurtis force-pushed the spike/internal-1300-handler-is-struct branch from 8251b2e to 4429923 Compare February 4, 2026 10:19
@spikecurtis spikecurtis force-pushed the spike/internal-1300-handler-is-struct branch from 4429923 to af3fb2f Compare February 4, 2026 11:50
@spikecurtis spikecurtis force-pushed the spike/internal-1300-site-takes-cache-dir branch from f220d00 to 69d8817 Compare February 4, 2026 11:50
@spikecurtis spikecurtis force-pushed the spike/internal-1300-handler-is-struct branch from af3fb2f to 9ec9c39 Compare February 4, 2026 11:50
@spikecurtis spikecurtis force-pushed the spike/internal-1300-site-takes-cache-dir branch from 69d8817 to aa754c2 Compare February 4, 2026 11:50
@spikecurtis spikecurtis force-pushed the spike/internal-1300-handler-is-struct branch from 9ec9c39 to 6bb53c2 Compare February 6, 2026 06:13
@spikecurtis spikecurtis force-pushed the spike/internal-1300-site-takes-cache-dir branch from aa754c2 to 937a341 Compare February 6, 2026 06:14
@spikecurtis spikecurtis force-pushed the spike/internal-1300-handler-is-struct branch 2 times, most recently from b478cc5 to 2816283 Compare February 6, 2026 06:31
@spikecurtis spikecurtis force-pushed the spike/internal-1300-site-takes-cache-dir branch from 937a341 to 1c048ce Compare February 6, 2026 06:31
@spikecurtis spikecurtis changed the base branch from spike/internal-1300-handler-is-struct to graphite-base/21918 February 6, 2026 06:41
@spikecurtis spikecurtis force-pushed the spike/internal-1300-site-takes-cache-dir branch from 1c048ce to be4da2b Compare February 6, 2026 06:42
@graphite-app graphite-app bot changed the base branch from graphite-base/21918 to main February 6, 2026 06:43
@graphite-app
Copy link

graphite-app bot commented Feb 6, 2026

Merge activity

  • Feb 6, 6:43 AM UTC: Graphite rebased this pull request, because this pull request is set to merge when ready.
  • Feb 6, 6:56 AM UTC: @spikecurtis merged this pull request with Graphite.

@spikecurtis spikecurtis merged commit 6b1adb8 into main Feb 6, 2026
34 of 54 checks passed
@spikecurtis spikecurtis deleted the spike/internal-1300-site-takes-cache-dir branch February 6, 2026 06:56
@github-actions github-actions bot locked and limited conversation to collaborators Feb 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants