Skip to content

Commit

Permalink
Merge branch 'develop' into ruby-agent/8-0-0-release-config-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
barbnewrelic committed Sep 22, 2021
2 parents 6d81be4 + bb8dfdf commit 13aea21
Show file tree
Hide file tree
Showing 1,337 changed files with 29,977 additions and 15,165 deletions.
24 changes: 24 additions & 0 deletions .github/auto_assign.yml
@@ -0,0 +1,24 @@
# Set to true to add reviewers to pull requests
addReviewers: true

# A list of reviewers to be added to pull requests (GitHub user name)
reviewers:
- bradleycamacho
- barbnewrelic
- paperclypse
- zuluecho9
- rhetoric101
- urbiz-nr
- x8a
- mmfred
- stumblefiend
- dbarnesbrownNR

# A number of reviewers added to the pull request
# Set 0 to add all the reviewers (default: 0)
numberOfReviewers: 1

filterLabels:
# Run
include:
- from_tw
4 changes: 2 additions & 2 deletions .github/stale.yml
@@ -1,7 +1,7 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 30
daysUntilStale: 90
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 10
daysUntilClose: 15
# Issues with these labels will never be considered stale
exemptLabels:
- security
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/auto-assign-reviewer.yml
@@ -0,0 +1,10 @@
name: 'Auto Assign'
on:
pull_request:
types: [opened, ready_for_review]

jobs:
add-reviews:
runs-on: ubuntu-latest
steps:
- uses: kentaro-m/auto-assign-action@v1.2.0
50 changes: 0 additions & 50 deletions .github/workflows/build-cache.yml

This file was deleted.

5 changes: 4 additions & 1 deletion .github/workflows/fetch-swiftype-content.yml
Expand Up @@ -90,7 +90,10 @@ jobs:
branch: 'main',
required_status_checks: {
strict: false,
contexts: ['build the docs site', 'unpaired translations removed']
contexts: [
'Gatsby Build Service - docs-website',
'unpaired translations removed'
]
},
restrictions: {
users: [],
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/update-whats-new-ids.yml
Expand Up @@ -83,7 +83,13 @@ jobs:
branch: 'develop',
required_status_checks: {
strict: false,
contexts: ['run linter', 'run tests', 'license/cla', 'unpaired translations removed']
contexts: [
'Gatsby Build Service - docs-website-develop',
'run linter',
'run tests',
'license/cla',
'unpaired translations removed'
]
},
restrictions: {
users: [],
Expand Down
41 changes: 1 addition & 40 deletions .github/workflows/validate-pr.yml
Expand Up @@ -11,45 +11,6 @@ env:
CHOKIDAR_USEPOLLING: 1

jobs:
build:
name: build the docs site
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 12

- name: Cache dependencies
id: yarn-cache
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }}

- name: Cache Gatsby build
uses: actions/cache@v2
with:
path: |
public
.cache
key: ${{ runner.os }}-gatsby-build-${{ github.run_id }}
restore-keys: |
${{ runner.os }}-gatsby-build-
- name: Install dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile

- name: Gatsby build
run: yarn build:production --log-pages
env:
GATSBY_EXPERIMENTAL_PAGE_BUILD_ON_DATA_CHANGES: true
CI: true

test:
name: run tests
runs-on: ubuntu-latest
Expand Down Expand Up @@ -128,4 +89,4 @@ jobs:
- name: check for outdated localized files
run: |
URL="https://api.github.com/repos/${GITHUB_REPOSITORY}/pulls/${{ github.event.pull_request.number }}/files"
yarn check-for-outdated-translations $URL
yarn check-for-outdated-translations $URL
15 changes: 12 additions & 3 deletions gatsby-config.js
Expand Up @@ -131,14 +131,21 @@ module.exports = {
return {
q: tags ? tags.map(quote).join(' OR ') : title,
search_fields: {
page: ['tags^10', 'body^5', 'title^1.5', '*'],
page: [
'tags^10',
'quick_start_name^8',
'body^5',
'title^1.5',
'*',
],
},
filters: {
page: {
type: [
`docs${postfix}`,
`developer${postfix}`,
`opensource${postfix}`,
`quick_starts${postfix}`,
],
document_type: [
'!views_page_menu',
Expand Down Expand Up @@ -488,17 +495,19 @@ module.exports = {
releaseDate(fromNow: false)
version
}
excerpt(pruneLength: 5000)
}
}
}
`,
path: '/api/agent-release-notes.json',
serialize: ({ data }) =>
data.allMdx.nodes
.map(({ frontmatter }) => ({
.map(({ frontmatter, excerpt }) => ({
agent: getAgentName(frontmatter.subject),
date: frontmatter.releaseDate,
version: frontmatter.version,
description: excerpt,
}))
.filter(({ date, agent }) => Boolean(date && agent)),
},
Expand All @@ -523,7 +532,7 @@ module.exports = {
{
resolve: 'gatsby-plugin-gatsby-cloud',
options: {
allPageHeaders: ['Referrer-Policy: strict-origin'],
allPageHeaders: ['Referrer-Policy: no-referrer-when-downgrade'],
},
},
],
Expand Down
9 changes: 5 additions & 4 deletions package.json
Expand Up @@ -9,7 +9,7 @@
"@github-docs/frontmatter": "^1.3.1",
"@mdx-js/mdx": "^2.0.0-next.8",
"@mdx-js/react": "^2.0.0-next.8",
"@newrelic/gatsby-theme-newrelic": "^2.5.0",
"@newrelic/gatsby-theme-newrelic": "^2.5.2",
"@splitsoftware/splitio-react": "^1.2.4",
"babel-jest": "^26.3.0",
"common-tags": "^1.8.0",
Expand All @@ -20,7 +20,7 @@
"gatsby-plugin-gatsby-cloud": "^2.8.1",
"gatsby-plugin-json-output": "^1.2.0",
"gatsby-plugin-manifest": "^3.8.0",
"gatsby-plugin-mdx": "^2.8.0",
"gatsby-plugin-mdx": "^2.13.0",
"gatsby-plugin-meta-redirect": "^1.1.1",
"gatsby-plugin-offline": "^4.8.0",
"gatsby-plugin-react-helmet": "^4.8.0",
Expand All @@ -41,8 +41,8 @@
"hast-util-select": "^4.0.2",
"hast-util-to-mdast": "^7.1.3",
"jest": "^26.6.3",
"jest-when": "^3.3.1",
"jest-emotion": "^10.0.32",
"jest-when": "^3.3.1",
"jsdom": "^16.5.0",
"lodash": "^4.17.21",
"parse-link-header": "^1.0.1",
Expand Down Expand Up @@ -151,7 +151,8 @@
"postinstall": "patch-package",
"extract-i18n": "i18next",
"get-translated-files": "node scripts/actions/add-files-to-translation-queue.js",
"check-for-outdated-translations": "node scripts/actions/check-for-outdated-translations.js"
"check-for-outdated-translations": "node scripts/actions/check-for-outdated-translations.js",
"verify-mdx": "node scripts/verify_mdx.js"
},
"husky": {
"hooks": {
Expand Down
5 changes: 5 additions & 0 deletions scripts/actions/utils/related-resources-helpers.js
Expand Up @@ -23,6 +23,10 @@ const stripTrailingSlash = (url) => {
exports.quote = (str) => `"${str}"`;

exports.uniq = (arr) => [...new Set(arr)];
const appendLeadingSlash = (url) =>
url.startsWith('/') || url.startsWith('!') || url.startsWith('https://')
? url
: `/${url}`;

exports.getExcludedUrls = (frontmatter, siteUrl) => {
const resources = frontmatter.resources || [];
Expand All @@ -31,6 +35,7 @@ exports.getExcludedUrls = (frontmatter, siteUrl) => {
return resources
.map((resource) => resource.url)
.concat(redirects)
.map(appendLeadingSlash)
.map((url) => (url.startsWith('/') ? siteUrl + url : url));
};

Expand Down
33 changes: 33 additions & 0 deletions scripts/verify_mdx.js
@@ -0,0 +1,33 @@
const mdx = require('@mdx-js/mdx');
const fs = require('fs');
const glob = require('glob');

const readFile = async (filePath) => {
try {
console.log(`reading ${filePath}`);
const mdxText = fs.readFileSync(filePath, 'utf8');
const jsx = mdx.sync(mdxText);
} catch (exception) {
console.log(JSON.stringify(exception, null, 4));
return filePath;
}
};

const main = async () => {
let filePaths = process.argv.slice(2);

if (filePaths.length === 0) {
// if user did not supply paths, default to all
filePaths = glob.sync(
`${__dirname}/../src{/content/**/*.mdx,/i18n/content/**/*.mdx}`
);
}

const allResults = await Promise.all(filePaths.map(readFile));
const results = allResults.filter(Boolean);

console.log(results);
console.log(`Failed file count: ${results.length}`);
};

main();
21 changes: 21 additions & 0 deletions src/components/NetworkPerformanceMonitoringBannerGA.js
@@ -0,0 +1,21 @@
import React from 'react';
import { css } from '@emotion/react';
import fsBanner from '../images/NPM_banner.png';

const NetworkPerformanceMonitoringBannerGA = () => {
return (
<section>
<a href="/docs/network-performance-monitoring/get-started/npm-introduction">
<img
css={css`
width: 100%;
`}
src={fsBanner}
alt="Get started with Network performance monitoring."
/>
</a>
</section>
);
};

export default NetworkPerformanceMonitoringBannerGA;
19 changes: 19 additions & 0 deletions src/components/SEO.js
Expand Up @@ -10,6 +10,23 @@ const METADATA = [
},
];

const crazyEgg = (location) => {
const { pathname } = location;
const homepage = '/';
const signup =
'/docs/accounts/accounts-billing/account-setup/create-your-new-relic-account/';

if (pathname === homepage || pathname === signup) {
return (
<script
type="text/javascript"
src="//script.crazyegg.com/pages/scripts/0045/9836.js"
async="async"
/>
);
}
};

const DocsSiteSeo = ({
location,
title,
Expand Down Expand Up @@ -55,6 +72,8 @@ const DocsSiteSeo = ({
{(description || title) && (
<meta name="description" content={description || title} />
)}

{crazyEgg(location)}
</SEO>
);

Expand Down
Expand Up @@ -7,12 +7,7 @@ tags:
metaDescription: 'For New Relic, how to set up SAML single sign-on (SSO) for multiple accounts.'
redirects:
- /docs/subscriptions/configuring-saml-with-multiple-accounts
- >-
/docs/accounts-partnerships/accounts/saml-single-sign/configuring-saml-multiple-accounts
watermark: |-
Original
user
model
- /docs/accounts-partnerships/accounts/saml-single-sign/configuring-saml-multiple-accounts
---

<Callout variant="important">
Expand Down

0 comments on commit 13aea21

Please sign in to comment.