feat: support restify v9-v11#1489
Conversation
|
Warning: This pull request is touching the following templated files:
|
|
@6utt3rfly, thanks for the contribution. Please take a look at the test failures. For example, Could you confirm whether you've tested this change locally, and with what versions? |
Restify 9 added async/await support, but it requires that middleware either be `async (req, res)` or `(req, res, next)`, but not both: `async (req, res, next)`. The restify test now avoids async/await and directly uses Promises to maintain backward compatibility with earlier versions of restify
|
@punya - I had trouble running local unit tests until I saw this PR's build log and realized I needed docker images running (or TRACE_TEST_EXCLUDE_INTEGRATION set). It might be worth adding something to the CONTRIBUTING.md file? The existing restify plugin works if I manually patch the SUPPORTED_VERSIONS. I've pushed a commit to fix the failing unit test by avoiding |
punya
left a comment
There was a problem hiding this comment.
Thanks for looking into it @6utt3rfly! I have a couple of small suggestions, but otherwise this looks good to me.
Co-authored-by: Punya Biswal <punya@google.com>
Co-authored-by: Punya Biswal <punya@google.com>
I actually hadn't noticed |
|
I see some lint failures that should be easy to fix: But there are also several failing tests (starting at https://github.com/googleapis/cloud-trace-nodejs/actions/runs/4694210640/jobs/8322181339?pr=1489#step:7:2986) that I don't understand. Reading the Restify docs in some more detail, I'm not sure that we're supposed to use 3-argument handlers with Promises (regardless of whether we use I wonder if it might be necessary to have totally different code paths for Restify <= v8 and Restify >= v9. |
Unit tests with restify 9-11 on node 12 reports, "Cannot find node module 'node:process'", which indicates a node compatibility issue
🤖 I have created a release *beep* *boop* --- ## [8.0.0](https://togithub.com/googleapis/cloud-trace-nodejs/compare/v7.1.2...v8.0.0) (2024-02-07) ### ⚠ BREAKING CHANGES * upgrade to Node 14 ([#1517](https://togithub.com/googleapis/cloud-trace-nodejs/issues/1517)) ### Features * Support restify v9-v11 ([#1489](https://togithub.com/googleapis/cloud-trace-nodejs/issues/1489)) ([746f30c](https://togithub.com/googleapis/cloud-trace-nodejs/commit/746f30c084f8e2c9eb9dbaebb017ed3cc30304ca)) ### Bug Fixes * Assert oldMethod existence, and pin typescript version ([#1549](https://togithub.com/googleapis/cloud-trace-nodejs/issues/1549)) ([66a39fa](https://togithub.com/googleapis/cloud-trace-nodejs/commit/66a39fac603dbd0ab40afa5266236850124cd21b)) * **deps:** Update dependency require-in-the-middle to v6 ([#1483](https://togithub.com/googleapis/cloud-trace-nodejs/issues/1483)) ([ddd4bbb](https://togithub.com/googleapis/cloud-trace-nodejs/commit/ddd4bbb765aaa698ace8ec35ae79331f930a6709)) * **deps:** Update dependency require-in-the-middle to v7 ([#1494](https://togithub.com/googleapis/cloud-trace-nodejs/issues/1494)) ([58e7821](https://togithub.com/googleapis/cloud-trace-nodejs/commit/58e7821ce4abcba934431b9623bfef28c17da959)) * Skip flaky test ([#1495](https://togithub.com/googleapis/cloud-trace-nodejs/issues/1495)) ([bb03060](https://togithub.com/googleapis/cloud-trace-nodejs/commit/bb03060c6cf6e9d80982dda9dbb62aa3704daedf)), closes [#1334](https://togithub.com/googleapis/cloud-trace-nodejs/issues/1334) ### Miscellaneous Chores * Upgrade to Node 14 ([#1517](https://togithub.com/googleapis/cloud-trace-nodejs/issues/1517)) ([8b6c967](https://togithub.com/googleapis/cloud-trace-nodejs/commit/8b6c967a73eb3ce16b1a4471249f4266db32e478)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).



Fixes #1488
(see also #1250 for reference)