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

Switch from Deno.run to Deno.Command #50

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

shapirone
Copy link
Collaborator

Summary

With 1.33 came the deprecation of Deno.run, so we need to switch to using Deno.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 get output or outputSync 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 the sdk-slack-dev-domain arg at the end

  "start": "deno run --config=deno.jsonc --allow-read --allow-net --allow-run <your-path-here> --protocol=message-boundaries --boundary=jkadfssajdflkjasdfjhdas"

Requirements (place an x in each [ ])

@shapirone shapirone requested a review from a team as a code owner May 5, 2023 01:59
@shapirone shapirone changed the title Switch from Deno.run to Deno.command Switch from Deno.run to Deno.Command May 5, 2023
@codecov
Copy link

codecov bot commented May 5, 2023

Codecov Report

Merging #50 (f26bee9) into main (5f5fe4e) will not change coverage.
The diff coverage is 100.00%.

@@           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           
Impacted Files Coverage Δ
src/local-run.ts 89.18% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Comment on lines +131 to +132
const subprocess = commander.spawn();
const status = await subprocess.status;
Copy link
Collaborator Author

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()

Copy link
Contributor

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!

Copy link
Contributor

@filmaj filmaj left a 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.

Comment on lines +131 to +132
const subprocess = commander.spawn();
const status = await subprocess.status;
Copy link
Contributor

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants