-
Notifications
You must be signed in to change notification settings - Fork 45
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
Use local adaptors in a local Lightning instance #905
Comments
Here is a design for this: When Lightning populates the adaptor list, it should do some from two possible sources: npm or the monorepo. If Lightning detects the Any adaptor version found in the monorepo should be displayed at the TOP of the picklist for new adaptors, with version set to The monorepo source needs to be populated by looking in the In order to support this, the Worker will need to have special handling for the |
@stuartc I have (almost) implemented support for local/monorepo adaptors in the worker in #808 tl;dr: if lightning sets the adaptor version to This has been useful for collections so I just ploughed on with it Edit: that's merged. So all we need to do is update the picklist with an |
|
Hey, I've been thinking about a different (cheaper) design for this Maybe we can start the worker in a mode that ONLY uses the monorepo to load adaptors. Driven by an env var maybe. So if you do:
Lightning will start the worker with a flag that forces all adaptors to be local. The advantage is that the dev effort is much less. No need to faff around with this Counter-argument to that: if you're running with the monorepo you have to remember to keep your local build up to date. It's very easy to forget to build and run an old version of an adaptor by accident. That's why I like the @Local approach - it's more faff (for us and for users) but it's very explicit. The disadvantage is that Lightning is lying to users. The workflow will say like "this step uses http 6.0", but actually the runtime log will say "I'm using whatever is in your monorepo". That's kind of confusing and maybe a bit tricky. And compounded by the problem of forgetting to rebuild. Suddenly it's not actually clear what version of the adaptor you're even running. I suppose we could do something like: if the LOCAL_ADAPTORS env var is set, we don't show a version picklist in the UI. That's a bit more honest. Maybe the question is: for a developer using lightning to test adaptors, do I want to set an individual job to use a local adaptor, or do I just want to always use local adaptors? |
Hmm @josephjclark I actually think the
|
I had a random moment of clarity on this late last night! As a user, I am pretty sure that I want local adaptors to be a global setting. Run ALL my adaptors from the monorepo, or run NONE of them. It's not worth the effort to keep switching individual jobs to the @Local version. Also remember that if I set my local step to use @Local, at some point presumably I have to set it back again. The CLI works the same way: I run the CLI in "local monorepo mode", which makes ALL adaptors in my workflow load from the monorepo. I think it should be exactly the same in Lightning. Yes, that does mean that when you run in this mode you need to remember to build your monorepo. But you also have to explicitly put Lightning in this mode with a startup flag - I think it's quite reasonable. So I strongly suggest the design is:
|
Random thought on this! We need to bump the local worker version included in assets/package.json. Aside from some other fixes, we'll probably need to include a worker patch with local support. So this is just a reminder to bump the version. |
Hey @josephjclark FYI, I have opted to send in the adaptor with
|
I think you're right to use npm OR local adaptors, not both. What adaptors exist that aren't in the local monorepo? I'm probably happy to accept in error in these rare cases. Good point on docs - but it's probably OK to ignore them for now. This is a very dev facing feature. We want local adaptors to test new APIs and bugfixes, not to browse the docs. This doesn't need to be bulletproof or user friendly. It's for Mutchi and Hunter to test adaptor fixes in context. It's OK for it to be rough (especially right now) |
User story
As a user that has built a new adaptor locally, I would like to spin up Lightning and use that adaptor, so that I can see it in action and properly test it.
Details
Implementation notes
Release notes
User acceptance criteria
The text was updated successfully, but these errors were encountered: