Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Worker: support @local adaptors #808

Merged
merged 16 commits into from
Oct 29, 2024
Merged

Conversation

josephjclark
Copy link
Collaborator

Short Description

This PR allows the worker to load adaptors with the @local version number, which will be loaded from the monorepo

Fixes #806

This later allows Lightning to be compatible with the monorepo

Implementation Details

Basically what we've done is detected @Local version numbers and given them an explicit path. This works for collections too, if the server's collection version is set to local.

OPENFN_ADAPTORS_REPO must be set in the env for this to be supported

I've had to make some changes here in the runtime and I have a feeling they're ill-advised. I want to check with a fresh brain later.

AI Usage

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

  • Code generation (copilot but not intellisense)
  • Learning or fact checking
  • Strategy / design
  • Optimisation / refactoring
  • Translation / spellchecking / doc gen
  • Other
  • I have not used AI

You can read more details in our Responsible AI Policy

@josephjclark josephjclark changed the base branch from main to release/collections October 28, 2024 17:01
@josephjclark
Copy link
Collaborator Author

TODO: the version readout in the worker says "unknown", not "local"

@josephjclark
Copy link
Collaborator Author

Some of this log out put is really weird

    ▸ @openfn/language-collections=/home/joe/repo/openfn/adaptors/packages/collections    unknown
    ▸ @openfn/language-common                                                             2.1.1
R/T Executing ea6d1457-afed-4c08-897b-a3abfc7b27da
R/T Starting step New job
R/T [linker] loading module @openfn/language-collections=/home/joe/repo/openfn/adaptors/packages/collections
R/T [linker] Loading module @openfn/language-collections=/home/joe/repo/openfn/adaptors/packages/collections from /home/joe/repo/openfn/adaptors/packages/collections/dist/index.cjs
R/T Resolved adaptor @openfn/language-collections=/home/joe/repo/openfn/adaptors/packages/collections to version 0.1.0

@josephjclark josephjclark marked this pull request as ready for review October 29, 2024 18:24
@josephjclark
Copy link
Collaborator Author

Great - I've managed to really simplify this and get a much cleaner solution

@josephjclark josephjclark mentioned this pull request Oct 29, 2024
@josephjclark josephjclark merged commit b1e1070 into release/collections Oct 29, 2024
6 checks passed
@josephjclark josephjclark deleted the local-modules branch October 29, 2024 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Worker: support @local adaptor versions and load them from the monorepo
1 participant