-
Notifications
You must be signed in to change notification settings - Fork 472
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
Add recursive directory watch #488
base: main
Are you sure you want to change the base?
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this looks good from a code perspective 👍
From a product perspective, do you think it would be better not to make recursive
an option and just always watch recursively ? Also taking into account that the instructions said:
Make as few changes to the communication between envd and SDKs as possible
- Removed code runtime version check to prevent issues until further investigation
666b3d4
to
724e857
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The envd version check is missing in Python SDK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some last polishing, I will merge after we merge the envd part
packages/js-sdk/src/sandbox/index.ts
Outdated
apiUrl: this.envdApiUrl, | ||
logger: opts?.logger, | ||
}, | ||
opts?.envdVersion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not like this?
apiUrl: this.envdApiUrl, | |
logger: opts?.logger, | |
}, | |
opts?.envdVersion | |
apiUrl: this.envdApiUrl, | |
logger: opts?.logger, | |
envdVersion: opts?.envdVersion | |
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking it may be different scope than "ConnectionConfig" (maybe in the future part of some Metadata interface?), but If you want, I can move it there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved by wrapping envdVersion to the metadata object
const newContent = 'This file has been modified.' | ||
|
||
await sandbox.files.makeDir(`${dirname}/${nestedDirname}`) | ||
onTestFinished(() => sandbox.files.remove(dirname)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically correct, but not really necessary, the sandbox is killed after the test ends. This will only add one call to sandbox, but you could do this for local testing. Locally the same sandbox is reused
onTestFinished(() => sandbox.files.remove(dirname)) | |
if (isDebug) { | |
onTestFinished(() => sandbox.files.remove(dirname)) | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
const content = 'This file will be watched.' | ||
|
||
await sandbox.files.makeDir(dirname) | ||
onTestFinished(() => sandbox.files.remove(dirname)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Adds recursive directory watch to the SDK and documentation section. Requires merging and deploying e2b-dev/infra#210 first.
Proposed API change:
JS
Python
Notes
Python SDK was generated using buf.build/protocolbuffers/python:v28.3. The runtime check was removed for now. Further tests might be required to make sure the runtime is at least the generated version before including the runtime check.
Changing the following in the file spec/envd/buf-python.gen.yaml (generator) allows using different protoc-gen-python version:
From:
plugin: python
To:
plugin: buf.build/protocolbuffers/python:v28.3