Skip to content

Commit

Permalink
chore: clean up README and fixed the default repos
Browse files Browse the repository at this point in the history
  • Loading branch information
bizob2828 committed Apr 16, 2024
1 parent f1af7ac commit b111201
Show file tree
Hide file tree
Showing 6 changed files with 101 additions and 24 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
local/
dist/
nrversions
newrelic-versions
vendor/

coverage.*
105 changes: 88 additions & 17 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,120 @@
<a href="https://opensource.newrelic.com/oss-category/#new-relic-experimental"><picture><source media="(prefers-color-scheme: dark)" srcset="https://github.com/newrelic/opensource-website/raw/main/src/images/categories/dark/Experimental.png"><source media="(prefers-color-scheme: light)" srcset="https://github.com/newrelic/opensource-website/raw/main/src/images/categories/Experimental.png"><img alt="New Relic Open Source experimental project banner." src="https://github.com/newrelic/opensource-website/raw/main/src/images/categories/Experimental.png"></picture></a>

# New Relic Node.js 3rd Party Versions

This is a utility used by the New Relic Node.js agent team. It will clone `node-newrelic`, `newrelic-node-apollo-server-plugin` and `newrelic-node-nextjs` repos and create a 3rd party library compatibility report.

## Installation

> [Include a step-by-step procedure on how to get your code installed. Be sure to include any third-party dependencies that need to be installed separately]
```sh
go install github.com/newrelic/newrelic-node-versions@latest
```

## Getting Started
>[Simple steps to start working with the software similar to a "Hello World"]

