Skip to content

Commit

Permalink
chore: Merged superagent repo into newrelic
Browse files Browse the repository at this point in the history
  • Loading branch information
jsumners-nr committed Apr 11, 2024
2 parents 8013b25 + 78fbc51 commit d3cd679
Show file tree
Hide file tree
Showing 36 changed files with 30,769 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/instrumentation/superagent/.c8rc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"reporter": ["lcov"],
"all": true,
"exclude": ["tests/*", "coverage/*", ".eslintrc.js"],
"clean": true
}
1 change: 1 addition & 0 deletions lib/instrumentation/superagent/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/node_modules/**
3 changes: 3 additions & 0 deletions lib/instrumentation/superagent/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: '@newrelic'
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: "Bug report \U0001F41B"
about: Create a report to help us improve
title: ''
labels: bug, needs-triage
assignees: ''

---

[NOTE]: # ( ^^ Provide a general summary of the issue in the title above. ^^ )

## Description
[NOTE]: # ( Describe the problem you're encountering. )
[TIP]: # ( Do NOT share sensitive information, whether personal, proprietary, or otherwise! )

## Expected Behavior
[NOTE]: # ( Tell us what you expected to happen. )

## [Troubleshooting](https://discuss.newrelic.com/t/troubleshooting-frameworks/108787) or [NR Diag](https://docs.newrelic.com/docs/using-new-relic/cross-product-functions/troubleshooting/new-relic-diagnostics) results
[NOTE]: # ( Provide any other relevant log data. )
[TIP]: # ( Scrub logs and diagnostic information for sensitive information )

## Steps to Reproduce
[NOTE]: # ( Please be as specific as possible. )
[TIP]: # ( Link a sample application that demonstrates the issue. )

## Your Environment
[TIP]: # ( Include as many relevant details about your environment as possible including the running version of New Relic software and any relevant configurations. )

## Additional context
[TIP]: # ( Add any other context about the problem here. For example, relevant community posts or support tickets. )
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Troubleshooting
url: https://github.com/newrelic/node-newrelic-superagent/blob/main/README.md#support
about: Check out the README for troubleshooting directions
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: feature-request, needs-triage
assignees: ''
priority: ''
---

## Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

## Feature Description
A clear and concise description of the feature you want or need.

## Describe Alternatives
A clear and concise description of any alternative solutions or features you've considered. Are there examples you could link us to?

## Additional context
Add any other context here.

## Priority
Please help us better understand this feature request by choosing a priority from the following options:
[Nice to Have, Really Want, Must Have, Blocker]
27 changes: 27 additions & 0 deletions lib/instrumentation/superagent/.github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!--
Thank you for submitting a Pull Request.
This code is leveraged to monitor critical services. Please consider the following:
* Tests are required.
* Performance matters.
* Features that are specific to just your app are unlikely to make it in.
Ensure that your Pull Request title adheres to our Conventional Commit standards
as described in CONTRIBUTING.md
Please update the Pull Request description to add relevant context or documentation about
the submitted change.
-->
## Description

Please provide a brief description of the changes introduced in this pull request.
What problem does it solve? What is the context of this change?

## How to Test

Please describe how you have tested these changes. Have you run the code against an example application?
What steps did you take to ensure that the changes are working correctly?

## Related Issues

Please include any related issues or pull requests in this section, using the format `Closes #<issue number>` or `Fixes #<issue number>` if applicable.
13 changes: 13 additions & 0 deletions lib/instrumentation/superagent/.github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 2
updates:
- package-ecosystem: "npm"
# Disable version updates for npm dependencies, security updates don't use this configuration
# See: https://docs.github.com/en/code-security/dependabot/dependabot-security-updates/configuring-dependabot-security-updates
open-pull-requests-limit: 0
directory: "/"
schedule:
interval: "daily"
commit-message:
prefix: "security"
prefix-development: "chore"
include: "scope"
14 changes: 14 additions & 0 deletions lib/instrumentation/superagent/.github/workflows/add-to-board.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Auto Assign to Project(s)

on:
issues:
types: [opened]
pull_request_target:
types: [opened]

jobs:
add-to-board:
uses: newrelic/node-newrelic/.github/workflows/board.yml@main
# See board.yml explaining why this has to be done
secrets:
gh_token: ${{ secrets.NODE_AGENT_GH_TOKEN }}
74 changes: 74 additions & 0 deletions lib/instrumentation/superagent/.github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: superagent Instrumentation CI

on: [push, pull_request, workflow_dispatch]

jobs:
lint:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [lts/*]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install Dependencies
run: npm install
- name: Run Linting
run: npm run lint
- name: Inspect Lockfile
run: npm run lint:lockfile

unit:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x, 18.x, 20.x]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install Dependencies
run: npm install
- name: Run Unit Tests
run: npm run unit
- name: Post Unit Test Coverage
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./coverage/unit/
files: lcov.info
flags: unit-tests-${{ matrix.node-version }}

versioned:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x, 18.x, 20.x]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install Dependencies
run: npm install
- name: Run Versioned Tests
run: npm run versioned
- name: Post Versioned Test Coverage
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./coverage/versioned/
files: lcov.info
flags: versioned-tests-${{ matrix.node-version }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Create Release

on: [workflow_dispatch]

jobs:
tag-and-publish:
uses: newrelic/node-newrelic/.github/workflows/release-creation.yml@main
with:
changelog_file: CHANGELOG.md
secrets:
npm_token: ${{ secrets.NODE_AGENT_NPM_TOKEN }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Prepare Release PR

on:
workflow_dispatch:
inputs:
release_type:
description: Type of release. patch or minor (major if breaking)
required: true
type: choice
default: patch
options:
- patch
- minor
- major

jobs:
release-notes:
uses: newrelic/node-newrelic/.github/workflows/prep-release.yml@main
with:
release_type: ${{ github.event.inputs.release_type }}
changelog_file: CHANGELOG.md
31 changes: 31 additions & 0 deletions lib/instrumentation/superagent/.github/workflows/repolinter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# NOTE: This file should always be named `repolinter.yml` to allow
# workflow_dispatch to work properly
name: Repolinter Action

# NOTE: This workflow will ONLY check the default branch!
# Currently there is no elegant way to specify the default
# branch in the event filtering, so branches are instead
# filtered in the "Test Default Branch" step.
on: [push, workflow_dispatch]

jobs:
repolint:
name: Run Repolinter
runs-on: ubuntu-latest
steps:
- name: Test Default Branch
id: default-branch
uses: actions/github-script@v6
with:
script: |
const data = await github.rest.repos.get(context.repo)
return data.data && data.data.default_branch === context.ref.split('/').slice(-1)[0]
- name: Checkout Self
if: ${{ steps.default-branch.outputs.result == 'true' }}
uses: actions/checkout@v3
- name: Run Repolinter
if: ${{ steps.default-branch.outputs.result == 'true' }}
uses: newrelic/repolinter-action@v1
with:
config_url: https://raw.githubusercontent.com/newrelic/.github/main/repolinter-rulesets/community-plus.yml
output_type: issue
53 changes: 53 additions & 0 deletions lib/instrumentation/superagent/.github/workflows/validate-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Validate Pull Request

permissions:
pull-requests: write

on:
pull_request:
types:
- opened
- edited
- synchronize

jobs:
validate-pr:
runs-on: ubuntu-latest
steps:
- name: Pull Request Title is Conventional
id: lint_pr_title
uses: amannn/action-semantic-pull-request@v5
with:
# Recommended Prefixes from https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/config-conventional/README.md#type-enum
types: |
build
chore
ci
docs
feat
fix
perf
refactor
revert
security
style
test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- if: failure()
name: Add PR comment if failed
uses: marocchino/sticky-pull-request-comment@v2
with:
header: pr-title-lint-error
message: |
Thank you for your contribution! We require all PR titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/).
Please update your PR title with the appropriate type and we'll try again!
```
${{ steps.lint_pr_title.outputs.error_message}}
```
- if: success()
name: Remove PR comment if valid
uses: marocchino/sticky-pull-request-comment@v2
with:
header: pr-title-lint-error
delete: true
64 changes: 64 additions & 0 deletions lib/instrumentation/superagent/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# Visual Studio Code files
.vscode

# JetBrains files
.idea
Loading

0 comments on commit d3cd679

Please sign in to comment.