Skip to content

Integrate feeds.maltehuebner.dev for social network management#1350

Open
maltehuebner wants to merge 8 commits intomainfrom
feature/feeds-api-integration
Open

Integrate feeds.maltehuebner.dev for social network management#1350
maltehuebner wants to merge 8 commits intomainfrom
feature/feeds-api-integration

Conversation

@maltehuebner
Copy link
Copy Markdown
Contributor

Summary

  • Feeds API Client: Neuer HTTP-Client (FeedsApiClient) kommuniziert mit feeds.maltehuebner.dev für Profil- und Feed-Item-Verwaltung
  • Profil-Synchronisation: Beim Erstellen/Löschen von Social-Network-Profilen wird automatisch ein entsprechendes Profil in der Feeds-API angelegt bzw. entfernt
  • Feed-Items von API: Alle Feed-Items werden jetzt von der Feeds-API abgerufen (5 Min. Cache) statt aus der lokalen DB
  • Netzwerk-Definitionen von API: Icons, Farben und URL-Pattern kommen aus der Feeds-API (1 Std. Cache), lokale Network-Klassen entfernt
  • Aufgeräumt: SocialNetworkFeedItem Entity, Repository, API-Controller, 25 Network-Klassen, SocialNetworkPass Compiler Pass entfernt
  • Migrations-Command: criticalmass:social-network:migrate-to-feeds registriert bestehende Profile in der Feeds-API

Deployment

  1. Umgebungsvariablen setzen: FEEDS_API_URL, FEEDS_API_TOKEN
  2. DB-Migration: bin/console doctrine:migrations:migrate
  3. Bestehende Profile migrieren: bin/console criticalmass:social-network:migrate-to-feeds

Test plan

  • PHPStan: vendor/bin/phpstan analyse muss fehlerfrei durchlaufen
  • Prüfen, dass Netzwerk-Liste in Profil-Formularen korrekt aus der Feeds-API geladen wird
  • Neues Social-Network-Profil für eine Stadt anlegen und prüfen, dass feedsProfileId gespeichert wird
  • Profil deaktivieren und prüfen, dass es in der Feeds-API gelöscht wird
  • Feed-Items-Seite einer Stadt aufrufen und prüfen, dass Beiträge von der Feeds-API angezeigt werden
  • Timeline prüfen, dass Social-Feed-Items korrekt dargestellt werden
  • Migrations-Command mit --dry-run testen

🤖 Generated with Claude Code

maltehuebner and others added 7 commits March 15, 2026 22:12
Introduce FeedsApiClient with HTTP client for the external Feeds API,
FeedsNetworkManager that replaces the local NetworkManager by loading
networks from the API with caching, FeedItemProvider for cached feed
item retrieval, and DTOs for Network, Profile, and FeedItem.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add feeds_profile_id column to social_network_profile for linking local
profiles to the external Feeds API. Drop the social_network_feed_item
table as feed items are now served by the Feeds API.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When a profile is created (web form or API), it is also registered in
the external Feeds API and the returned ID is stored as feedsProfileId.
When a profile is disabled, the corresponding Feeds API profile is
deleted. Errors are logged but do not block the local operation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace local database queries for feed items with calls to the
external Feeds API via FeedItemProvider (5 min cache). Update
SocialNetworkItemListController, timeline collector, timeline item,
and templates to work with FeedItem DTOs instead of Doctrine entities.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Delete all 25 local network implementation classes as networks are now
loaded from the Feeds API. Remove SocialNetworkFeedItem entity,
repository, and API controller. Remove SocialNetworkPass compiler pass
and its registration in the Kernel. Clean up NetworkManagerInterface
by removing addNetwork() method.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
New command criticalmass:social-network:migrate-to-feeds registers all
enabled local profiles in the Feeds API and stores the returned ID.
Supports --dry-run for preview.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove old network class tests and SocialNetworkFeedItem API tests.
Rewrite AbstractNetworkDetectorTestCase to use Network DTOs with
patterns from the Feeds API. Regenerate PHPStan baseline.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add comprehensive tests for all new classes:
- NetworkTest: NetworkInterface compliance, URL pattern matching, priority
- FeedItemTest: DTO creation, date parsing, nullable fields
- ProfileTest: DTO creation, network data, fetch failure handling
- FeedsApiClientTest: HTTP requests, auth headers, error handling
- FeedsNetworkManagerTest: caching, network lookup, interface compliance
- FeedItemProviderTest: city feed items, timeline items, caching, sorting
- SocialNetworkFeedItemCollectorTest: timeline collector integration

Fix regex delimiter issue in Network::accepts() — convert API patterns
from # delimiter to ~ delimiter to avoid # inside character classes
being misinterpreted. Update detector tests for stricter API patterns.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant