feat: implement Live/Remix filtering and add CI/CD pipeline
Some checks failed
Build and Push Docker Image / build (pull_request) Failing after 38s

This commit includes:

1. Live/Remix Filtering Feature:
   - Added ignore_live and ignore_remix columns to artist_settings table (migration 010)
   - Updated ArtistSettings struct with IgnoreLive and IgnoreRemix fields
   - Modified SaveArtistSettings and UpdateArtistSettings to handle new fields
   - Extended FilterOptions struct with IgnoreLive and IgnoreRemix
   - Updated ApplyTypeToggles and ApplyTypeTogglesToReleaseGroups to filter Live/Remix types
   - Added toggleIgnoreLive and toggleIgnoreRemix handlers in web layer
   - Updated ArtistData view model and artist.html template with new toggle UI
   - Comprehensive test coverage for all new functionality

2. CI/CD Pipeline with Gitea Actions:
   - Added .gitea/workflows/docker-build.yml for automated Docker builds
   - Workflow triggers on pushes to main/master and tags, plus PRs
   - Runs Go tests before building
   - Builds and pushes multi-architecture Docker images to gitea.mrixs.me
   - Includes caching for faster subsequent builds
   - Proper tagging strategy (branch, semver, SHA)
   - CI-CD-GUIDE.md documentation

3. Cleanup:
   - Removed temporary build artifacts and coverage files
This commit is contained in:
2026-08-05 22:55:40 +03:00
parent ca8d503c50
commit e73b17673e
14 changed files with 237 additions and 100 deletions

View File

@@ -7,7 +7,7 @@ import (
"naviwatcher/internal/musicbrainz"
)
func TestTypeFilterSuppressedMatchesMusicbrainzFilter(t *testing.T) {
func TestFilterIsSuppressedMatchesMusicbrainzFilter(t *testing.T) {
// Test cases covering various combinations of types and secondary types
testCases := []struct {
name string
@@ -66,11 +66,11 @@ func TestTypeFilterSuppressedMatchesMusicbrainzFilter(t *testing.T) {
}
// Test scanner filter
scannerFilter := TypeFilter{
scannerFilter := musicbrainz.FilterOptions{
IgnoreSingles: tc.ignoreSingles,
IgnoreCompilations: tc.ignoreCompilations,
}
scannerSuppressed := scannerFilter.suppressed(release)
scannerSuppressed := FilterIsSuppressed(scannerFilter, release)
// Test musicbrainz filter
mbFilter := musicbrainz.FilterOptions{
@@ -86,7 +86,7 @@ func TestTypeFilterSuppressedMatchesMusicbrainzFilter(t *testing.T) {
tc, scannerSuppressed, mbSuppressed)
}
// Check against expected value
// Check against expected value
if scannerSuppressed != tc.expectedSuppressed {
t.Errorf("Scanner filter returned %v, expected %v for case %v",
scannerSuppressed, tc.expectedSuppressed, tc.name)
@@ -96,7 +96,7 @@ func TestTypeFilterSuppressedMatchesMusicbrainzFilter(t *testing.T) {
}
// Test that verifies the specific case mentioned in the issue: EP in SecondaryTypes counts as Single
func TestTypeFilterTreatsEPAsSingleWhenIgnoreSingles(t *testing.T) {
func TestFilterIsSuppressedTreatsEPAsSingleWhenIgnoreSingles(t *testing.T) {
testCases := []struct {
name string
releaseType string
@@ -121,11 +121,11 @@ func TestTypeFilterTreatsEPAsSingleWhenIgnoreSingles(t *testing.T) {
}
// Test scanner filter
scannerFilter := TypeFilter{
scannerFilter := musicbrainz.FilterOptions{
IgnoreSingles: tc.ignoreSingles,
IgnoreCompilations: tc.ignoreCompilations,
}
scannerSuppressed := scannerFilter.suppressed(release)
scannerSuppressed := FilterIsSuppressed(scannerFilter, release)
// Test musicbrainz filter
mbFilter := musicbrainz.FilterOptions{
@@ -147,4 +147,4 @@ func TestTypeFilterTreatsEPAsSingleWhenIgnoreSingles(t *testing.T) {
}
})
}
}
}