Skip to content

feat(import): add OptiSigns (GraphQL) provider to the import framework - #3146

Merged
vpetersson merged 2 commits into
masterfrom
feat/import-content-optisign
Jul 8, 2026
Merged

feat(import): add OptiSigns (GraphQL) provider to the import framework#3146
vpetersson merged 2 commits into
masterfrom
feat/import-content-optisign

Conversation

@vpetersson

Copy link
Copy Markdown
Contributor

Issues Fixed

Stacked on #3145 (ScreenCloud). Third provider in the import series.

Base branch: feat/import-content-screencloud — review after #3144 and #3145. Retarget to master as the stack merges.

Description

  • OptiSigns provider (GraphQL, graphql-gateway.optisigns.com): validates an API key (Bearer), pages the single assets connection, and imports via the same ImportProvider interface, wizard, and CLI. No per-type or single-item query exists, so a lookup is a filtered assets(query: {_id: …}).
  • Content classification + non-portable filter (as requested): image/video from fileType; a genuine external webLink → web page. Apps/widgets (appType), YouTube (youtubeType), and OptiSigns-hosted internal links are skipped-with-reason.
  • Reuses the shared ingest/http layer — download auth stays off the CDN original, list-level GraphQL errors surface as controlled 502s, extensions are sanitised.
  • Unit tests (GraphQL mocked; no network).

Follow-ups (isolated, flagged in optisigns.py): the exact downloadable original-file field (path/video_1080p — may be CDN-relative), the QueryAssetInput._id filter shape, and the fileType/appType vocabularies are undocumented — to confirm against a live OptiSigns account; unresolved originals are skipped rather than guessed.

Checklist

  • I have performed a self-review of my own code.
  • New and existing unit tests pass locally and on CI with my changes.
  • I have done an end-to-end test for Raspberry Pi devices.
  • I have tested my changes for x86 devices.
  • I added a documentation for the changes I have made (when necessary).

🤖 Generated with Claude Code

@vpetersson
vpetersson requested a review from a team as a code owner July 8, 2026 07:17
@vpetersson vpetersson self-assigned this Jul 8, 2026
@vpetersson
vpetersson requested a review from Copilot July 8, 2026 07:17

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds the OptiSigns (GraphQL) provider to Anthias’ import-provider framework, enabling content migration (images/videos/webpages) from OptiSigns accounts via the existing import wizard/API/CLI flow.

Changes:

  • Registers a new optisigns import provider in the integrations registry.
  • Implements OptiSignsProvider (GraphQL paging, classification, idempotent ingest via shared ingest/http layer).
  • Adds unit tests with mocked GraphQL + download behavior (no network).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/anthias_server/lib/integrations/registry.py Registers OptiSignsProvider so it is discoverable by API/UI/CLI.
src/anthias_server/lib/integrations/optisigns.py Implements OptiSigns GraphQL listing + per-item import using shared ingest logic.
src/anthias_server/api/tests/test_optisigns_import.py Adds mocked unit tests for token validation, classification, listing, and import behaviors.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/anthias_server/lib/integrations/optisigns.py Outdated
Comment thread src/anthias_server/lib/integrations/optisigns.py Outdated
Comment thread src/anthias_server/lib/integrations/optisigns.py Outdated
@vpetersson
vpetersson force-pushed the feat/import-content-screencloud branch 2 times, most recently from c63fdcc to b8f83fd Compare July 8, 2026 08:32
- add an OptiSigns provider over the shared ImportProvider interface,
  reusing the ingest/http layer, wizard, and CLI
- one `assets` connection (no per-type/single-item query): classify by
  fileType (image/video) or a genuine external webLink (web pages)
- filter non-portable content: skip apps/widgets, YouTube, and
  OptiSigns-hosted internal links; only import real downloadable
  files and external URLs
- no auth on the CDN download; list errors surface as controlled 502s
- unit tests (GraphQL mocked; no network)

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@vpetersson
vpetersson changed the base branch from feat/import-content-screencloud to master July 8, 2026 08:38
- extract the GraphQL bearer/post/errors boilerplate into graphql.py and
  a shared duration helper into ingest, used by both GraphQL providers
  (removes the duplication Sonar flagged) plus shared test fakes
- OptiSigns: drop the unused logger, compare on hostname (not netloc, which
  includes the port), and coerce the asset name to str before stripping

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@vpetersson
vpetersson force-pushed the feat/import-content-optisign branch from 4d912c5 to b99c866 Compare July 8, 2026 08:38
@sonarqubecloud

sonarqubecloud Bot commented Jul 8, 2026

Copy link
Copy Markdown

@vpetersson
vpetersson merged commit 5363073 into master Jul 8, 2026
9 checks passed
@vpetersson
vpetersson deleted the feat/import-content-optisign branch July 8, 2026 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants