Skip to content

Commit bfdc9a5

Browse files
committed
Merge remote-tracking branch 'next-js/main' into merge-nextjs-instrumentation
2 parents b9f64b7 + 0c4b476 commit bfdc9a5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+4771
-0
lines changed

merged/nextjs/.c8rc.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"reporter": ["html", "lcov"],
3+
"all": true,
4+
"exclude": ["tests/*", "coverage/*", ".eslintrc.js"]
5+
}

merged/nextjs/.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
**/node_modules/**

merged/nextjs/.eslintrc.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
* Copyright 2021 New Relic Corporation. All rights reserved.
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
'use strict'
7+
module.exports = {
8+
extends: '@newrelic',
9+
parserOptions: {
10+
ecmaVersion: 2020
11+
},
12+
ignorePatterns: ['tests/versioned/app', 'tests/versioned/app-dir']
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
name: "Bug report \U0001F41B"
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: bug, needs-triage
6+
assignees: ''
7+
8+
---
9+
10+
[NOTE]: # ( ^^ Provide a general summary of the issue in the title above. ^^ )
11+
12+
## Description
13+
14+
[NOTE]: # ( Describe the problem you're encountering. )
15+
[TIP]: # ( Do NOT share sensitive information, whether personal, proprietary, or otherwise! )
16+
17+
## Expected Behavior
18+
19+
[NOTE]: # ( Tell us what you expected to happen. )
20+
21+
## [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
22+
23+
[NOTE]: # ( Provide any other relevant log data. )
24+
[TIP]: # ( Scrub logs and diagnostic information for sensitive information )
25+
26+
## Steps to Reproduce
27+
28+
[NOTE]: # ( Please be as specific as possible. )
29+
[TIP]: # ( Link a sample application that demonstrates the issue. )
30+
31+
## Your Environment
32+
33+
[TIP]: # ( Include as many relevant details about your environment as possible. )
34+
35+
* ex: Browser name and version:
36+
* ex: Node version:
37+
* ex: Operating System and version:
38+
39+
## Additional context
40+
41+
[TIP]: # ( Add any other context about the problem here. For example, relevant community posts or support tickets. )
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Troubleshooting
4+
url: https://github.com/newrelic/newrelic-node-nextjs/blob/main/README.md#support
5+
about: Check out the README for troubleshooting directions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: 'feature-request, needs-triage'
6+
assignees: ''
7+
priority: ''
8+
---
9+
10+
## Is your feature request related to a problem? Please describe.
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
## Feature Description
14+
A clear and concise description of the feature you want or need.
15+
16+
## Describe Alternatives
17+
A clear and concise description of any alternative solutions or features you've considered. Are there examples you could link us to?
18+
19+
## Additional context
20+
Add any other context here.
21+
22+
## Priority
23+
Please help us better understand this feature request by choosing a priority from the following options:
24+
[Nice to Have, Really Want, Must Have, Blocker]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<!--
2+
Thank you for submitting a Pull Request.
3+
4+
This code is leveraged to monitor critical services. Please consider the following:
5+
* Tests are required.
6+
* Performance matters.
7+
* Features that are specific to just your app are unlikely to make it in.
8+
9+
Ensure that your Pull Request title adheres to our Conventional Commit standards
10+
as described in CONTRIBUTING.md
11+
12+
Please update the Pull Request description to add relevant context or documentation about
13+
the submitted change.
14+
-->
15+
## Description
16+
17+
Please provide a brief description of the changes introduced in this pull request.
18+
What problem does it solve? What is the context of this change?
19+
20+
## How to Test
21+
22+
Please describe how you have tested these changes. Have you run the code against an example application?
23+
What steps did you take to ensure that the changes are working correctly?
24+
25+
## Related Issues
26+
27+
Please include any related issues or pull requests in this section, using the format `Closes #<issue number>` or `Fixes #<issue number>` if applicable.

merged/nextjs/.github/dependabot.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "npm"
4+
# Disable version updates for npm dependencies, security updates don't use this configuration
5+
# See: https://docs.github.com/en/code-security/dependabot/dependabot-security-updates/configuring-dependabot-security-updates
6+
open-pull-requests-limit: 0
7+
directory: "/"
8+
schedule:
9+
interval: "daily"
10+
commit-message:
11+
prefix: "security"
12+
prefix-development: "chore"
13+
include: "scope"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Auto Assign to Project(s)
2+
3+
on:
4+
issues:
5+
types: [opened]
6+
pull_request_target:
7+
types: [opened]
8+
9+
jobs:
10+
add-to-board:
11+
uses: newrelic/node-newrelic/.github/workflows/board.yml@main
12+
# See board.yml explaining why this has to be done
13+
secrets:
14+
gh_token: ${{ secrets.NODE_AGENT_GH_TOKEN }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Next.js Instrumentation CI
2+
3+
on: [push, pull_request, workflow_dispatch]
4+
5+
env:
6+
# Enable versioned runner quiet mode to make CI output easier to read:
7+
OUTPUT_MODE: quiet
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [lts/*]
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
- name: Use Node.js ${{ matrix.node-version }}
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: ${{ matrix.node-version }}
23+
- name: Install Dependencies
24+
run: npm install
25+
- name: Run Linting
26+
run: npm run lint
27+
- name: Inspect Lockfile
28+
run: npm run lint:lockfile
29+
30+
unit:
31+
runs-on: ubuntu-latest
32+
33+
strategy:
34+
matrix:
35+
node-version: [16.x, 18.x, 20.x, 22.x]
36+
37+
steps:
38+
- uses: actions/checkout@v3
39+
- name: Use Node.js ${{ matrix.node-version }}
40+
uses: actions/setup-node@v3
41+
with:
42+
node-version: ${{ matrix.node-version }}
43+
- name: Install Dependencies
44+
run: npm install
45+
- name: Run Unit Tests
46+
run: npm run unit
47+
- name: Post Unit Test Coverage
48+
uses: codecov/codecov-action@v3
49+
with:
50+
token: ${{ secrets.CODECOV_TOKEN }}
51+
directory: ./coverage/unit/
52+
files: lcov.info
53+
flags: unit-tests-${{ matrix.node-version }}
54+
55+
versioned:
56+
runs-on: ubuntu-latest
57+
58+
strategy:
59+
matrix:
60+
node-version: [16.x, 18.x, 20.x, 22.x]
61+
62+
steps:
63+
- uses: actions/checkout@v3
64+
- name: Use Node.js ${{ matrix.node-version }}
65+
uses: actions/setup-node@v3
66+
with:
67+
node-version: ${{ matrix.node-version }}
68+
- name: Install Dependencies
69+
run: npm install
70+
- name: Run Versioned Tests
71+
run: npm run versioned
72+
- name: Post Versioned Test Coverage
73+
uses: codecov/codecov-action@v3
74+
with:
75+
token: ${{ secrets.CODECOV_TOKEN }}
76+
directory: ./coverage/versioned/
77+
files: lcov.info
78+
flags: versioned-tests-${{ matrix.node-version }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Create Release
2+
3+
on: [workflow_dispatch]
4+
5+
jobs:
6+
tag-and-publish:
7+
uses: newrelic/node-newrelic/.github/workflows/release-creation.yml@main
8+
with:
9+
changelog_file: CHANGELOG.md
10+
secrets:
11+
npm_token: ${{ secrets.NODE_AGENT_NPM_TOKEN }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Prepare Release PR
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
release_type:
7+
description: Type of release. patch or minor (major if breaking)
8+
required: true
9+
type: choice
10+
default: patch
11+
options:
12+
- patch
13+
- minor
14+
- major
15+
16+
jobs:
17+
release-notes:
18+
uses: newrelic/node-newrelic/.github/workflows/prep-release.yml@main
19+
with:
20+
release_type: ${{ github.event.inputs.release_type }}
21+
changelog_file: CHANGELOG.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# NOTE: This file should always be named `repolinter.yml` to allow
2+
# workflow_dispatch to work properly
3+
name: Repolinter Action
4+
5+
# NOTE: This workflow will ONLY check the default branch!
6+
# Currently there is no elegant way to specify the default
7+
# branch in the event filtering, so branches are instead
8+
# filtered in the "Test Default Branch" step.
9+
on: [push, workflow_dispatch]
10+
11+
jobs:
12+
repolint:
13+
name: Run Repolinter
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Test Default Branch
17+
id: default-branch
18+
uses: actions/github-script@v6
19+
with:
20+
script: |
21+
const data = await github.rest.repos.get(context.repo)
22+
return data.data && data.data.default_branch === context.ref.split('/').slice(-1)[0]
23+
- name: Checkout Self
24+
if: ${{ steps.default-branch.outputs.result == 'true' }}
25+
uses: actions/checkout@v3
26+
- name: Run Repolinter
27+
if: ${{ steps.default-branch.outputs.result == 'true' }}
28+
uses: newrelic/repolinter-action@v1
29+
with:
30+
config_url: https://raw.githubusercontent.com/newrelic/.github/main/repolinter-rulesets/community-plus.yml
31+
output_type: issue
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Validate Pull Request
2+
3+
permissions:
4+
pull-requests: write
5+
6+
on:
7+
pull_request:
8+
types:
9+
- opened
10+
- edited
11+
- synchronize
12+
13+
jobs:
14+
validate-pr:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Pull Request Title is Conventional
18+
id: lint_pr_title
19+
uses: amannn/action-semantic-pull-request@v5
20+
with:
21+
# Recommended Prefixes from https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/config-conventional/README.md#type-enum
22+
types: |
23+
build
24+
chore
25+
ci
26+
docs
27+
feat
28+
fix
29+
perf
30+
refactor
31+
revert
32+
security
33+
style
34+
test
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
- if: failure()
38+
name: Add PR comment if failed
39+
uses: marocchino/sticky-pull-request-comment@v2
40+
with:
41+
header: pr-title-lint-error
42+
message: |
43+
Thank you for your contribution! We require all PR titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/).
44+
Please update your PR title with the appropriate type and we'll try again!
45+
```
46+
${{ steps.lint_pr_title.outputs.error_message}}
47+
```
48+
- if: success()
49+
name: Remove PR comment if valid
50+
uses: marocchino/sticky-pull-request-comment@v2
51+
with:
52+
header: pr-title-lint-error
53+
delete: true

0 commit comments

Comments
 (0)