-
Notifications
You must be signed in to change notification settings - Fork 6
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
Switch from Deno.run to Deno.Command #50
base: main
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## main #50 +/- ##
=======================================
Coverage 90.31% 90.31%
=======================================
Files 14 14
Lines 568 568
Branches 110 110
=======================================
Hits 513 513
Misses 54 54
Partials 1 1
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
const subprocess = commander.spawn(); | ||
const status = await subprocess.status; |
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.
One thing we should test around this is whether or not this leaves the process open or if we should close via something like subprocess.kill()
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.
Generally, once the status code from a process is able to be retrieved, this implies that the process completed, so my expectation is that we don't need to do that - but doesn't hurt!
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.
These changes look good to me overall but I am most concerned with how to roll this change out and how we coordinate / publicize / document the minimum deno version we support as well as how other hooks factor into this. So to be specific:
- Clearly document a minimum deno version on our docs somewhere. Likely in an initial Requirements page or some such.
- Adding a
doctor
hook for deno-slack-hooks to implement that can check the deno version, and make sure that is reported/raised properly by the CLI (HERMES-4989) - The ROSI team is on board with publishing the deno version used in ROSI in e.g. our
metadata.json
API endpoint. All of the above, IMO, should consume from that endpoint to dynamically be able to check/publicize the recommended deno version to use.
const subprocess = commander.spawn(); | ||
const status = await subprocess.status; |
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.
Generally, once the status code from a process is able to be retrieved, this implies that the process completed, so my expectation is that we don't need to do that - but doesn't hurt!
Summary
With 1.33 came the deprecation of
Deno.run
, so we need to switch to usingDeno.Command
. This was stabilized as part of the 1.31 release, so we might want to wait a bit to allow folks time to upgrade their local version of Deno.I was only able to get this to work through the
spawn
method to create a child process, I was not able to getoutput
oroutputSync
methods to work.Testing
Check out this repo and update your
start
hook to point to your local repo. If testing against a dev Slack instance, make sure to add thesdk-slack-dev-domain
arg at the endRequirements (place an
x
in each[ ]
)