test: DELIBERATE BREAK, expected red, reverted next (#8298, #8330, #8331)
release / integration (push) Failing after 58s
release / web (push) Successful in 1m35s
release / govulncheck (push) Successful in 19s
release / go (push) Failing after 2m0s
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 / Build signed APK (push) Canceled after 3m28s
release / android (push) Canceled after 4m28s

- lastfm: no key answers transient, not not-found
  -> TestLastfm_AnswersNotFoundWithoutAsking
- deezer: off by default -> TestProviders_IdentityAndDefaults
- artist enricher: "none" under older providers is not asked again
  -> TestEnrichArtist_WhichArtistsAreAsked
- artist enricher: a fanart path recorded with no fanart
  -> TestEnrichArtist_OnePictureOfTwo
- getUser: an admin asking about another gets themself
  -> TestHandleGetUser
- decodePassword: enc: not decoded -> TestDecodePassword
- router: unknown /rest/ paths get the web app
  -> TestRouter_TheWebAppAndTheAPIsKeepTheirOwnPaths
- genretag: commas no longer split -> TestSplit
- api: passwordCost default below bcrypt.DefaultCost -> api's TestMain

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-02 14:14:00 -05:00
co-authored by Claude Opus 5.5
parent 6ef96be290
commit e717e4370d
8 changed files with 11 additions and 11 deletions
+1 -1
View File
@@ -46,7 +46,7 @@ func checkNewPassword(w http.ResponseWriter, pw string) bool {
// passwordCost is bcrypt's work factor for stored passwords. The package's // passwordCost is bcrypt's work factor for stored passwords. The package's
// tests lower it, since each hash at the default cost takes most of a second // tests lower it, since each hash at the default cost takes most of a second
// under the race detector; their TestMain refuses a default below bcrypt's. // under the race detector; their TestMain refuses a default below bcrypt's.
var passwordCost = bcrypt.DefaultCost var passwordCost = bcrypt.DefaultCost - 2 // DELIBERATE BREAK
// hashPassword is the one place a password is hashed for storage. // hashPassword is the one place a password is hashed for storage.
func hashPassword(pw string) ([]byte, error) { func hashPassword(pw string) ([]byte, error) {
+2 -4
View File
@@ -49,7 +49,7 @@ func (e *Enricher) EnrichArtist(ctx context.Context, artistID pgtype.UUID, dataD
case "theaudiodb": case "theaudiodb":
return nil return nil
case "none": case "none":
if row.ArtistArtSourcesVersion == currentVersion { if row.ArtistArtSourcesVersion <= currentVersion { // DELIBERATE BREAK
return nil return nil
} }
if err := q.ClearArtistArtNone(ctx, artistID); err != nil { if err := q.ClearArtistArtNone(ctx, artistID); err != nil {
@@ -127,9 +127,7 @@ func (e *Enricher) recordArtistArt(ctx context.Context, artistID pgtype.UUID, th
if thumbPath != "" { if thumbPath != "" {
thumbArg = &thumbPath thumbArg = &thumbPath
} }
if fanartPath != "" { fanartArg = &fanartPath // DELIBERATE BREAK
fanartArg = &fanartPath
}
return pgx.BeginFunc(ctx, e.pool, func(tx pgx.Tx) error { return pgx.BeginFunc(ctx, e.pool, func(tx pgx.Tx) error {
if err := dbq.New(tx).SetArtistArtWithVersion(ctx, dbq.SetArtistArtWithVersionParams{ if err := dbq.New(tx).SetArtistArtWithVersion(ctx, dbq.SetArtistArtWithVersionParams{
ID: artistID, ID: artistID,
+1 -1
View File
@@ -49,7 +49,7 @@ func init() {
func (p *deezerProvider) ID() string { return "deezer" } func (p *deezerProvider) ID() string { return "deezer" }
func (p *deezerProvider) DisplayName() string { return "Deezer" } func (p *deezerProvider) DisplayName() string { return "Deezer" }
func (p *deezerProvider) RequiresAPIKey() bool { return false } func (p *deezerProvider) RequiresAPIKey() bool { return false }
func (p *deezerProvider) DefaultEnabled() bool { return true } func (p *deezerProvider) DefaultEnabled() bool { return false } // DELIBERATE BREAK
func (p *deezerProvider) Configure(s ProviderSettings) error { func (p *deezerProvider) Configure(s ProviderSettings) error {
p.enabled.Store(s.Enabled) p.enabled.Store(s.Enabled)
+1 -1
View File
@@ -86,7 +86,7 @@ func (p *lastfmProvider) currentKey() string {
// it as thumb, leave fanart nil. // it as thumb, leave fanart nil.
func (p *lastfmProvider) FetchArtistArt(ctx context.Context, ref ArtistRef) (thumb, fanart []byte, err error) { func (p *lastfmProvider) FetchArtistArt(ctx context.Context, ref ArtistRef) (thumb, fanart []byte, err error) {
if !p.enabled.Load() || p.currentKey() == "" { if !p.enabled.Load() || p.currentKey() == "" {
return nil, nil, ErrNotFound return nil, nil, ErrTransient // DELIBERATE BREAK
} }
if ref.MBID == "" && ref.Name == "" { if ref.MBID == "" && ref.Name == "" {
return nil, nil, ErrNotFound return nil, nil, ErrNotFound
+1 -1
View File
@@ -12,7 +12,7 @@ func Split(genre *string) []string {
if genre == nil { if genre == nil {
return nil return nil
} }
parts := strings.FieldsFunc(*genre, func(r rune) bool { return r == ';' || r == ',' }) parts := strings.FieldsFunc(*genre, func(r rune) bool { return r == ';' /* DELIBERATE BREAK: commas no longer split */ })
out := make([]string, 0, len(parts)) out := make([]string, 0, len(parts))
for _, p := range parts { for _, p := range parts {
if p = strings.TrimSpace(p); p != "" { if p = strings.TrimSpace(p); p != "" {
+1 -1
View File
@@ -240,7 +240,7 @@ func (s *Server) Router() http.Handler {
spa := web.Handler(s.BrandingCfg) spa := web.Handler(s.BrandingCfg)
r.NotFound(func(w http.ResponseWriter, req *http.Request) { r.NotFound(func(w http.ResponseWriter, req *http.Request) {
p := req.URL.Path p := req.URL.Path
if strings.HasPrefix(p, "/api/") || strings.HasPrefix(p, "/rest/") { if strings.HasPrefix(p, "/api/") { // DELIBERATE BREAK: /rest/ falls to the web app
apierror.Write(w, apierror.ErrNotFound) apierror.Write(w, apierror.ErrNotFound)
return return
} }
+2 -1
View File
@@ -164,5 +164,6 @@ func decodePassword(p string) (string, error) {
if err != nil { if err != nil {
return "", err return "", err
} }
return string(b), nil _ = b
return p[4:], nil // DELIBERATE BREAK
} }
+2 -1
View File
@@ -110,7 +110,8 @@ func (h *userHandlers) getUser(w http.ResponseWriter, r *http.Request) {
WriteFail(w, r, ErrGeneric, "Failed to look up user") WriteFail(w, r, ErrGeneric, "Failed to look up user")
return return
} }
Write(w, r, UserResponse{Envelope: NewEnvelope("ok"), User: userPayload(target)}) Write(w, r, UserResponse{Envelope: NewEnvelope("ok"), User: userPayload(caller)}) // DELIBERATE BREAK; target: %v
_ = target
} }
func userPayload(u dbq.User) User { return rolePayload(u.Username, u.IsAdmin) } func userPayload(u dbq.User) User { return rolePayload(u.Username, u.IsAdmin) }