Skip to content

Allow on-the-fly updates to adaptors, schemas, and icons#4473

Open
taylordowns2000 wants to merge 10 commits intomainfrom
christmas-for-devops
Open

Allow on-the-fly updates to adaptors, schemas, and icons#4473
taylordowns2000 wants to merge 10 commits intomainfrom
christmas-for-devops

Conversation

@taylordowns2000
Copy link
Member

@taylordowns2000 taylordowns2000 commented Feb 26, 2026

Description

Enables on-the-fly updates to the adaptor registry, credential schemas, and adaptor icons without requiring an application restart. Superusers can trigger refreshes from a new Settings > Maintenance admin page, and a configurable Oban cron job (ADAPTOR_REFRESH_INTERVAL_HOURS) keeps them in sync automatically across clustered nodes.

Closes #3114
Closes #2209
Closes #325 (wow what a golden oldie!)
Closes #1996

Changes

  • New modules: AdaptorIcons, CredentialSchemas, and AdaptorRefreshWorker — extract runtime refresh logic out of mix tasks into callable modules
  • AdaptorRegistry — refactored GenServer state from a bare list to a map (%{adaptors, cache_path, local_mode}); added refresh/1, refresh_sync/1, and PubSub-based cross-node sync via adaptor:refresh topic
  • MaintenanceLive — new LiveView under Settings with action buttons for each refresh operation, gated to superusers
  • Mix tasks (install_adaptor_icons, install_schemas) — slimmed down to thin wrappers around the new modules
  • Oban cron — AdaptorRefreshWorker runs on a configurable interval; skips in local adaptors mode; broadcasts to peer nodes on success
  • Minor .env.example typo fixes

Validation steps

  1. Clear you adaptor registry and credential schemas
  2. Log in as a superuser
  3. Note that you can't find adaptors
  4. Note that you can't find credential schemas
  5. Go to the admin dashbaord
  6. Go to "Maintenance"
  7. Click the buttons and check that the things come back!

AI Usage

Please disclose whether you've used AI anywhere in this PR (it's cool, we just
want to know!):

  • I have used Claude Code
  • I have used another model
  • I have not used AI

You can read more details in our
Responsible AI Policy

Pre-submission checklist

  • I have performed an AI review of my code (we recommend using /review
    with Claude Code)
  • I have implemented and tested all related authorization policies.
    (e.g., :owner, :admin, :editor, :viewer)
  • I have updated the changelog.
  • I have ticked a box in "AI usage" in this PR

@github-project-automation github-project-automation bot moved this to New Issues in Core Feb 26, 2026
@taylordowns2000 taylordowns2000 marked this pull request as ready for review February 26, 2026 23:35
@codecov
Copy link

codecov bot commented Feb 27, 2026

Codecov Report

❌ Patch coverage is 81.18280% with 35 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.34%. Comparing base (e7c8d51) to head (ec919db).

Files with missing lines Patch % Lines
lib/lightning_web/live/maintenance_live/index.ex 57.50% 17 Missing ⚠️
lib/lightning/adaptor_registry.ex 71.42% 8 Missing ⚠️
lib/lightning/adaptor_refresh_worker.ex 83.33% 4 Missing ⚠️
lib/lightning/config/bootstrap.ex 57.14% 3 Missing ⚠️
lib/lightning/application.ex 80.00% 1 Missing ⚠️
lib/lightning/credential_schemas.ex 97.43% 1 Missing ⚠️
lib/mix/tasks/install_adaptor_icons.ex 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4473      +/-   ##
==========================================
- Coverage   89.47%   89.34%   -0.13%     
==========================================
  Files         425      429       +4     
  Lines       20212    20326     +114     
==========================================
+ Hits        18085    18161      +76     
- Misses       2127     2165      +38     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New Issues

1 participant