worker: collections adaptor isn't loaded if `collections.get` isn't on one line
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 21
- Forks
- 23
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 17
Description
When the worker loads a Run, it has to decide whether to load the collections adaptor into it.
The test for this is terrible (my fault):
if (job.expression?.match(/(collections\.)/)) {
hasCollections = true;
}
I did this because I didn't want to do AST parsing just to see if the collections variable is being used. But this is clearly way too brittle
Options:
- Always load the collections adaptor (does look weird in the run log)
- Always load the collections adaptor if the word
collectionsappears anywhere (slightly permissive than we have now) - Write a better regex (look for whole word collections but not in a comment or string)
- Use the compiler to preparse and find a "dangling global"
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the worker's Run-loading behavior with a multiline use of collections.get, then inspect how the current collections. match decides whether to load the adaptor. Done means an agreed approach reliably detects the intended usage without the current formatting limitation, with coverage for the reported case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100