## Usage
>[**Optional** - Include more thorough instructions on how to use the software. This section might not be needed if the Getting Started section is enough. Remove this section if it's not needed.]

```sh
./newrelic-versions
```

Will output a compatibility report like this

```
+------------------------+---------------------+----------------------------+---------------+----------------------+
| NAME | MINSUPPORTEDVERSION | MINSUPPORTEDVERSIONRELEASE | LATESTVERSION | LATESTVERSIONRELEASE |
+------------------------+---------------------+----------------------------+---------------+----------------------+
| @apollo/gateway | 2.3.0 | 2023-01-25 | 2.7.3 | 2024-04-16 |
| @apollo/server | 4.0.0 | 2022-10-10 | 4.10.3 | 2024-04-15 |
| @elastic/elasticsearch | 7.16.0 | 2021-12-15 | 8.13.1 | 2024-04-09 |
| @grpc/grpc-js | 1.4.0 | 2021-10-13 | 1.10.6 | 2024-04-03 |
| @hapi/hapi | 20.1.2 | 2021-03-20 | 21.3.9 | 2024-04-09 |
| @langchain/core | 0.1.17 | 2024-01-19 | 0.1.58 | 2024-04-16 |
| @nestjs/cli | 8.0.0 | 2021-07-07 | 10.3.2 | 2024-02-07 |
| @prisma/client | 5.0.0 | 2023-07-11 | 5.12.1 | 2024-04-04 |
| amqplib | 0.5.0 | 2016-11-01 | 0.10.4 | 2024-04-11 |
| apollo-server | 2.14.0 | 2020-05-27 | 3.13.0 | 2023-11-14 |
| apollo-server-express | 2.14.0 | 2020-05-27 | 3.13.0 | 2023-11-14 |
| apollo-server-fastify | 2.14.0 | 2020-05-27 | 3.13.0 | 2023-11-14 |
| apollo-server-hapi | 3.0.0 | 2021-07-07 | 3.13.0 | 2023-11-14 |
| apollo-server-koa | 2.14.0 | 2020-05-27 | 3.13.0 | 2023-11-14 |
| apollo-server-lambda | 2.14.0 | 2020-05-27 | 3.13.0 | 2023-11-14 |
| bluebird | 2.0.0 | 2014-06-04 | 3.7.2 | 2019-11-28 |
| bunyan | 1.8.12 | 2017-08-02 | 1.8.15 | 2021-01-08 |
| cassandra-driver | 3.4.0 | 2018-02-05 | 4.7.2 | 2023-09-21 |
| connect | 2.0.0 | 2012-02-28 | 3.7.0 | 2019-05-18 |
| director | 1.2.0 | 2013-04-01 | 1.2.8 | 2015-02-04 |
| express | 4.6.0 | 2014-07-12 | 4.19.2 | 2024-03-25 |
| fastify | 2.0.0 | 2019-02-25 | 4.26.2 | 2024-03-03 |
| generic-pool | 2.4.0 | 2016-01-18 | 3.9.0 | 2022-09-10 |
| ioredis | 3.0.0 | 2017-05-18 | 5.3.2 | 2023-04-15 |
| mongodb | 2.1.0 | 2015-12-06 | 6.5.0 | 2024-03-11 |
| mysql | 2.2.0 | 2014-04-27 | 2.18.1 | 2020-01-23 |
| mysql2 | 1.3.1 | 2017-05-31 | 3.9.4 | 2024-04-09 |
| next | 13.0.0 | 2022-10-25 | 14.2.1 | 2024-04-12 |
| openai | 4.0.0 | 2023-08-16 | 4.35.0 | 2024-04-16 |
| pg | 8.2.0 | 2020-05-13 | 8.11.5 | 2024-04-02 |
| pino | 7.0.0 | 2021-10-14 | 8.20.0 | 2024-04-06 |
| redis | 2.0.0 | 2015-09-21 | 4.6.13 | 2024-02-05 |
| restify | 5.0.0 | 2017-06-27 | 11.1.0 | 2023-02-24 |
| superagent | 2.0.0 | 2016-05-29 | 8.1.2 | 2023-08-15 |
| undici | 4.7.0 | 2021-09-22 | 6.13.0 | 2024-04-12 |
| winston | 3.0.0 | 2018-06-12 | 3.13.0 | 2024-03-24 |
+------------------------+---------------------+----------------------------+---------------+----------------------+
```

For optional CLI args, run:

```sh
❯ ./newrelic-versions -help

This tool is used to generate a document detailing the modules that
the newrelic Node.js agent instruments and the version ranges of those
modules.

The following flags are supported:

-o, --output-format string Specify the format to write the results as. The default is an ASCII
table. Possible values: "ascii" or "markdown".
(default "ascii")
-r, --repo-dir string Specify a local directory that contains the node-newrelic repo.
If not provided, the GitHub repository will be cloned to a local temporary
directory and that will be used.

-t, --test-dir string Specify the test directory to parse the package.json files.
If not provided, it will default to 'test/versioned'.

-v, --verbose Enable verbose output. As the data is being loaded and parsed various
logs will be written to stderr that should give indicators of what
is happening.
```

## Building

>[**Optional** - Include this section if users will need to follow specific instructions to build the software from source. Be sure to include any third party build dependencies that need to be installed separately. Remove this section if it's not needed.]
```sh
go build
```

## Testing

>[**Optional** - Include instructions on how to run tests if we include tests with the codebase. Remove this section if it's not needed.]
## Support
```sh
go test

New Relic hosts and moderates an online forum where you can interact with New Relic employees as well as other customers to get help and share best practices. Like all official New Relic open source projects, there's a related Community topic in the New Relic Explorers Hub. You can find this project's topic/threads here:

>Add the url for the support thread here: discuss.newrelic.com
```

## Contribute

We encourage your contributions to improve [project name]! Keep in mind that when you submit your pull request, you'll need to sign the CLA via the click-through using CLA-Assistant. You only have to sign the CLA one time per project.
We encourage your contributions to improve newrelic-node-versions! Keep in mind that when you submit your pull request, you'll need to sign the CLA via the click-through using CLA-Assistant. You only have to sign the CLA one time per project.

If you have any questions, or to execute our corporate CLA (which is required if your contribution is on behalf of a company), drop us an email at [email protected].

**A note about vulnerabilities**

As noted in our [security policy](../../security/policy), New Relic is committed to the privacy and security of our customers and their data. We believe that providing coordinated disclosure by security researchers and engaging with the security community are important means to achieve our security goals.

If you believe you have found a security vulnerability in this project or any of New Relic's products or websites, we welcome and greatly appreciate you reporting it to New Relic through [HackerOne](https://hackerone.com/newrelic).
If you believe you have found a security vulnerability in this project or any of New Relic's products or websites, we welcome and greatly appreciate you reporting it to New Relic through [our bug bounty program](https://docs.newrelic.com/docs/security/security-privacy/information-security/report-security-vulnerabilities/).

If you would like to contribute to this project, review [these guidelines](./CONTRIBUTING.md).

To all contributors, we thank you! Without your contribution, this project would not be what it is today. We also host a community project page dedicated to [Project Name](<LINK TO https://opensource.newrelic.com/projects/... PAGE>).
To [all contributors](https://github.com/newrelic/newrelic-node-versions/graphs/contributors), we thank you! Without your contribution, this project would not be what it is today.

## License
[Project Name] is licensed under the [Apache 2.0](http://apache.org/licenses/LICENSE-2.0.txt) License.
>[If applicable: The [project name] also uses source code from third-party libraries. You can find full details on which libraries are used and the terms under which they are licensed in the third-party notices document.]
New Relic Node.js 3rd Party Versions is licensed under the [Apache 2.0](http://apache.org/licenses/LICENSE-2.0.txt) License. It also uses source code from third-party libraries. You can find full details on which libraries are used and the terms under which they are licensed in the [third-party notices document.](THIRD_PARTY_NOTICES.md)
6 changes: 6 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Reporting Security Vulnerabilities

New Relic is committed to the security of our customers and your data. We believe that engaging with security researchers through our coordinated disclosure program is an important means to achieve our security goals.

If you believe you have found a security vulnerability in one of our products or websites, we welcome and greatly appreciate you reporting it to New Relic's coordinated disclosure program. Please see our [website for more information on how to report a vulnerability](https://docs.newrelic.com/docs/security/new-relic-security/data-privacy/reporting-security-vulnerabilities).

5 changes: 2 additions & 3 deletions flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ func createAndParseFlags(args []string) error {
"r",
"",
heredoc.Doc(`
Specify a local directory that contains the node-newrelic repo.
If not provided, the GitHub repository will be cloned to a local temporary
Specify a local directory that contains a Node.js agent repo.
If not provided, the default GitHub repositories will be cloned to a local temporary
directory and that will be used.
`),
)
Expand Down Expand Up @@ -81,7 +81,6 @@ func createAndParseFlags(args []string) error {
)

// TODO: add flags for generating different formats:
// 1. markdown (for GitHub repo)
// 2. docs site
// They should also generate new PRs for the respective repos.

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module nrversions
module newrelic-versions

go 1.22

Expand Down
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (
flag "github.com/spf13/pflag"
)

var agentRepo = nrRepo{url: `https://github.com/jsumners-nr/node-newrelic.git`, branch: `versioned-tests-meta-update`, testPath: `test/versioned`}
var apolloRepo = nrRepo{url: `https://github.com/bizob2828/newrelic-node-apollo-server-plugin.git`, branch: `add-target`, testPath: `tests/versioned`}
var nextRepo = nrRepo{url: `https://github.com/bizob2828/newrelic-node-nextjs.git`, branch: `add-targets`, testPath: `tests/versioned`}
var agentRepo = nrRepo{url: `https://github.com/newrelic/node-newrelic.git`, branch: `main`, testPath: `test/versioned`}
var apolloRepo = nrRepo{url: `https://github.com/newrelic/newrelic-node-apollo-server-plugin.git`, branch: `main`, testPath: `tests/versioned`}
var nextRepo = nrRepo{url: `https://github.com/newrelic/newrelic-node-nextjs.git`, branch: `main`, testPath: `tests/versioned`}

type nrRepo struct {
repoDir string
Expand Down

0 comments on commit b111201

Please sign in to comment.