OpenFn / OpenFn/lightning

Credentials.get_schema/1 does not respect OPENFN_ADAPTORS_REPO when LOCAL_ADAPTORS=true

Open
#4,885 3 comments 0 reactions 1 assignee View on GitHub

@stuartc is already working on this.

Since Aug 24, 2026.

Dominant language
Elixir
Stars
296
Forks
86
Avg merge
1d 13h
Merged PRs (30d)
50

Description

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>

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.