diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 32b7d27..9fa7cb3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,3 +22,7 @@ jobs: run: cargo clippy --all -- -D warnings - name: Run fmt run: cargo fmt --all -- --check + - name: Install license tool + run: cargo install dd-rust-license-tool + - name: Run license tool + run: dd-rust-license-tool check diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..57d1df5 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,53 @@ + +# Welcome + +Welcome! We are glad you are interested in contributing to Orchestrion-JS. This guide will help you understand the requirements and guidelines to improve your contributor experience. + +## Contributing to code + +### New features + +If you want to contribute with a new feature, before start writing any code, you will need to get your proposal accepted by the maintainers. This is to avoid going through the effort of writing the code and getting it rejected because it is already being worked on in a different way, or it is outside the scope of the project. + +Open a new issue with the title "[RFC] Title of your proposal". In the description explain carefully why you think this feature is needed, why it is useful, and how you plan to implement it. + +The maintainers will label the issue as `type/feature` or `type/major_change` and `rfc/discussion` and will start a conversation with you to discuss it. If the proposal gets accepted it will be tagged as `rfc/approved`. Feel free to start coding at that point and propose a PR, linking it to the issue. + +During the RFC process, your change proposal, alongside with implementation approaches, will get discussed with the maintainers, ensuring that you don’t waste time with wrong approaches or features that are out of scope for the project. + +If, after the discussion, the proposal gets rejected, the team will give you an explanation, label the issue as `rfc/rejected` and close the issue. + +### Bug fixes + +If you have identified an issue that is already labeled as `type/bug` that hasn’t been assigned to anyone, feel free to claim it, and ask a maintainer to add you as assignee. +Once you have some code ready, open a PR, [linking it to the issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#manually-linking-a-pull-request-to-an-issue-using-the-pull-request-sidebar). Take into account that if the changes to fix the bug are not trivial, you need to follow the RFC process as well to discuss the options with the maintainers. + +### Setting up your development environment + +```bash +$ git clone git@github.com:DataDog/orchestrion-js.git +$ cd orchestrion-js +$ rustup install stable +$ cargo check # or `cargo test`, etc. +``` + +### Testing your changes + +```bash +cargo test +``` + +## Contributing to issues + +### Contributing to reporting bugs + +If you think you have found a bug in Orchestrion-JS feel free to report it. When creating issues, you will be presented with a template to fill. Please, fill as much as you can from that template, including steps to reproduce your issue, so we can address it quicker. + +### Contributing to triaging issues + +Triaging issues is a great way to contribute to an open source project. Some actions you can perform on an open by someone else issue that will help addressing it sooner: + +- Trying to reproduce the issue. If you can reproduce the issue following the steps the reporter provided, add a comment specifying that you could reproduce the issue. +- Finding duplicates. If there is a bug, there might be a chance that it was already reported in a different issue. If you find an already reported issue that is the same one as the one you are triaging, add a comment with "Duplicate of" followed by the issue number of the original one. +- Asking the reporter for more information if needed. Sometimes the reporter of an issue doesn’t include enough information to work on the fix, i.e. lack of steps to reproduce, not specifying the affected version, etc. If you find a bug that doesn’t have enough information, add a comment tagging the reporter asking for the missing information. + diff --git a/Cargo.toml b/Cargo.toml index 1bdb15f..f203e86 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,6 +3,7 @@ name = "orchestrion-js" version = "0.1.0" edition = "2021" rust-version = "1.84.1" +license = "Apache-2.0" [lib] # crate-type = ["cdylib"] diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..eaa52b8 --- /dev/null +++ b/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2025-present Datadog, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/LICENSE-3rdparty.csv b/LICENSE-3rdparty.csv new file mode 100644 index 0000000..8ba88c1 --- /dev/null +++ b/LICENSE-3rdparty.csv @@ -0,0 +1,219 @@ +Component,Origin,License,Copyright +Inflector,https://github.com/whatisinternet/inflector,BSD-2-Clause,Josh Teeter +ahash,https://github.com/tkaitchuck/ahash,MIT OR Apache-2.0,Tom Kaitchuck +aho-corasick,https://github.com/BurntSushi/aho-corasick,Unlicense OR MIT,Andrew Gallant +allocator-api2,https://github.com/zakarumych/allocator-api2,MIT OR Apache-2.0,Zakarum +android-tzdata,https://github.com/RumovZ/android-tzdata,MIT OR Apache-2.0,RumovZ +android_system_properties,https://github.com/nical/android_system_properties,MIT OR Apache-2.0,Nicolas Silva +ansi_term,https://github.com/ogham/rust-ansi-term,MIT,"ogham@bsago.me, Ryan Scheel (Havvy) , Josh Triplett " +anyhow,https://github.com/dtolnay/anyhow,MIT OR Apache-2.0,David Tolnay +arraydeque,https://github.com/andylokandy/arraydeque,MIT OR Apache-2.0,andylokandy +arrayvec,https://github.com/bluss/arrayvec,MIT OR Apache-2.0,bluss +ascii,https://github.com/tomprogrammer/rust-ascii,Apache-2.0 OR MIT,"Thomas Bahn , Torbjørn Birch Moltu , Simon Sapin " +auto_impl,https://github.com/auto-impl-rs/auto_impl,MIT OR Apache-2.0,"Ashley Mannix , Lukas Kalbertodt " +base64,https://github.com/marshallpierce/rust-base64,MIT OR Apache-2.0,"Alice Maz , Marshall Pierce " +base64-simd,https://github.com/Nugine/simd,MIT,The base64-simd Authors +bitflags,https://github.com/bitflags/bitflags,MIT OR Apache-2.0,The Rust Project Developers +bitvec,https://github.com/bitvecto-rs/bitvec,MIT,The bitvec Authors +block-buffer,https://github.com/RustCrypto/utils,MIT OR Apache-2.0,RustCrypto Developers +browserslist-rs,https://github.com/browserslist/browserslist-rs,MIT,Pig Fang +bumpalo,https://github.com/fitzgen/bumpalo,MIT OR Apache-2.0,Nick Fitzgerald +bytecheck,https://github.com/rkyv/bytecheck,MIT,David Koloski +bytecount,https://github.com/llogiq/bytecount,Apache-2.0 OR MIT,"Andre Bogus , Joshua Landau " +bytes,https://github.com/tokio-rs/bytes,MIT,"Carl Lerche , Sean McArthur " +camino,https://github.com/camino-rs/camino,MIT OR Apache-2.0,"Without Boats , Ashley Williams , Steve Klabnik , Rain " +cargo-platform,https://github.com/rust-lang/cargo,MIT OR Apache-2.0,The cargo-platform Authors +cargo_metadata,https://github.com/oli-obk/cargo_metadata,MIT,Oliver Schneider +castaway,https://github.com/sagebind/castaway,MIT,Stephen M. Coakley +cfg-if,https://github.com/alexcrichton/cfg-if,MIT OR Apache-2.0,Alex Crichton +chrono,https://github.com/chronotope/chrono,MIT OR Apache-2.0,The chrono Authors +compact_str,https://github.com/ParkMyCar/compact_str,MIT,Parker Timmerman +core-foundation-sys,https://github.com/servo/core-foundation-rs,MIT OR Apache-2.0,The Servo Project Developers +cpufeatures,https://github.com/RustCrypto/utils,MIT OR Apache-2.0,RustCrypto Developers +crypto-common,https://github.com/RustCrypto/traits,MIT OR Apache-2.0,RustCrypto Developers +dashmap,https://github.com/xacrimon/dashmap,MIT,Acrimon +data-encoding,https://github.com/ia0/data-encoding,MIT,Julien Cretin +debugid,https://github.com/getsentry/rust-debugid,Apache-2.0,Sentry +diff,https://github.com/utkarshkukreti/diff.rs,MIT OR Apache-2.0,Utkarsh Kukreti +difference,https://github.com/johannhof/difference.rs,MIT,Johann Hofmann +digest,https://github.com/RustCrypto/traits,MIT OR Apache-2.0,RustCrypto Developers +displaydoc,https://github.com/yaahc/displaydoc,MIT OR Apache-2.0,Jane Lusby +either,https://github.com/rayon-rs/either,MIT OR Apache-2.0,bluss +encoding_rs,https://github.com/hsivonen/encoding_rs,(Apache-2.0 OR MIT) AND BSD-3-Clause,Henri Sivonen +equivalent,https://github.com/indexmap-rs/equivalent,Apache-2.0 OR MIT,The equivalent Authors +errno,https://github.com/lambda-fairy/rust-errno,MIT OR Apache-2.0,Chris Wong +fastrand,https://github.com/smol-rs/fastrand,Apache-2.0 OR MIT,Stjepan Glavina +fixedbitset,https://github.com/petgraph/fixedbitset,MIT OR Apache-2.0,bluss +foldhash,https://github.com/orlp/foldhash,Zlib,Orson Peters +funty,https://github.com/myrrlyn/funty,MIT,myrrlyn +generic-array,https://github.com/fizyk20/generic-array,MIT,"Bartłomiej Kamiński , Aaron Trent " +getrandom,https://github.com/rust-random/getrandom,MIT OR Apache-2.0,The Rand Project Developers +glob,https://github.com/rust-lang/glob,MIT OR Apache-2.0,The Rust Project Developers +hashbrown,https://github.com/rust-lang/hashbrown,MIT OR Apache-2.0,Amanieu d'Antras +hashlink,https://github.com/kyren/hashlink,MIT OR Apache-2.0,kyren +heck,https://github.com/withoutboats/heck,MIT OR Apache-2.0,The heck Authors +hermit-abi,https://github.com/hermit-os/hermit-rs,MIT OR Apache-2.0,Stefan Lankes +hex,https://github.com/KokaKiwi/rust-hex,MIT OR Apache-2.0,KokaKiwi +iana-time-zone,https://github.com/strawlab/iana-time-zone,MIT OR Apache-2.0,"Andrew Straw , René Kijewski , Ryan Lopopolo " +iana-time-zone-haiku,https://github.com/strawlab/iana-time-zone,MIT OR Apache-2.0,René Kijewski +icu_collections,https://github.com/unicode-org/icu4x,Unicode-3.0,The ICU4X Project Developers +icu_locid,https://github.com/unicode-org/icu4x,Unicode-3.0,The ICU4X Project Developers +icu_locid_transform,https://github.com/unicode-org/icu4x,Unicode-3.0,The ICU4X Project Developers +icu_locid_transform_data,https://github.com/unicode-org/icu4x,Unicode-3.0,The ICU4X Project Developers +icu_normalizer,https://github.com/unicode-org/icu4x,Unicode-3.0,The ICU4X Project Developers +icu_normalizer_data,https://github.com/unicode-org/icu4x,Unicode-3.0,The ICU4X Project Developers +icu_properties,https://github.com/unicode-org/icu4x,Unicode-3.0,The ICU4X Project Developers +icu_properties_data,https://github.com/unicode-org/icu4x,Unicode-3.0,The ICU4X Project Developers +icu_provider,https://github.com/unicode-org/icu4x,Unicode-3.0,The ICU4X Project Developers +icu_provider_macros,https://github.com/unicode-org/icu4x,Unicode-3.0,The ICU4X Project Developers +idna_adapter,https://github.com/hsivonen/idna_adapter,Apache-2.0 OR MIT,The rust-url developers +if_chain,https://github.com/lambda-fairy/if_chain,MIT OR Apache-2.0,Chris Wong +indexmap,https://github.com/indexmap-rs/indexmap,Apache-2.0 OR MIT,The indexmap Authors +is-macro,https://github.com/dudykr/ddbase,Apache-2.0,강동윤 +itertools,https://github.com/rust-itertools/itertools,MIT OR Apache-2.0,bluss +itoa,https://github.com/dtolnay/itoa,MIT OR Apache-2.0,David Tolnay +js-sys,https://github.com/rustwasm/wasm-bindgen/tree/master/crates/js-sys,MIT OR Apache-2.0,The wasm-bindgen Developers +jsonc-parser,https://github.com/dprint/jsonc-parser,MIT,David Sherret +lazy_static,https://github.com/rust-lang-nursery/lazy-static.rs,MIT OR Apache-2.0,Marvin Löbel +libc,https://github.com/rust-lang/libc,MIT OR Apache-2.0,The Rust Project Developers +linux-raw-sys,https://github.com/sunfishcode/linux-raw-sys,Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT,Dan Gohman +litemap,https://github.com/unicode-org/icu4x,Unicode-3.0,The ICU4X Project Developers +log,https://github.com/rust-lang/log,MIT OR Apache-2.0,The Rust Project Developers +lru,https://github.com/jeromefroe/lru-rs,MIT,Jerome Froelich +matchers,https://github.com/hawkw/matchers,MIT,Eliza Weisman +memchr,https://github.com/BurntSushi/memchr,Unlicense OR MIT,"Andrew Gallant , bluss" +miette,https://github.com/zkat/miette,Apache-2.0,Kat Marchán +minimal-lexical,https://github.com/Alexhuszagh/minimal-lexical,MIT OR Apache-2.0,Alex Huszagh +munge,https://github.com/djkoloski/munge,MIT,David Koloski +new_debug_unreachable,https://github.com/mbrubeck/rust-debug-unreachable,MIT,"Matt Brubeck , Jonathan Reem " +nodejs-semver,https://github.com/cijiugechu/nodejs-semver,Apache-2.0,"cijiugechu , Felipe Sere , Kat Marchán " +nom,https://github.com/Geal/nom,MIT,contact@geoffroycouprie.com +normpath,https://github.com/dylni/normpath,MIT OR Apache-2.0,dylni +nu-ansi-term,https://github.com/nushell/nu-ansi-term,MIT,"ogham@bsago.me, Ryan Scheel (Havvy) , Josh Triplett , The Nushell Project Developers" +num-bigint,https://github.com/rust-num/num-bigint,MIT OR Apache-2.0,The Rust Project Developers +num-integer,https://github.com/rust-num/num-integer,MIT OR Apache-2.0,The Rust Project Developers +num-traits,https://github.com/rust-num/num-traits,MIT OR Apache-2.0,The Rust Project Developers +num_cpus,https://github.com/seanmonstar/num_cpus,MIT OR Apache-2.0,Sean McArthur +once_cell,https://github.com/matklad/once_cell,MIT OR Apache-2.0,Aleksey Kladov +outref,https://github.com/Nugine/outref,MIT,The outref Authors +overload,https://github.com/danaugrs/overload,MIT,Daniel Salvadori +owo-colors,https://github.com/owo-colors/owo-colors,MIT,jam1garner <8260240+jam1garner@users.noreply.github.com> +parking_lot,https://github.com/Amanieu/parking_lot,MIT OR Apache-2.0,Amanieu d'Antras +path-clean,https://github.com/danreeves/path-clean,MIT OR Apache-2.0,Dan Reeves +pathdiff,https://github.com/Manishearth/pathdiff,MIT OR Apache-2.0,Manish Goregaokar +petgraph,https://github.com/petgraph/petgraph,MIT OR Apache-2.0,"bluss, mitchmindtree" +phf,https://github.com/rust-phf/rust-phf,MIT,Steven Fackler +pin-project-lite,https://github.com/taiki-e/pin-project-lite,Apache-2.0 OR MIT,The pin-project-lite Authors +pretty_assertions,https://github.com/rust-pretty-assertions/rust-pretty-assertions,MIT OR Apache-2.0,"Colin Kiegel , Florent Fayolle , Tom Milligan " +proc-macro2,https://github.com/dtolnay/proc-macro2,MIT OR Apache-2.0,"David Tolnay , Alex Crichton " +psm,https://github.com/rust-lang/stacker,MIT OR Apache-2.0,Simonas Kazlauskas +ptr_meta,https://github.com/rkyv/ptr_meta,MIT,David Koloski +quote,https://github.com/dtolnay/quote,MIT OR Apache-2.0,David Tolnay +radium,https://github.com/bitvecto-rs/radium,MIT,"Nika Layzell , myrrlyn " +radix_fmt,https://gitlab.com/Boiethios/radix_fmt_rs,Apache-2.0,Félix +rancor,https://github.com/rkyv/rancor,MIT,David Koloski +rand,https://github.com/rust-random/rand,MIT OR Apache-2.0,"The Rand Project Developers, The Rust Project Developers" +redox_syscall,https://gitlab.redox-os.org/redox-os/syscall,MIT,Jeremy Soller +regex,https://github.com/rust-lang/regex,MIT OR Apache-2.0,"The Rust Project Developers, Andrew Gallant " +regex-automata,https://github.com/BurntSushi/regex-automata,Unlicense OR MIT,Andrew Gallant +regex-automata,https://github.com/rust-lang/regex/tree/master/regex-automata,MIT OR Apache-2.0,"The Rust Project Developers, Andrew Gallant " +regex-syntax,https://github.com/rust-lang/regex,MIT OR Apache-2.0,The Rust Project Developers +regex-syntax,https://github.com/rust-lang/regex/tree/master/regex-syntax,MIT OR Apache-2.0,"The Rust Project Developers, Andrew Gallant " +relative-path,https://github.com/udoprog/relative-path,MIT OR Apache-2.0,John-John Tedro +rend,https://github.com/djkoloski/rend,MIT,David Koloski +rkyv,https://github.com/rkyv/rkyv,MIT,David Koloski +rustc-hash,https://github.com/rust-lang-nursery/rustc-hash,Apache-2.0 OR MIT,The Rust Project Developers +rustc-hash,https://github.com/rust-lang/rustc-hash,Apache-2.0 OR MIT,The Rust Project Developers +rustix,https://github.com/bytecodealliance/rustix,Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT,"Dan Gohman , Jakub Konka " +rustversion,https://github.com/dtolnay/rustversion,MIT OR Apache-2.0,David Tolnay +ryu,https://github.com/dtolnay/ryu,Apache-2.0 OR BSL-1.0,David Tolnay +ryu-js,https://github.com/boa-dev/ryu-js,Apache-2.0 OR BSL-1.0,"David Tolnay , boa-dev" +scoped-tls,https://github.com/alexcrichton/scoped-tls,MIT OR Apache-2.0,Alex Crichton +scopeguard,https://github.com/bluss/scopeguard,MIT OR Apache-2.0,bluss +semver,https://github.com/dtolnay/semver,MIT OR Apache-2.0,David Tolnay +serde,https://github.com/serde-rs/serde,MIT OR Apache-2.0,"Erick Tryzelaar , David Tolnay " +serde_json,https://github.com/serde-rs/json,MIT OR Apache-2.0,"Erick Tryzelaar , David Tolnay " +sha1,https://github.com/RustCrypto/hashes,MIT OR Apache-2.0,RustCrypto Developers +sha2,https://github.com/RustCrypto/hashes,MIT OR Apache-2.0,RustCrypto Developers +sharded-slab,https://github.com/hawkw/sharded-slab,MIT,Eliza Weisman +simd-abstraction,https://github.com/Nugine/simd,MIT,The simd-abstraction Authors +simdutf8,https://github.com/rusticstuff/simdutf8,MIT OR Apache-2.0,Hans Kratz +siphasher,https://github.com/jedisct1/rust-siphash,MIT OR Apache-2.0,Frank Denis +smallvec,https://github.com/servo/rust-smallvec,MIT OR Apache-2.0,The Servo Project Developers +smartstring,https://github.com/bodil/smartstring,MPL-2.0+,Bodil Stokke +sourcemap,https://github.com/getsentry/rust-sourcemap,BSD-3-Clause,Sentry +st-map,https://github.com/dudykr/ddbase,Apache-2.0,강동윤 +stable_deref_trait,https://github.com/storyyeller/stable_deref_trait,MIT OR Apache-2.0,Robert Grosse +stacker,https://github.com/rust-lang/stacker,MIT OR Apache-2.0,"Alex Crichton , Simonas Kazlauskas " +static-map-macro,https://github.com/dudykr/ddbase,Apache-2.0,강동윤 +static_assertions,https://github.com/nvzqz/static-assertions-rs,MIT OR Apache-2.0,Nikolai Vazquez +swc,https://github.com/swc-project/swc,Apache-2.0,강동윤 +swc_core,https://github.com/swc-project/swc,Apache-2.0,"강동윤 , OJ Kwon " +swc_eq_ignore_macros,https://github.com/swc-project/swc,Apache-2.0,강동윤 +swc_node_comments,https://github.com/swc-project/swc,Apache-2.0,"강동윤 , Daniel Woznicki " +swc_plugin_macro,https://github.com/swc-project/swc,Apache-2.0,"강동윤 , OJ Kwon " +swc_plugin_proxy,https://github.com/swc-project/swc,Apache-2.0,"강동윤 , OJ Kwon " +syn,https://github.com/dtolnay/syn,MIT OR Apache-2.0,David Tolnay +synstructure,https://github.com/mystor/synstructure,MIT,Nika Layzell +tap,https://github.com/myrrlyn/tap,MIT,"Elliott Linder , myrrlyn " +tempfile,https://github.com/Stebalien/tempfile,MIT OR Apache-2.0,"Steven Allen , The Rust Project Developers, Ashley Mannix , Jason White " +termcolor,https://github.com/BurntSushi/termcolor,Unlicense OR MIT,Andrew Gallant +textwrap,https://github.com/mgeisler/textwrap,MIT,Martin Geisler +thiserror,https://github.com/dtolnay/thiserror,MIT OR Apache-2.0,David Tolnay +thread_local,https://github.com/Amanieu/thread_local-rs,MIT OR Apache-2.0,Amanieu d'Antras +tinystr,https://github.com/unicode-org/icu4x,Unicode-3.0,The ICU4X Project Developers +tinyvec,https://github.com/Lokathor/tinyvec,Zlib OR Apache-2.0 OR MIT,Lokathor +tinyvec_macros,https://github.com/Soveu/tinyvec_macros,MIT OR Apache-2.0 OR Zlib,Soveu +tracing,https://github.com/tokio-rs/tracing,MIT,"Eliza Weisman , Tokio Contributors " +tracing-attributes,https://github.com/tokio-rs/tracing,MIT,"Tokio Contributors , Eliza Weisman , David Barsky " +tracing-core,https://github.com/tokio-rs/tracing,MIT,Tokio Contributors +tracing-log,https://github.com/tokio-rs/tracing,MIT,Tokio Contributors +tracing-subscriber,https://github.com/tokio-rs/tracing,MIT,"Eliza Weisman , David Barsky , Tokio Contributors " +triomphe,https://github.com/Manishearth/triomphe,MIT OR Apache-2.0,"Manish Goregaokar , The Servo Project Developers" +typed-arena,https://github.com/SimonSapin/rust-typed-arena,MIT,The typed-arena developers +typenum,https://github.com/paholg/typenum,MIT OR Apache-2.0,"Paho Lurie-Gregg , Andre Bogus " +unicode-id,https://github.com/Boshen/unicode-id,MIT OR Apache-2.0,"Boshen , erick.tryzelaar , kwantam , Manish Goregaokar " +unicode-id-start,https://github.com/Boshen/unicode-id-start,(MIT OR Apache-2.0) AND Unicode-DFS-2016,"David Tolnay , Boshen " +unicode-ident,https://github.com/dtolnay/unicode-ident,(MIT OR Apache-2.0) AND Unicode-3.0,David Tolnay +unicode-linebreak,https://github.com/axelf4/unicode-linebreak,Apache-2.0,Axel Forsman +unicode-width,https://github.com/unicode-rs/unicode-width,MIT OR Apache-2.0,"kwantam , Manish Goregaokar " +url,https://github.com/servo/rust-url,MIT OR Apache-2.0,The rust-url developers +utf16_iter,https://github.com/hsivonen/utf16_iter,Apache-2.0 OR MIT,Henri Sivonen +utf8_iter,https://github.com/hsivonen/utf8_iter,Apache-2.0 OR MIT,Henri Sivonen +uuid,https://github.com/uuid-rs/uuid,Apache-2.0 OR MIT,"Ashley Mannix, Dylan DPC, Hunar Roop Kahlon" +valuable,https://github.com/tokio-rs/valuable,MIT,The valuable Authors +wasi,https://github.com/bytecodealliance/wasi,Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT,The Cranelift Project Developers +wasi,https://github.com/bytecodealliance/wasi-rs,Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT,The Cranelift Project Developers +wasm-bindgen,https://github.com/rustwasm/wasm-bindgen,MIT OR Apache-2.0,The wasm-bindgen Developers +wasm-bindgen-backend,https://github.com/rustwasm/wasm-bindgen/tree/master/crates/backend,MIT OR Apache-2.0,The wasm-bindgen Developers +wasm-bindgen-macro,https://github.com/rustwasm/wasm-bindgen/tree/master/crates/macro,MIT OR Apache-2.0,The wasm-bindgen Developers +wasm-bindgen-macro-support,https://github.com/rustwasm/wasm-bindgen/tree/master/crates/macro-support,MIT OR Apache-2.0,The wasm-bindgen Developers +wasm-bindgen-shared,https://github.com/rustwasm/wasm-bindgen/tree/master/crates/shared,MIT OR Apache-2.0,The wasm-bindgen Developers +winapi,https://github.com/retep998/winapi-rs,MIT OR Apache-2.0,Peter Atashian +winapi-util,https://github.com/BurntSushi/winapi-util,Unlicense OR MIT,Andrew Gallant +windows-core,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft +windows-link,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft +windows-sys,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft +windows-targets,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft +windows_aarch64_gnullvm,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft +windows_aarch64_msvc,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft +windows_i686_gnu,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft +windows_i686_gnullvm,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft +windows_i686_msvc,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft +windows_x86_64_gnu,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft +windows_x86_64_gnullvm,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft +windows_x86_64_msvc,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft +winnow,https://github.com/winnow-rs/winnow,MIT,The winnow Authors +wit-bindgen-rt,https://github.com/bytecodealliance/wasi-rs,Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT,The wit-bindgen-rt Authors +write16,https://github.com/hsivonen/write16,Apache-2.0 OR MIT,The write16 Authors +writeable,https://github.com/unicode-org/icu4x,Unicode-3.0,The ICU4X Project Developers +wyz,https://github.com/myrrlyn/wyz,MIT,myrrlyn +yaml-rust2,https://github.com/Ethiraric/yaml-rust2,MIT OR Apache-2.0,"Yuheng Chen , Ethiraric , David Aguilar " +yansi,https://github.com/SergioBenitez/yansi,MIT OR Apache-2.0,Sergio Benitez +yoke,https://github.com/unicode-org/icu4x,Unicode-3.0,Manish Goregaokar +yoke-derive,https://github.com/unicode-org/icu4x,Unicode-3.0,Manish Goregaokar +zerocopy,https://github.com/google/zerocopy,BSD-2-Clause OR Apache-2.0 OR MIT,Joshua Liebow-Feeser +zerofrom,https://github.com/unicode-org/icu4x,Unicode-3.0,Manish Goregaokar +zerofrom-derive,https://github.com/unicode-org/icu4x,Unicode-3.0,Manish Goregaokar +zerovec,https://github.com/unicode-org/icu4x,Unicode-3.0,The ICU4X Project Developers +zerovec-derive,https://github.com/unicode-org/icu4x,Unicode-3.0,Manish Goregaokar diff --git a/NOTICE b/NOTICE new file mode 100644 index 0000000..285f69f --- /dev/null +++ b/NOTICE @@ -0,0 +1,3 @@ +Orchestrion-JS +Copyright 2025-Present Datadog, Inc. +This product includes software developed at Datadog (). diff --git a/README.md b/README.md index 684e27f..5788e0c 100644 --- a/README.md +++ b/README.md @@ -1 +1,15 @@ -Coming soon... +# Orchestion-JS + +Orchestrion is a library for instrumenting Node.js libraries at build or load time. +It provides [`VisitMut`] implementations for SWC's AST nodes, which can be used to insert tracing code into matching functions. +It's entirely configurable via a YAML string, and can be used in SWC plugins, or anything else that mutates JavaScript ASTs using SWC. + +## Contributing + +See CONTRIBUTING.md + +## License + +See LICENSE + +[`VisitMut`]: https://rustdoc.swc.rs/swc_core/ecma/visit/trait.VisitMut.html diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..028e66c --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,11 @@ +# Security Policy + +This document outlines the security policy for Orchestrion-KS (aka `orchestrion-js`) and what to do if you discover a security +vulnerability in the project. Most notably, please do not share the details in a public forum (such as in a discussion, +issue, or pull request) but instead reach out to us with the details. This gives us an opportunity to release a fix for +others to benefit from by the time details are made public. + +## Reporting a Vulnerability + +If you discover a vulnerability in Orchestrion-JS (or any Datadog product for that matter) please follow the contact +instructions listed under the "Report an Issue" section here: https://www.datadoghq.com/security/?tab=contact diff --git a/src/config.rs b/src/config.rs index b8e0ac9..3cd5799 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1,3 +1,7 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (/). Copyright 2025 Datadog, Inc. + **/ use std::path::PathBuf; use nodejs_semver::{Range, Version}; diff --git a/src/error.rs b/src/error.rs index 8a58454..4ed1c20 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,3 +1,7 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (/). Copyright 2025 Datadog, Inc. + **/ use std::fmt::{self, Display, Formatter}; #[derive(Debug)] diff --git a/src/function_query.rs b/src/function_query.rs index a920052..5890428 100644 --- a/src/function_query.rs +++ b/src/function_query.rs @@ -1,3 +1,7 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (/). Copyright 2025 Datadog, Inc. + **/ use crate::error::OrchestrionError; use swc_core::ecma::ast::{FnDecl, FnExpr, Function}; use yaml_rust2::Yaml; diff --git a/src/instrumentation.rs b/src/instrumentation.rs index 13e34b8..b02523a 100644 --- a/src/instrumentation.rs +++ b/src/instrumentation.rs @@ -1,3 +1,7 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (/). Copyright 2025 Datadog, Inc. + **/ use crate::config::InstrumentationConfig; use std::path::PathBuf; use swc_core::common::{Span, SyntaxContext}; diff --git a/src/lib.rs b/src/lib.rs index aa82f56..2d7d7c4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -14,6 +14,10 @@ #![deny(clippy::correctness)] #![deny(clippy::unwrap_used)] +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (/). Copyright 2025 Datadog, Inc. + **/ use std::path::PathBuf; use std::str::FromStr; diff --git a/tests/class_method_cjs/mod.js b/tests/class_method_cjs/mod.js index e2ad5e7..eb3c653 100644 --- a/tests/class_method_cjs/mod.js +++ b/tests/class_method_cjs/mod.js @@ -1,3 +1,7 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2025 Datadog, Inc. + **/ class UndiciBase { async fetch (url) { return 42; diff --git a/tests/class_method_cjs/test.js b/tests/class_method_cjs/test.js index c7106c0..c0ec53a 100644 --- a/tests/class_method_cjs/test.js +++ b/tests/class_method_cjs/test.js @@ -1,3 +1,7 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2025 Datadog, Inc. + **/ const Undici = require('./instrumented.js'); const { assert, getContext } = require('../common/preamble.js'); const context = getContext('orchestrion:undici:Undici_fetch'); diff --git a/tests/common/mod.rs b/tests/common/mod.rs index 264ed9b..09137d3 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -1,3 +1,7 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2025 Datadog, Inc. + **/ use assert_cmd::prelude::*; use orchestrion_js::*; use std::io::prelude::*; diff --git a/tests/common/preamble.js b/tests/common/preamble.js index 78a9a19..5f22d97 100644 --- a/tests/common/preamble.js +++ b/tests/common/preamble.js @@ -1,3 +1,7 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2025 Datadog, Inc. + **/ const { tracingChannel } = require('diagnostics_channel'); const assert = require('assert'); function getContext (channelName) { diff --git a/tests/constructor_cjs/mod.js b/tests/constructor_cjs/mod.js index 8682a1a..69a5d34 100644 --- a/tests/constructor_cjs/mod.js +++ b/tests/constructor_cjs/mod.js @@ -1,3 +1,7 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2025 Datadog, Inc. + **/ class UndiciBase { constructor () { } diff --git a/tests/constructor_cjs/test.js b/tests/constructor_cjs/test.js index 09a46c0..85c7bb9 100644 --- a/tests/constructor_cjs/test.js +++ b/tests/constructor_cjs/test.js @@ -1,3 +1,7 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2025 Datadog, Inc. + **/ const Undici = require('./instrumented.js'); const { assert, getContext } = require('../common/preamble.js'); const context = getContext('orchestrion:undici:Undici_constructor'); diff --git a/tests/constructor_mjs/mod.mjs b/tests/constructor_mjs/mod.mjs index 03b058a..20919b8 100644 --- a/tests/constructor_mjs/mod.mjs +++ b/tests/constructor_mjs/mod.mjs @@ -1,3 +1,7 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2025 Datadog, Inc. + **/ class UndiciBase { constructor() { } @@ -10,4 +14,4 @@ class Undici extends UndiciBase { } } -export { Undici }; \ No newline at end of file +export { Undici }; diff --git a/tests/constructor_mjs/test.mjs b/tests/constructor_mjs/test.mjs index 0b09469..b9292bf 100644 --- a/tests/constructor_mjs/test.mjs +++ b/tests/constructor_mjs/test.mjs @@ -1,3 +1,7 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2025 Datadog, Inc. + **/ import { Undici } from './instrumented.mjs'; import { assert, getContext } from '../common/preamble.js'; const context = getContext('orchestrion:undici:Undici_constructor'); @@ -9,4 +13,4 @@ const context = getContext('orchestrion:undici:Undici_constructor'); start: true, end: true }); -})(); \ No newline at end of file +})(); diff --git a/tests/decl_cjs/mod.js b/tests/decl_cjs/mod.js index d6631b1..c0cbfa6 100644 --- a/tests/decl_cjs/mod.js +++ b/tests/decl_cjs/mod.js @@ -1,3 +1,7 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2025 Datadog, Inc. + **/ async function fetch (url) { return 42; } diff --git a/tests/decl_cjs/test.js b/tests/decl_cjs/test.js index 03fec90..602a66a 100644 --- a/tests/decl_cjs/test.js +++ b/tests/decl_cjs/test.js @@ -1,3 +1,7 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2025 Datadog, Inc. + **/ const { fetch } = require('./instrumented.js'); const { assert, getContext } = require('../common/preamble.js'); const context = getContext('orchestrion:undici:fetch_decl'); diff --git a/tests/decl_mjs/mod.mjs b/tests/decl_mjs/mod.mjs index 805d5c4..00d4f95 100644 --- a/tests/decl_mjs/mod.mjs +++ b/tests/decl_mjs/mod.mjs @@ -1,3 +1,8 @@ + +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2025 Datadog, Inc. + **/ async function fetch (url) { return 42; } diff --git a/tests/decl_mjs/test.mjs b/tests/decl_mjs/test.mjs index f756699..f507df8 100644 --- a/tests/decl_mjs/test.mjs +++ b/tests/decl_mjs/test.mjs @@ -1,3 +1,7 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2025 Datadog, Inc. + **/ import { fetch } from './instrumented.mjs'; import { assert, getContext } from '../common/preamble.js'; const context = getContext('orchestrion:undici:fetch_decl'); diff --git a/tests/expr_cjs/mod.js b/tests/expr_cjs/mod.js index 06f4608..c6207b7 100644 --- a/tests/expr_cjs/mod.js +++ b/tests/expr_cjs/mod.js @@ -1,3 +1,7 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2025 Datadog, Inc. + **/ 'use strict'; const foo = function () {} diff --git a/tests/expr_cjs/test.js b/tests/expr_cjs/test.js index 57f1047..ed0afda 100644 --- a/tests/expr_cjs/test.js +++ b/tests/expr_cjs/test.js @@ -1,3 +1,7 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2025 Datadog, Inc. + **/ const { fetch } = require('./instrumented.js'); const { assert, getContext } = require('../common/preamble.js'); const context = getContext('orchestrion:undici:fetch_expr'); diff --git a/tests/expr_mjs/mod.mjs b/tests/expr_mjs/mod.mjs index 2c7b9e6..9cf4646 100644 --- a/tests/expr_mjs/mod.mjs +++ b/tests/expr_mjs/mod.mjs @@ -1,3 +1,7 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2025 Datadog, Inc. + **/ const fetch = async function (url) { return 42; } diff --git a/tests/expr_mjs/test.mjs b/tests/expr_mjs/test.mjs index 9266eb8..0344da7 100644 --- a/tests/expr_mjs/test.mjs +++ b/tests/expr_mjs/test.mjs @@ -1,3 +1,7 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2025 Datadog, Inc. + **/ import { fetch } from './instrumented.mjs'; import { assert, getContext } from '../common/preamble.js'; const context = getContext('orchestrion:undici:fetch_expr'); diff --git a/tests/index_cjs/mod.js b/tests/index_cjs/mod.js index 437d9c6..a30201d 100644 --- a/tests/index_cjs/mod.js +++ b/tests/index_cjs/mod.js @@ -1,3 +1,7 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2025 Datadog, Inc. + **/ { class Undici { async fetch (url) { diff --git a/tests/index_cjs/test.js b/tests/index_cjs/test.js index 525abe7..992cedd 100644 --- a/tests/index_cjs/test.js +++ b/tests/index_cjs/test.js @@ -1,3 +1,7 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2025 Datadog, Inc. + **/ const undicis = require('./instrumented.js'); const { assert, getContext } = require('../common/preamble.js'); const context = getContext('orchestrion:undici:Undici_fetch'); diff --git a/tests/instrumentor_test.rs b/tests/instrumentor_test.rs index b7926f5..0dc02e4 100644 --- a/tests/instrumentor_test.rs +++ b/tests/instrumentor_test.rs @@ -1,3 +1,7 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2025 Datadog, Inc. + **/ use std::path::PathBuf; mod common; diff --git a/tests/multiple_class_method_cjs/mod.js b/tests/multiple_class_method_cjs/mod.js index d5d622b..7a5b16e 100644 --- a/tests/multiple_class_method_cjs/mod.js +++ b/tests/multiple_class_method_cjs/mod.js @@ -1,3 +1,7 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2025 Datadog, Inc. + **/ class Undici { async fetch1 (url) { return 42; diff --git a/tests/multiple_class_method_cjs/test.js b/tests/multiple_class_method_cjs/test.js index 75568f3..5b05c7e 100644 --- a/tests/multiple_class_method_cjs/test.js +++ b/tests/multiple_class_method_cjs/test.js @@ -1,3 +1,7 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2025 Datadog, Inc. + **/ const Undici = require('./instrumented.js'); const { assert, getContext } = require('../common/preamble.js'); const context1 = getContext('orchestrion:undici:Undici_fetch1'); diff --git a/tests/multiple_load_cjs/instrumentations.yml b/tests/multiple_load_cjs/instrumentations.yml new file mode 100644 index 0000000..2b8591c --- /dev/null +++ b/tests/multiple_load_cjs/instrumentations.yml @@ -0,0 +1,12 @@ +version: 1 +instrumentations: + - module_name: undici + version_range: ">=0.0.1" + file_path: index.mjs + function_query: + class: Undici + name: fetch + type: method + kind: async + operator: tracePromise + channel_name: Undici_fetch diff --git a/tests/multiple_load_cjs/mod.js b/tests/multiple_load_cjs/mod.js new file mode 100644 index 0000000..eb3c653 --- /dev/null +++ b/tests/multiple_load_cjs/mod.js @@ -0,0 +1,16 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2025 Datadog, Inc. + **/ +class UndiciBase { + async fetch (url) { + return 42; + } +} +class Undici extends UndiciBase { + async fetch (url) { + return super.fetch(url); + } +} + +module.exports = Undici; diff --git a/tests/multiple_load_cjs/test.js b/tests/multiple_load_cjs/test.js new file mode 100644 index 0000000..c0ec53a --- /dev/null +++ b/tests/multiple_load_cjs/test.js @@ -0,0 +1,18 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2025 Datadog, Inc. + **/ +const Undici = require('./instrumented.js'); +const { assert, getContext } = require('../common/preamble.js'); +const context = getContext('orchestrion:undici:Undici_fetch'); +(async () => { + const undici = new Undici; + const result = await undici.fetch('https://example.com'); + assert.strictEqual(result, 42); + assert.deepStrictEqual(context, { + start: true, + end: true, + asyncStart: 42, + asyncEnd: 42 + }); +})(); diff --git a/tests/no_index_cjs/mod.js b/tests/no_index_cjs/mod.js index 4c130bf..c977331 100644 --- a/tests/no_index_cjs/mod.js +++ b/tests/no_index_cjs/mod.js @@ -1,5 +1,9 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2025 Datadog, Inc. + **/ async function fetch(url) { return 42; } -module.exports = { fetch }; \ No newline at end of file +module.exports = { fetch }; diff --git a/tests/no_index_cjs/test.js b/tests/no_index_cjs/test.js index 96f5124..8c88c1c 100644 --- a/tests/no_index_cjs/test.js +++ b/tests/no_index_cjs/test.js @@ -1,3 +1,7 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2025 Datadog, Inc. + **/ const { fetch } = require('./instrumented.js'); const { assert, getContext } = require('../common/preamble.js'); const context = getContext('orchestrion:undici:fetch_no_index'); @@ -10,4 +14,4 @@ const context = getContext('orchestrion:undici:fetch_no_index'); asyncStart: 42, asyncEnd: 42 }); -})(); \ No newline at end of file +})(); diff --git a/tests/object_method_cjs/mod.js b/tests/object_method_cjs/mod.js index 390d0d5..41f12f4 100644 --- a/tests/object_method_cjs/mod.js +++ b/tests/object_method_cjs/mod.js @@ -1,3 +1,7 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2025 Datadog, Inc. + **/ const undici = { async fetch (url) { return 42; diff --git a/tests/object_method_cjs/test.js b/tests/object_method_cjs/test.js index afa48a9..7c55fc1 100644 --- a/tests/object_method_cjs/test.js +++ b/tests/object_method_cjs/test.js @@ -1,3 +1,7 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2025 Datadog, Inc. + **/ const { fetch } = require('./instrumented.js'); const { assert, getContext } = require('../common/preamble.js'); const context = getContext('orchestrion:undici:Undici_fetch'); diff --git a/tests/polyfill_cjs/mod.js b/tests/polyfill_cjs/mod.js index d450874..34c58e4 100644 --- a/tests/polyfill_cjs/mod.js +++ b/tests/polyfill_cjs/mod.js @@ -1,3 +1,7 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2025 Datadog, Inc. + **/ async function fetch (url) { return 42; } diff --git a/tests/polyfill_cjs/polyfill.js b/tests/polyfill_cjs/polyfill.js index 64d900b..cc06058 100644 --- a/tests/polyfill_cjs/polyfill.js +++ b/tests/polyfill_cjs/polyfill.js @@ -1,3 +1,7 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2025 Datadog, Inc. + **/ module.exports = require('diagnostics_channel'); const tracingChannel = module.exports.tracingChannel; tracingChannel.polyfilled = true; diff --git a/tests/polyfill_cjs/test.js b/tests/polyfill_cjs/test.js index a47e0d8..253d586 100644 --- a/tests/polyfill_cjs/test.js +++ b/tests/polyfill_cjs/test.js @@ -1,3 +1,7 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2025 Datadog, Inc. + **/ const { fetch } = require('./instrumented.js'); const { assert, getContext } = require('../common/preamble.js'); const { tracingChannel } = require('diagnostics_channel'); diff --git a/tests/polyfill_mjs/mod.mjs b/tests/polyfill_mjs/mod.mjs index 805d5c4..841018d 100644 --- a/tests/polyfill_mjs/mod.mjs +++ b/tests/polyfill_mjs/mod.mjs @@ -1,3 +1,7 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2025 Datadog, Inc. + **/ async function fetch (url) { return 42; } diff --git a/tests/polyfill_mjs/polyfill.js b/tests/polyfill_mjs/polyfill.js index 64d900b..cc06058 100644 --- a/tests/polyfill_mjs/polyfill.js +++ b/tests/polyfill_mjs/polyfill.js @@ -1,3 +1,7 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2025 Datadog, Inc. + **/ module.exports = require('diagnostics_channel'); const tracingChannel = module.exports.tracingChannel; tracingChannel.polyfilled = true; diff --git a/tests/polyfill_mjs/test.mjs b/tests/polyfill_mjs/test.mjs index 1e02c47..3943b4b 100644 --- a/tests/polyfill_mjs/test.mjs +++ b/tests/polyfill_mjs/test.mjs @@ -1,3 +1,7 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2025 Datadog, Inc. + **/ import { fetch } from './instrumented.mjs'; import { assert, getContext } from '../common/preamble.js'; import { tracingChannel } from 'diagnostics_channel';