Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: coder/coder
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: coder/coder
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: dean-tallyman-dashboard-endpoint
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 8 commits
  • 15 files changed
  • 1 contributor

Commits on Dec 11, 2025

  1. Configuration menu
    Copy the full SHA
    7ee1daa View commit details
    Browse the repository at this point in the history
  2. refactor(usage): move license selection logic into tallymansdk.New

    - Move getBestLicenseJWT logic from publisher.go to tallymansdk.New()
    - Add NewOptions struct for tallymansdk client creation
    - Export ErrNoLicenseSupportsPublishing for reuse in other contexts
    - Simplify publisher.publishOnce by delegating license selection to SDK
    deansheather committed Dec 11, 2025
    Configuration menu
    Copy the full SHA
    196c188 View commit details
    Browse the repository at this point in the history
  3. feat(enterprise): add embeddable dashboard endpoint

    - Add POST /api/v2/licenses/usage/embeddable-dashboard endpoint
    - Requires license read permission (admin-only)
    - Returns 404 when no license supports usage publishing
    - Validates dashboard URL is from metronome.com domain
    - Converts codersdk types to tallymansdk types
    - Includes Swagger documentation for API
    - Auto-generated API docs and TypeScript types
    deansheather committed Dec 11, 2025
    Configuration menu
    Copy the full SHA
    45fd5ac View commit details
    Browse the repository at this point in the history
  4. test(enterprise): add tests for embeddable dashboard endpoint

    - Test no license scenario (returns 404)
    - Test license without PublishUsageData (returns 404)
    - Test unauthorized user access (returns 403)
    - Focus on authorization and license validation logic
    deansheather committed Dec 11, 2025
    Configuration menu
    Copy the full SHA
    f8ce104 View commit details
    Browse the repository at this point in the history
  5. test(enterprise): improve embeddable dashboard endpoint tests

    - Remove 3 empty lines between test cases
    - Make Tallyman URL configurable via enterprise/coderd.Options
      - Add TallymanURL field as pre-parsed *url.URL
      - Pass through to tallymansdk.New for testing
    - Add comprehensive tests with httptest fake server:
      - Success: validates happy path with proper auth headers
      - WithColorOverrides: validates color override pass-through
      - UntrustedHostRejected: validates security check for non-metronome.com domains
      - TallymanServerError: validates error handling from Tallyman
      - InvalidDashboardType: validates invalid dashboard type returns 400
    - Add dashboard type validation in handler
    - Use tallymansdk structs instead of map[string]interface{} in tests
    - Use assert instead of require in HTTP handlers (safe for non-test goroutines)
    - Simplify httptest.NewServer calls by using HandlerFunc directly
    - Make codersdk dashboard type an enum (UsageEmbeddableDashboardType)
    - Add nolint comments for owner user usage (required for license access)
    
    Made by cmux
    deansheather committed Dec 11, 2025
    Configuration menu
    Copy the full SHA
    17d391f View commit details
    Browse the repository at this point in the history
  6. refactor: address PR feedback

    - Add type relationship comments between codersdk and tallymansdk types
    - Move NewOptions type definition above New function in tallymansdk
    - Rename PublisherWithIngestURL to PublisherWithTallymanBaseURL
    - Change fakeServer to return *url.URL instead of string
    - Rename ingestURL to baseURL throughout tests
    - Add validation for Metronome color names in API
    - Use real Metronome color names in tests (Primary_medium, UsageLine_0, etc.)
    - Add test for invalid color name rejection
    deansheather committed Dec 11, 2025
    Configuration menu
    Copy the full SHA
    5a11e60 View commit details
    Browse the repository at this point in the history
  7. refactor: move valid color overrides to tallymansdk package

    - Create tallymansdk.TallymanValidColorOverrides global variable
    - Add documentation about Metronome color palette
    - Update API to use tallymansdk.TallymanValidColorOverrides
    - Remove local validColors map from licenses.go
    deansheather committed Dec 11, 2025
    Configuration menu
    Copy the full SHA
    581064c View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    cbdc098 View commit details
    Browse the repository at this point in the history
Loading