Commit Graph
9 Commits
Author SHA1 Message Date
bvandeusenandClaude Opus 5.5 5d2c533074 providers: remove TreatAuthAsTransient, which changed only an error's text (#8299)
release / go (push) Successful in 1m48s
release / web (push) Successful in 1m19s
release / integration (push) Successful in 2m38s
release / govulncheck (push) Successful in 20s
release / android (push) Successful in 4m29s
release / Build signed APK (push) Successful in 4m57s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Publish the release image to GHCR (dispatch only) (push) Skipped
release / Build + push container image (push) Successful in 14s
release / Verify release artifacts (tag releases only) (push) Skipped
Without the option a 401 or 403 already fell to the default branch, which
answers ErrTransient without a retry, the same as the option's own branch.
The only difference was "(auth)" in the message. TheAudioDB and both
Last.fm providers set it; none read the message. The reason it gave, that
a bad key retries later instead of settling the row as "none", now sits on
the default branch, and the client's status table checks 401 and 403.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 15:31:09 -05:00
bvandeusenandClaude Opus 5.5 da21becead Revert the deliberate break (#8299)
Run 11302 failed all ten named tests, and with them apierror's
TestWrite_SendsTheEnvelopeAndHidesAPlainErrorsText and api's
TestFlag_BadReason, which pin the same rules from the handler side.

This reverts commit 21adbc2283.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 15:30:55 -05:00
bvandeusenandClaude Opus 5.5 21adbc2283 test: DELIBERATE BREAK, expected red, reverted next (#8299)
release / web (push) Successful in 1m43s
release / go (push) Failing after 2m6s
release / govulncheck (push) Successful in 20s
release / integration (push) Failing after 2m48s
release / Attach APK to the Release (tag releases only) (push) Canceled after 0s
release / Build + push container image (push) Canceled after 0s
release / Publish the release image to GHCR (dispatch only) (push) Canceled after 0s
release / Verify release artifacts (tag releases only) (push) Canceled after 0s
release / android (push) Canceled after 2m8s
release / Build signed APK (push) Canceled after 1m47s
- backup Coverage: a listed table missing from the schema goes unreported
  -> TestCoverage
- scrobble: exactly four minutes no longer qualifies -> TestQualifies
- listenbrainz submit: a 400 retried as transient
  -> TestClient_RefusalsMapToWhatTheWorkerDoes
- playevents: either skip condition alone is a skip
  -> TestRecordPlayEnded_AppliesTheSkipRule
- recsettings: tag scales up to 100 -> TestUpdateTaste_TagScales
- apierror From: a plain error answered 400 -> TestFrom
- auth RequireAdmin: no user in the context passes through
  -> TestRequireAdmin
- providers: a 404 is transient
  -> TestHTTPClient_GetJSON_AnswersNotFoundOrTransient
- quarantine: any reason accepted -> TestService_Refusals
- playsessions: exactly the window starts a new session
  -> TestFindOrCreate_JoinsWithinTheWindowAndStartsAfterIt

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 15:26:57 -05:00
bvandeusenandClaude Opus 5.5 cfdbfa30e3 test(backup, scrobble, playevents, recsettings, apierror, auth, providers): merge repeated cases (#8299)
release / web (push) Successful in 1m41s
release / go (push) Successful in 2m4s
release / govulncheck (push) Successful in 23s
release / integration (push) Successful in 3m5s
release / Attach APK to the Release (tag releases only) (push) Canceled after 0s
release / Build + push container image (push) Canceled after 0s
release / Publish the release image to GHCR (dispatch only) (push) Canceled after 0s
release / Verify release artifacts (tag releases only) (push) Canceled after 0s
release / android (push) Canceled after 4m35s
release / Build signed APK (push) Canceled after 3m53s
- backup: schema coverage's three tests and the three AWS signing
  examples, one table each.
- scrobble: Qualifies' six boundary tests; the ListenBrainz client's
  refusal mapping, twelve tests of the same rule across three calls, one
  table over call x status; the two similarity lookups' success and URL
  tests, one table.
- playevents: the skip rule's three plays share one fixture. Dropped
  TestRecordPlayEnded_SubThreshold_NoEnqueue: the writer only calls
  scrobble.MaybeEnqueue, whose own test and Qualifies' table hold that
  case; the qualifying-play test still proves the writer calls it.
- recsettings: the three tag-scale tests share one database reset.
- apierror: Error() and From, one test each; auth: RequireAdmin's three.
- providers: GetJSON's not-found and transient answers, one table. Its
  two 401 tests expected the same answer with and without
  TreatAuthAsTransient, which changes only the error's text; the table
  says so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 15:16:20 -05:00
bvandeusenandClaude Opus 5.5 e1f270362d chore(release): everything that ships points at GitHub and GHCR (#7897)
release / go (push) Successful in 2m7s
release / web (push) Successful in 1m25s
release / govulncheck (push) Successful in 21s
release / integration (push) Successful in 4m30s
release / android (push) Successful in 4m39s
release / Build signed APK (push) Successful in 5m10s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 29s
release / Verify release artifacts (tag releases only) (push) Skipped
- Module path: github.com/Fabled-Sword/minstrel, in go.mod, every
  import and the Dockerfile's version ldflags.
- buildinfo.ProjectURL, the contact outside services see in Minstrel's
  User-Agent: https://github.com/Fabled-Sword/minstrel.
- README's compose example pulls ghcr.io/fabled-sword/minstrel:latest.
- docs/security.md sends problem reports to the GitHub issues.
- The demo-library stack builds Minstrel from the checkout, since :dev
  is not published to GHCR.
- hygiene.go's same-site example uses example.com names.

The workbench CI (.gitea/, ci/, export-ignored) still builds and
publishes :dev to the private registry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 19:28:16 -05:00
bvandeusenandClaude Opus 5.5 f3997b657c fix(providers): saving a key for an enabled source tries the gaps again (#8102)
A source that needs a key, such as Last.fm, answers "not found" without
one, and the enricher settles each row it tried that way at the current
version. Switching Last.fm on before entering its key settled every gap
without it, and saving the key didn't move the version, so Last.fm never
came back to them. The sources signature now marks each enabled source
that has a key, so a key arriving or leaving moves the version. Replacing
one key with another still doesn't.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 23:50:29 -05:00
bvandeusenandClaude Opus 5.5 d8abc457e7 fix(providers): Last.fm's rate limit retries art later, and both Last.fm sources share one pace (#8002)
The cover-art Last.fm provider read every JSON error code as "no art",
so a burst of rate-limit (29) or service-unavailable (8, 11, 16)
answers marked albums and artists as having nothing on Last.fm. The tag
provider already retried those. providers.LastfmError is now the one
mapping, used by both.

Each family also paced Last.fm on its own at 4 requests a second, so
together they could reach 8 a second against the 5-per-key limit when
an admin uses one key for both. Both now wait on providers.LastfmPacer.
The client's own spacing is a providers.Interval, so a pace can be
shared.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 13:00:51 -05:00
bvandeusenandClaude Opus 5.5 b901560edf refactor(providers): one paced, retrying HTTP client for cover art and tags (#8002)
coverart/httpclient.go and tags/httpclient.go were the same client:
pacing, exponential backoff with jitter, 401/403-as-transient, body
caps. Tags had added a User-Agent and a shared Pacer, cover art an image
GET. providers.HTTPClient now has all of it, with the tests that were in
coverart. ErrTransient is shared too, so both families' errors.Is still
match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 12:58:55 -05:00
bvandeusenandClaude Opus 5.5 487e11f59f refactor(providers): cover art and tags share one registry and settings service (#8002)
coverart and tags each carried a line-for-line copy of the provider
registry and the settings service: reconcile at boot, seal and reveal
API keys, bump the sources version when the enabled set or the
registered set changes. A fix to either had to be made twice.

internal/providers now holds Registry, Service (over a small Store
interface) and EnabledAs[T]. Each family keeps its own tables, provider
set and capabilities: a 40-line Store adapter over its sqlc queries and
its capability views (EnabledAlbumProviders, EnabledTrackTagProviders).
Provider, ProviderSettings, TestableProvider, ProviderInfo and
ProviderUpdatePatch stay as the families' names for the shared types.
The service has unit tests over an in-memory store.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 12:57:19 -05:00