Summary
When LOCAL_ADAPTORS=true and OPENFN_ADAPTORS_REPO are set, Lightning loads adaptor code/versions from the local repo, but the credential form loads credential schemas from a completely independent path that does not respect OPENFN_ADAPTORS_REPO. As a result the credential form can render a schema that diverges from the local adaptor.
Observed behaviour
The two paths are independent:
Adaptor code (respects OPENFN_ADAPTORS_REPO):
lib/lightning/config/bootstrap.ex:206-235 reads OPENFN_ADAPTORS_REPO + LOCAL_ADAPTORS into config :lightning, Lightning.AdaptorRegistry, local_adaptors_repo: ...
lib/lightning/adaptor_registry.ex:94 (handle_continue/2) branches on local_adaptors_repo and calls read_adaptors_from_local_repo/1, reading from <repo_path>/packages/<package>.
Credential schemas (does NOT respect it):
lib/lightning_web/live/credential_live/credential_form_component.ex:641 calls Credentials.get_schema/1.
lib/lightning/credentials.ex:577-588 (get_schema/1) reads Application.fetch_env(:lightning, :schemas_path) → <schemas_path>/<schema_name>.json.
schemas_path is configured separately at lib/lightning/config/bootstrap.ex:237-243 from SCHEMAS_PATH (default ./priv, i.e. priv/schemas).
- That directory is populated only by
mix lightning.install_schemas, which downloads configuration-schema.json from the jsdelivr CDN (lib/mix/tasks/install_schemas.ex:102-103) — i.e. the published package versions on NPM.
Nothing in the get_schema/1 path consults Lightning.AdaptorRegistry's local_adaptors_repo.
Impact
With local adaptors enabled, adaptor code/versions come from the local repo, but the credential form's schema still comes from whatever was last installed from the CDN via mix lightning.install_schemas. If a local adaptor's configuration-schema.json differs from the published version, the credential form will not reflect the local schema.
Environment
LOCAL_ADAPTORS=true
OPENFN_ADAPTORS_REPO=<path to local adaptors repo>
Summary
When
LOCAL_ADAPTORS=trueandOPENFN_ADAPTORS_REPOare set, Lightning loads adaptor code/versions from the local repo, but the credential form loads credential schemas from a completely independent path that does not respectOPENFN_ADAPTORS_REPO. As a result the credential form can render a schema that diverges from the local adaptor.Observed behaviour
The two paths are independent:
Adaptor code (respects
OPENFN_ADAPTORS_REPO):lib/lightning/config/bootstrap.ex:206-235readsOPENFN_ADAPTORS_REPO+LOCAL_ADAPTORSintoconfig :lightning, Lightning.AdaptorRegistry, local_adaptors_repo: ...lib/lightning/adaptor_registry.ex:94(handle_continue/2) branches onlocal_adaptors_repoand callsread_adaptors_from_local_repo/1, reading from<repo_path>/packages/<package>.Credential schemas (does NOT respect it):
lib/lightning_web/live/credential_live/credential_form_component.ex:641callsCredentials.get_schema/1.lib/lightning/credentials.ex:577-588(get_schema/1) readsApplication.fetch_env(:lightning, :schemas_path)→<schemas_path>/<schema_name>.json.schemas_pathis configured separately atlib/lightning/config/bootstrap.ex:237-243fromSCHEMAS_PATH(default./priv, i.e.priv/schemas).mix lightning.install_schemas, which downloadsconfiguration-schema.jsonfrom the jsdelivr CDN (lib/mix/tasks/install_schemas.ex:102-103) — i.e. the published package versions on NPM.Nothing in the
get_schema/1path consultsLightning.AdaptorRegistry'slocal_adaptors_repo.Impact
With local adaptors enabled, adaptor code/versions come from the local repo, but the credential form's schema still comes from whatever was last installed from the CDN via
mix lightning.install_schemas. If a local adaptor'sconfiguration-schema.jsondiffers from the published version, the credential form will not reflect the local schema.Environment
LOCAL_ADAPTORS=trueOPENFN_ADAPTORS_REPO=<path to local adaptors repo>