Git Product home page Git Product logo

newrelic / nr1-github Goto Github PK

View Code? Open in Web Editor NEW
18.0 29.0 26.0 6.16 MB

NR1 Github allows you to create more context to your entities by having access to the GitHub repository, contributors and README.

Home Page: https://github.com/newrelic/nr1-github/discussions

License: Apache License 2.0

JavaScript 70.65% SCSS 29.35%
newrelic nerdpack apm browser mobile nr1 nr1-github nrlabs nrlabs-viz

nr1-github's Introduction

New Relic One Catalog Project header

GitHub Integration

CI GitHub release (latest SemVer including pre-releases) Snyk

Usage

GitHub Integration connects services and applications in New Relic to an associated GitHub repository.

The GitHub Integration application will display quick access to the repository, a list of the most active source code contributors and the README.

This information is easily accessible in context when looking at individual services or applications.

Screen Shots

screenshot 1

screenshot 2

screenshot 3

screenshot 4

screenshot 5

Dependencies

Using GitHub Personal Access Tokens

Integration with GitHub requires the user to create or use a private access token as a one-time setup step. This GitHub personal access token increases security, because it ensures each user can only see repositories they have access to. New Relic will store that access token, but the user can easily delete it from New Relic's storage at any time.

We recommend creating a dedicated personal access token for this application only, and you should give that token read only permissions. See GitHub's doc on access tokens for full instructions.

Personal access tokens are stored in New Relic's NerdStorageVault, and are accessible only to the user account that stored it, and the Nerdpack which created it. The data is encrypted in transmission and at rest (within the underlying database).

Setting GitHub URL

To keep your Personal Access Token secure, you are no longer able to set an account-wide GitHub URL. GitHub URLs are now scoped to an individual user. If a URL has been setup by someone in your account, it will be suggested to you and you can choose to set it if you trust the source.

Enabling this App

This App is available via the New Relic Catalog.

To enable it in your account, go to Add Data > Apps and Visualzations and search for "Github Integration". Click the Github Integration card, and then click the Add this App button to add it to your account(s).

Once subscribed:

  1. navigate to an APM, Browser or Mobile app via the Entity Explorer in New Relic One
  2. locate and click the Github Integration menu item in the secondary left-nav, found under More Views (note: on the first time accessing the app, you may be prompted to enable it)

Manual Deployment

If you need to customize the app, fork the codebase and follow the instructions on how to Customize a Nerdpack. If you have a change you feel everyone can benefit from, please submit a PR!

Support

This project is actively maintained by the New Relic Labs team. Connect with us directly by creating issues or asking questions in the discussions section of this repo.

We also encourage you to bring your experiences and questions to the Explorers Hub where our community members collaborate on solutions and new ideas.

New Relic has open-sourced this project, which is provided AS-IS WITHOUT WARRANTY OR DEDICATED SUPPORT.

Security

As noted in our 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.

Contributing

Contributions are welcome (and if you submit a Enhancement Request, expect to be invited to contribute it yourself ๐Ÿ˜). Please review our Contributors Guide.

Keep in mind that when you submit your pull request, you'll need to sign the CLA via the click-through using CLA-Assistant. If you'd like to execute our corporate CLA, or if you have any questions, please drop us an email at [email protected].

Open Source License

This project is distributed under the Apache 2 license.

nr1-github's People

Contributors

aso1124 avatar aswanson-nr avatar austin-schaefer avatar cirne avatar danielgolden avatar devfreddy avatar jaesius avatar jbeveland27 avatar lindsayculver avatar lizbaker avatar mbazhlekova avatar michellosier avatar moonlight-komorebi avatar nr-opensource-bot avatar prototypicalpro avatar rudouglas avatar shahramk avatar tangollama avatar zstix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nr1-github's Issues

"Github Repo" link appears twice in side bar in staging

This was identified during our company wide bug hunt quality event, so it's higher priority.

Please see the JIRA issue for a lot more details

Related issue: JIRA DEVEX-2336

Steps to reproduce

  1. Go to staging > browser applications > more views
  2. see 2 entries for Github Repo

Expected

Only 1 entry for github repo is visible.

Screen shot

index

incorrect docs

in the deploy section, the instructions reference:

run nr1 credentials:list

which is not valid.

upgrade eslint

rm -r node_modules
npm uninstall eslint
npm install --save-dev eslint

[Repolinter] Open Source Policy Issues

Repolinter Report

๐Ÿค–This issue was automatically generated by repolinter-action, developed by the Open Source and Developer Advocacy team at New Relic. This issue will be automatically updated or closed when changes are pushed. If you have any problems with this tool, please feel free to open a GitHub issue or give us a ping in #help-opensource.

This Repolinter run generated the following results:

โ— Error โŒ Fail โš ๏ธ Warn โœ… Pass Ignored Total
0 2 0 11 0 13

Fail #

โŒ readme-starts-with-nr1-catalog-header #

The README of a community plus project should have a NR1 Catalog header at the start of the README. If you already have a NR1 Catalog header and this rule is failing, your header may be out of date, and you should update your header with the suggested one below. For more information please visit https://opensource.newrelic.com/oss-category/. Below is a list of files or patterns that failed:

  • README.md: The first 1 lines do not contain the pattern(s): Open source NR1 Catalog header (see https://opensource.newrelic.com/oss-category).
    • ๐Ÿ”จ Suggested Fix: prepend the latest code snippet found at https://github.com/newrelic/opensource-website/wiki/Open-Source-Category-Snippets#code-snippet-3 to file

โŒ readme-contains-forum-topic #

Doesn't contain a link to the appropriate forum.newrelic.com topic (README.md). New Relic recommends directly linking the your appropriate forum.newrelic.com topic in the README, allowing developer an alternate method of getting support. For more information please visit https://nerdlife.datanerd.us/new-relic/security-guidelines-for-publishing-source-code.

Passed #

Click to see rules

โœ… license-file-exists #

Found file (LICENSE). New Relic requires that all open source projects have an associated license contained within the project. This license must be permissive (e.g. non-viral or copyleft), and we recommend Apache 2.0 for most use cases. For more information please visit https://docs.google.com/document/d/1vML4aY_czsY0URu2yiP3xLAKYufNrKsc7o4kjuegpDw/edit.

โœ… readme-file-exists #

Found file (README.md). New Relic requires a README file in all projects. This README should give a general overview of the project, and should point to additional resources (security, contributing, etc.) where developers and users can learn further. For more information please visit https://github.com/newrelic/open-source-tools/tree/master/javascript/oss-template.

โœ… readme-contains-security-section #

Contains a security section (README.md). New Relic recommends having a Security section in your README to address concerns such as vulnerability reporting. This security section should also contain a link to the security policy (found under the "Security" tab of the repository). For an example of this section, please see the NR1 Catalog Template. For more information please visit https://nerdlife.datanerd.us/new-relic/security-guidelines-for-publishing-source-code.

โœ… readme-contains-link-to-security-policy #

Contains a link to the security policy for this repository (README.md). New Relic recommends referencing the open source security policy (https://github.com/newrelic/<repo-name>/security/policy or ../../security/policy) in a Security section in the README. For an example of this, please see the NR1 Catalog Template. For more information please visit https://nerdlife.datanerd.us/new-relic/security-guidelines-for-publishing-source-code.

โœ… third-party-notices-file-exists #

Found file (THIRD_PARTY_NOTICES.md). A THIRD_PARTY_NOTICES.md file must be present to grant attribution to all dependencies being used by this project. For JavaScript projects, you can generate this file using the oss-cli. For more information please visit https://docs.google.com/document/d/1y644Pwi82kasNP5VPVjDV8rsmkBKclQVHFkz8pwRUtE/view.

โœ… code-of-conduct-should-not-exist-here #

New Relic has moved the CODE_OF_CONDUCT file to a centralized location where it is referenced automatically by every repository in the New Relic organization. Because of this change, any other CODE_OF_CONDUCT file in a repository is now redundant and should be removed. For more information please visit https://docs.google.com/document/d/1y644Pwi82kasNP5VPVjDV8rsmkBKclQVHFkz8pwRUtE/view. Did not find a file matching the specified patterns. All files passed this test.

โœ… github-actions-workflow-file-exists #

Found file (.github/workflows/catalog.yml). Any Community Plus project must integrate with GitHub actions. For more information please visit https://docs.google.com/document/d/1y644Pwi82kasNP5VPVjDV8rsmkBKclQVHFkz8pwRUtE/view.

โœ… nr1-catalog-config-file-exists #

Found file (catalog/config.json).

โœ… nr1-catalog-screenshots-directory-exists #

Found file (catalog/screenshots).

โœ… nr1-catalog-documentation-file-exists #

Found file (catalog/documentation.md).

โœ… package-scripts-present #

An eslint-check and eslint-fix npm script found in file (package.json). NPM scripts for ESLint (eslint-check and eslint-fix) are required to properly integrate with the nerdpack system.

Github Enterprise and Github.com

Summary

The Github API for Github Enterprise is available at a different endpoint than that of public Github.com. At a minimum we need to account for this so this Nerdpack can be utilized for Github.com, ideally we'd rework functionality so you could connect to multiple API's to pull in results from multiple GHE and Github.com (orgs).

Github Enterprise talks to:

http(s)://[hostname]/api/v3

Github.com is available at:
https://api.github.com

Desired Behaviour

Toggle for the user based on the configured/provided Github instance

Possible Solution

Examine the configured GITHUB_URL, and toggle between the endpoints based on github.com vs. not.

Additional context

Build error when publishing

Description

I've installed Nerdpack, set up profile and generated uuid.
But when I type nr1 nerdpack:publish it all seems fine in this window, but back in the server terminal I see the following error:
ERROR in ./tmp/a355d06d-21ef-44eb-89e0-3ce37309af61-styles.1596193331921.scss
See more below.
It seems to be running but when I connect to a GitHub repo I get Oops, something went wrong message without any further info.

Found and loaded 1 nr1.json files on GitHub Integration (a355d06d-21ef-44eb-89e0-3ce37309af61) Nerdpack.

Nerdpack:
 โœ”  GitHub Integration (a355d06d-21ef-44eb-89e0-3ce37309af61) nr1.json

Nerdlets:
 โœ”  github nerdlets/github-about/nr1.json

๐Ÿ›   Built artifact files for:
 โŽ  a355d06d-21ef-44eb-89e0-3ce37309af61--github built โœ”

 โœ”  Nerdpack built successfully!

Publishing Nerdpack GitHub Integration (a355d06d-21ef-44eb-89e0-3ce37309af61)
 โœ”  Nerdpack published successfully!
 โœ”  Deployed a355d06d-21ef-44eb-89e0-3ce37309af61 version 0.6.3 to the STABLE channel.

Steps to Reproduce

nr1 nerdpack:clone -r https://github.com/newrelic/nr1-github.git
cd nr1-github/
nr1 nerdpack:serve

Other terminal

nr1 nerdpack:publish

Expected Behaviour

Publish nerdpack without error

Relevant Logs / Console output

๐Ÿ›   Built artifact files for:
 โŽ  a355d06d-21ef-44eb-89e0-3ce37309af61--github built โœ”

 โœ”  Nerdpack built successfully!
Hash: ec7f7e306b1e1ff3a570
Version: webpack 4.42.1
Child
    Hash: ec7f7e306b1e1ff3a570
    Time: 24ms
    Built at: 07/31/2020 12:03:31 PM
                                                  Asset      Size                                        Chunks                   Chunk Names
        a355d06d-21ef-44eb-89e0-3ce37309af61--styles.js  5.32 KiB  a355d06d-21ef-44eb-89e0-3ce37309af61--styles  [emitted]        a355d06d-21ef-44eb-89e0-3ce37309af61--styles
    a355d06d-21ef-44eb-89e0-3ce37309af61--styles.js.map  3.72 KiB  a355d06d-21ef-44eb-89e0-3ce37309af61--styles  [emitted] [dev]  a355d06d-21ef-44eb-89e0-3ce37309af61--styles
    Entrypoint a355d06d-21ef-44eb-89e0-3ce37309af61--styles = a355d06d-21ef-44eb-89e0-3ce37309af61--styles.js a355d06d-21ef-44eb-89e0-3ce37309af61--styles.js.map
    [./tmp/a355d06d-21ef-44eb-89e0-3ce37309af61-styles.1596193331921.scss] 1.05 KiB {a355d06d-21ef-44eb-89e0-3ce37309af61--styles} [built] [failed] [1 error]

    ERROR in ./tmp/a355d06d-21ef-44eb-89e0-3ce37309af61-styles.1596193331921.scss
    Module build failed (from /usr/lib64/newrelic-cli/node_modules/mini-css-extract-plugin/dist/loader.js):
    ModuleBuildError: Module build failed (from /usr/lib64/newrelic-cli/node_modules/fast-sass-loader/lib/index.js):
    Error: ENOENT: no such file or directory, open '/home/zfejer/nr1-github/tmp/a355d06d-21ef-44eb-89e0-3ce37309af61-styles.1596193331921.scss'
        at runLoaders (/usr/lib64/newrelic-cli/node_modules/webpack/lib/NormalModule.js:316:20)
        at /usr/lib64/newrelic-cli/node_modules/loader-runner/lib/LoaderRunner.js:367:11
        at Array.<anonymous> (/usr/lib64/newrelic-cli/node_modules/loader-runner/lib/LoaderRunner.js:203:19)
        at Storage.finished (/usr/lib64/newrelic-cli/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)
        at ReadFileContext.provider (/usr/lib64/newrelic-cli/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9)
        at ReadFileContext.callback (/usr/lib64/newrelic-cli/node_modules/graceful-fs/graceful-fs.js:115:16)
        at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:237:13)
    Child mini-css-extract-plugin ../../../usr/lib64/newrelic-cli/node_modules/css-loader/dist/cjs.js??ref--5-1!../../../usr/lib64/newrelic-cli/node_modules/postcss-loader/src/index.js??postcss!../../../usr/lib64/newrelic-cli/node_modules/fast-sass-loader/lib/index.js!tmp/a355d06d-21ef-44eb-89e0-3ce37309af61-styles.1596193331921.scss:
        Entrypoint mini-css-extract-plugin = *
        [../../../usr/lib64/newrelic-cli/node_modules/css-loader/dist/cjs.js?!../../../usr/lib64/newrelic-cli/node_modules/postcss-loader/src/index.js?!../../../usr/lib64/newrelic-cli/node_modules/fast-sass-loader/lib/index.js!./tmp/a355d06d-21ef-44eb-89e0-3ce37309af61-styles.1596193331921.scss] /usr/lib64/newrelic-cli/node_modules/css-loader/dist/cjs.js??ref--5-1!/usr/lib64/newrelic-cli/node_modules/postcss-loader/src??postcss!/usr/lib64/newrelic-cli/node_modules/fast-sass-loader/lib!./tmp/a355d06d-21ef-44eb-89e0-3ce37309af61-styles.1596193331921.scss 255 bytes {mini-css-extract-plugin} [built] [failed] [1 error]

        ERROR in ./tmp/a355d06d-21ef-44eb-89e0-3ce37309af61-styles.1596193331921.scss (/usr/lib64/newrelic-cli/node_modules/css-loader/dist/cjs.js??ref--5-1!/usr/lib64/newrelic-cli/node_modules/postcss-loader/src??postcss!/usr/lib64/newrelic-cli/node_modules/fast-sass-loader/lib!./tmp/a355d06d-21ef-44eb-89e0-3ce37309af61-styles.1596193331921.scss)
        Module build failed (from /usr/lib64/newrelic-cli/node_modules/fast-sass-loader/lib/index.js):
        Error: ENOENT: no such file or directory, open '/home/zfejer/nr1-github/tmp/a355d06d-21ef-44eb-89e0-3ce37309af61-styles.1596193331921.scss'

Your Environment

  • NR1 CLI version used: @datanerd/nr1/1.22.2 linux-x64 node-v10.16.3
  • Browser name and version: Firefox v78.0.2
  • Operating System and version: Windows 10, WSL2 Amazon linux 2

Additional context

A user can no longer set a GitHub URL universally for an org

A user can no longer set a GitHub URL universally, each user must set this individually, and they are stored in that users secrets vault. This prevents one user from setting the GitHub URL to a fake server, and stealing another users PAT when they use the NerdPack

Acceptance Criteria

  • A user sets a PAT and now in order for them to have access to the Repo each person needs to configure their own instance of the github url and repo url.
  • Review the repo readme and update if necessary.
  • confirm if this change will break any existing users github configurations.
  • When the nerdpack version is updated provide a warning message that notifies the user of this change. - We may not need to do this if we can ensure we aren't breaking any existing configurations for users.

Fix nerdpack vulnerability

We had a report of a vulnerability in this nerdpack that we'll want to resolve. please refer to the internal JIRA issue for specifics

Acceptance Criteria

  • see Ticket ID: jira/INFOSEC-3204
  • resolve issue
  • deploy the update via the catalog manager to the EU / Stage and Prod env

Install Error - PATH not updated, Original length 1171 > 1024

Description

When I try to install the CLI using the installer I get an error that says PATH not updated, Original length 1171 > 1024
NOTE: # ( Describe the problem you're encountering. )
TIP: # ( Do NOT give us access or passwords to your New Relic account or API keys! )

Steps to Reproduce

Download installer from https://one.newrelic.com/launcher/developer-center.launcher and follow normal steps of install
NOTE: # ( Please be as specific as possible. )

Expected Behaviour

Software is installed and path is updated
NOTE: # ( Tell us what you expected to happen. )

Relevant Logs / Console output

The download log looks like everything is installed but this is at the end of the log.
Output folder: C:\Program Files\newrelic-cli
Created uninstaller: C:\Program Files\newrelic-cli\Uninstall.exe
AddToPath: original length 1171 > 1024
ExecShell:
Completed
NOTE: # ( Please provide specifics of the local error logs, Browser Dev Tools console, etc. if appropriate and possible. )

Your Environment

  • NR1 CLI version used: Trying to install nr1 CLI 1.2.2
  • Browser name and version: Chrome
  • Operating System and version: Windows 10 Enterprise

Additional context

fix: Catch Unauthorized error from Github

Description

Steps to Reproduce

  1. Create a Personal Access Token
  2. Login to New Relic
  3. Visit the Entity Explorer
  4. Select a specific Entity
  5. Visit the Github Repo view from the left-hand side
  6. Configure the app by setting your Personal Access Token and Github URL
  7. Choose a repository for this entity
  8. Delete the Personal Access Token from Github
  9. Page errors out because a repository is set, but the token your using now generates an unauthorized message from Github

From this point, for this entity, you are stuck, unless you modify NerdStorage via the GraphiQL or the newrelic-cli. We aren't appropriately catching this specific error.

Expected Behaviour

Error should be caught, and you should be redirected to update your Personal Access Token.

Relevant Logs / Console output

401 Unauthorized

nr-loader-spa-current.min.js:1 Uncaught TypeError: r.map is not a function
    at u.value (nr3.nr-ext.net/artifact-index-production/4ee1cd5f-0f5e-4326-b153-5468c888ba8d/0.6.3/4ee1cd5f-0f5e-4326-b153-5468c888ba8d--github.js:1)
    at finishClassComponent (nr1.nr-assets.net/lib/react/16.6.3/react-dom.development.js:14425)
    at updateClassComponent (nr1.nr-assets.net/lib/react/16.6.3/react-dom.development.js:14388)
    at beginWork (nr1.nr-assets.net/lib/react/16.6.3/react-dom.development.js:15206)
    at performUnitOfWork (nr1.nr-assets.net/lib/react/16.6.3/react-dom.development.js:17944)
    at workLoop (nr1.nr-assets.net/lib/react/16.6.3/react-dom.development.js:17984)
    at renderRoot (nr1.nr-assets.net/lib/react/16.6.3/react-dom.development.js:18070)
    at performWorkOnRoot (nr1.nr-assets.net/lib/react/16.6.3/react-dom.development.js:18961)
    at performWork (nr1.nr-assets.net/lib/react/16.6.3/react-dom.development.js:18873)
    at performSyncWork (nr1.nr-assets.net/lib/react/16.6.3/react-dom.development.js:18847)
Error: Error code 401 when connecting to Github server (https://api.github.com). Response: {
  "message": "Bad credentials",
  "documentation_url": "https://docs.github.com/rest"
}

    at e.<anonymous> (nr3.nr-ext.net/artifact-index-production/4ee1cd5f-0f5e-4326-b153-5468c888ba8d/0.6.3/4ee1cd5f-0f5e-4326-b153-5468c888ba8d--github.js:1)
    at a (nr3.nr-ext.net/artifact-index-production/4ee1cd5f-0f5e-4326-b153-5468c888ba8d/0.6.3/vendors~4ee1cd5f-0f5e-4326-b153-5468c888ba8d--vendors.js:7)
    at Generator._invoke (nr3.nr-ext.net/artifact-index-production/4ee1cd5f-0f5e-4326-b153-5468c888ba8d/0.6.3/vendors~4ee1cd5f-0f5e-4326-b153-5468c888ba8d--vendors.js:7)
    at Generator.forEach.t.<computed> [as next] (nr3.nr-ext.net/artifact-index-production/4ee1cd5f-0f5e-4326-b153-5468c888ba8d/0.6.3/vendors~4ee1cd5f-0f5e-4326-b153-5468c888ba8d--vendors.js:7)
    at e (nr3.nr-ext.net/artifact-index-production/4ee1cd5f-0f5e-4326-b153-5468c888ba8d/0.6.3/vendors~4ee1cd5f-0f5e-4326-b153-5468c888ba8d--vendors.js:1)
    at c (nr3.nr-ext.net/artifact-index-production/4ee1cd5f-0f5e-4326-b153-5468c888ba8d/0.6.3/vendors~4ee1cd5f-0f5e-4326-b153-5468c888ba8d--vendors.js:1)

Your Environment

  • NR1 CLI version used:
  • Browser name and version:
  • Operating System and version:

Additional context

When an entity doesn't have a name, the RepoPicker fails

Description

When entity.name is null, we're not showing an input to set the repo URL.

Steps to Reproduce

Navigate to an Entity and click GitHub Repo

Expected Behaviour

Show message and input.

Relevant Logs / Console output

Your Environment

  • NR1 CLI version used: 1.2.1
  • Browser name and version: Chrome
  • Operating System and version: MacOS

Fix other nerdpack vulnerability

We had a report of a vulnerability in this nerdpack that we'll want to resolve. please refer to the internal JIRA issue for specifics

Acceptance Criteria

  • see Ticket ID: jira/INFOSEC-3218
  • resolve issue
  • deploy the update via the catalog manager to the EU / Stage and Prod env

Improve user expierence with setting public github URLS

Summary

When a user decided to set a public URL for Github, the interface is a little misleading as they can change the URL in the URL field. But in actuality they should leave the URL set to the default of: https://api.github.com. By leaving this field open to edits, we allow the user to potentially get into a bad state by allowing them to set a distinct URL for the repo as they would when using Enterprise Github.

Desired Behavior

  1. When a user choices to set a public github URL, ensure the field can't be edited.
  2. Change the language in the first things first section to more explicit.

"Let's get you started! Set up this Nerdpack by configuring your organization's GitHub URL. If you are hosting your source code on a public Github repository you will use https://api.github.com. If you are hosting your source code on a private Github Enterprise repository provide that URL below."

  1. After this is set for a user, route the user to the README.md tab in the application so it's clear the URL has been set. This will show the user the README.md has been fetched correctly.

Screen Shot 2020-10-05 at 1 52 14 PM

Upgrade the project meta data to support new catalog commands

Add metadata to the repository that matches the example laid out here.

  • Add a config.json file to a catalog directory in the repo root, matching this format.
  • Move the /screenshots directory into catalog:
    • Update the screenshot file names (to match this format)
    • Update the screenshot links in the README.md.
  • (Optional) If there's additional documentation referenced in the repo, add a additionalInfo.md file to a catalog directory in the repo root, matching this format.
  • Add one or more screenshots to a catalog/screenshots directory in the repo root, matching this format.
  • Update the relative paths in documentation.md to be absolute paths
  • Add the new header image to the top of README.md and catalog/documentation.md.
  • Ensure the README.md commands section matches this.
  • Run npm start and let the CLI move the nr1.json
    • Edit that file to make sure the name and description make sense.

GitLab support

Would like to see GitLab support for this or a dedicated nr1-gitlab pack created.

Dashboard widget for PRs/issues

Summary

It would be nice to add a dashboard widget that shows open PRs/issues on a dashboard.
Perhaps also events for new commits etc.

Desired Behaviour

Adding a new widget to the dashboard with a possibility to customize the query e.g. show open prs in organization x or prs assigned to user y.

Additional context

Would be nice for creating a devops dashboard.

[Repolinter] Open Source Policy Issues

Repolinter Report

๐Ÿค–This issue was automatically generated by repolinter-action, developed by the Open Source and Developer Advocacy team at New Relic. This issue will be automatically updated or closed when changes are pushed. If you have any problems with this tool, please feel free to open a GitHub issue or give us a ping in #help-opensource.

This Repolinter run generated the following results:

โ— Error โŒ Fail โš ๏ธ Warn โœ… Pass Ignored Total
0 1 0 12 0 13

Fail #

โŒ code-of-conduct-file-does-not-exist #

New Relic has moved the CODE_OF_CONDUCT file to a centralized location where it is referenced automatically by every repository in the New Relic organization. Because of this change, any other CODE_OF_CONDUCT file in a repository is now redundant and should be removed. For more information please visit https://docs.google.com/document/d/1y644Pwi82kasNP5VPVjDV8rsmkBKclQVHFkz8pwRUtE/view. Found files. Below is a list of files or patterns that failed:

  • CODE_OF_CONDUCT.md
    • ๐Ÿ”จ Suggested Fix: Remove file

Passed #

Click to see rules

โœ… license-file-exists #

Found file (LICENSE). New Relic requires that all open source projects have an associated license contained within the project. This license must be permissive (e.g. non-viral or copyleft), and we recommend Apache 2.0 for most use cases. For more information please visit https://docs.google.com/document/d/1vML4aY_czsY0URu2yiP3xLAKYufNrKsc7o4kjuegpDw/edit.

โœ… readme-file-exists #

Found file (README.md). New Relic requires a README file in all projects. This README should give a general overview of the project, and should point to additional resources (security, contributing, etc.) where developers and users can learn further. For more information please visit https://github.com/newrelic/open-source-tools/tree/master/javascript/oss-template.

โœ… readme-starts-with-nr1-catalog-header #

The first 1 lines contain all of the requested patterns. (README.md). The README of a community plus project should have a NR1 Catalog header at the start of the README. If you already have a NR1 Catalog header and this rule is failing, your header may be out of date, and you should update your header with the suggested one below. For more information please visit https://opensource.newrelic.com/oss-category/.

โœ… readme-contains-security-section #

Contains a security section (README.md). New Relic recommends having a Security section in your README to address concerns such as vulnerability reporting. This security section should also contain a link to the security policy (found under the "Security" tab of the repository). For an example of this section, please see the NR1 Catalog Template. For more information please visit https://nerdlife.datanerd.us/new-relic/security-guidelines-for-publishing-source-code.

โœ… readme-contains-link-to-security-policy #

Contains a link to the security policy for this repository (README.md). New Relic recommends referencing the open source security policy (https://github.com/newrelic/<repo-name>/security/policy or ../../security/policy) in a Security section in the README. For an example of this, please see the NR1 Catalog Template. For more information please visit https://nerdlife.datanerd.us/new-relic/security-guidelines-for-publishing-source-code.

โœ… readme-contains-discuss-topic #

Contains a link to the appropriate discuss.newrelic.com topic (README.md). New Relic recommends directly linking the your appropriate discuss.newrelic.com topic in the README, allowing developer an alternate method of getting support. For more information please visit https://nerdlife.datanerd.us/new-relic/security-guidelines-for-publishing-source-code.

โœ… third-party-notices-file-exists #

Found file (THIRD_PARTY_NOTICES.md). A THIRD_PARTY_NOTICES.md file must be present to grant attribution to all dependencies being used by this project. For JavaScript projects, you can generate this file using the oss-cli. For more information please visit https://docs.google.com/document/d/1y644Pwi82kasNP5VPVjDV8rsmkBKclQVHFkz8pwRUtE/view.

โœ… github-actions-workflow-file-exists #

Found file (.github/workflows/catalog.yml). Any Community Plus project must integrate with GitHub actions. For more information please visit https://docs.google.com/document/d/1y644Pwi82kasNP5VPVjDV8rsmkBKclQVHFkz8pwRUtE/view.

โœ… nr1-catalog-config-file-exists #

Found file (catalog/config.json).

โœ… nr1-catalog-screenshots-directory-exists #

Found file (catalog/screenshots).

โœ… nr1-catalog-documentation-file-exists #

Found file (catalog/documentation.md).

โœ… package-scripts-present #

An eslint-check and eslint-fix npm script found in file (package.json). NPM scripts for ESLint (eslint-check and eslint-fix) are required to properly integrate with the nerdpack system.

Handle a GITHUB_URL with a blank

Summary

If there's a space in the CONFIGURE_ME.js, it would be optimal to trim the result and handle it gracefully.

Possible Solution

GITHUB_URL.trim()

On setup, when "Error fetching suggestions", the "Provide your own repository URL" doesn't appear

Description

When my APM service has a unique name that doesn't return anything from the GitHub suggestion search, the "Provide your own repository URL" field doesn't appear, so I can't manually configure it.

Steps to Reproduce

  1. Go to the Entity Explorer.
  2. Click on an APM Service that has a very unique name, such as "PROD-Bixel-NewLH",
  3. Go to the GitHub Repo app
  4. Go to the Repository Tab
  5. I get a "An error occurred: Error fetching suggestions" and no "Provide your own repository URL".

Expected Behaviour

"Provide your own repository URL" field should appear even if no suggestions are found.

Relevant Logs / Console output

I can see the network request to github:
https://api.github.com/search/repositories?q=in%3Aname%20in%3Areadme%20in%3Adescription%20PROD%20Bixel-NewLH

It returns a 200 with this response:

{
  "total_count": 0,
  "incomplete_results": false,
  "items": [
  ]
}

Your Environment

I installed this via the "Application Catalog" app on the New Relic ONE dashboard and not through the CLI.

It says that it's:
Release date: January 15, 2020
Version 0.4.0

Additional context

On the master branch in https://github.com/newrelic/nr1-github/blob/master/nerdlets/github-about/repo-picker.js, the render function returns if there is an error:

    if (error) {
      return (
        <>
          <h2>An error occurred:</h2>
          <p>{error}</p>
        </>
      );
    }

So it never renders the this.renderSuggestions() which handles the custom url field (this.renderCustomUrlRow())

    return (
      <Stack directionType="vertical" alignmentType="fill">
        <StackItem>{this.renderSuggestions()}</StackItem>
      </Stack>
    );

If no suggestions are found, that's an error condition in loadSuggestions():

    github.get(path).then(suggestions => {
      if (suggestions.items && suggestions.items.length > 0) {
        this.setState({ suggestions: suggestions.items });
        return;
      }
      this.setState({ error: 'Error fetching suggestions' });
    });

Unable to find nerd pack in New Relic hosted instance

Description

Following the steps in this repository, I am able to clone & serve the nerd pack locally. Following the url:
https://one.newrelic.com/?nerdpacks=local

I am unable to find the nerd pack or configure it. The screenshots in the Readme reference a configuration page? I am unable to get to that.

Steps to Reproduce

Follow all the steps in the readme. Try to find the nerd pack, it is missing.

Expected Behaviour

Should be able to see the nerd pack (and configure it??)

Relevant Logs / Console output

N/A

Your Environment

os:
macOS Sonoma 14.2.1
cli version:
@datanerd/nr1/2.83.5 darwin-x64 node-v16.11.1

web browser:
Safari Version 17.2.1 (19617.1.17.11.12)

Additional context

Change storage of tokens from Nerdstorage to Nerdstoragevault

User Story

As a user I'd like to now use nerdstoragevault to store my personal access tokens since this was made available as secure storage mechanism. Though the current version of the Github application is using Nerdstorage.

Data

  • Get count of how many users use the app, it may be easier to just release a breaking change and have all users re-add their token. > 154 total from Jan 1 - Oct 14

Query

SELECT count(*) FROM PageAction WHERE email NOT LIKE '%@newrelic.com' and actionName = 'DEVEX_Account List_clickUpdateAccess' AND accountsToSubscribe != '' SINCE '2020-01-31' WHERE nerdpackDisplayName = 'GitHub Integration'

Approach

  • Determine if a user has a token present in Nerstorage OR NerdStorageVault. IF no key exists, then prompt the user to add a key.
  • Determine if a user has a token present in Nerstorage. IF a key exists in Nerdstorage then migrate the key automatically. There is no need to prompt the user. After a successful migration, delete key from nerdstorage after we move the key.

Nerdstorage CLI commands

To read and write data to nerdstorage for token storage

GET A TOKEN

newrelic nerdstorage document get \
--packageId "your_package_id_here" \
--scope USER \
--entityGuid "your_guid_here"\
--accountId "your_account_here" \
--collection global \
--documentId userToken

ADD A TOKEN

newrelic nerdstorage document write \
--scope USER \
--entityGuid "your_guid_here" \
--packageId "your_package_id_here" \
--accountId "your_account_here" \
--collection global \
--documentId userToken \
--document '{
"userToken": "your_token_here"
}'

Process

  • Since this is the firs time we've done a breaking change on an opensource app we should document how we version apps with breaking changes, and define our change management process.

Error: Cannot destructure property 'path' of 'flags' as it is undefined

Description

I'm trying to run nr1 nerdpack:clone -r https://github.com/newrelic/nr1-github.git but I constantly get this error and no cloning will happen:

nr1 nerdpack:clone -r https://github.com/newrelic/nr1-github.git
 โ€บ   Error: Cannot destructure property 'path' of 'flags' as it is undefined.
 โ€บ   Code: UNKNOWN

Steps to Reproduce

  • Download and install installer.pkg from https://one.newrelic.com/developer-center?account=
  • in Terminal, run nr1 profiles:add --name account-<REDACTED> --api-key NRAK-<REDACTED> --region us
  • in Terminal, run nr1 nerdpack:clone -r https://github.com/newrelic/nr1-github.git
  • the error pops up.

Expected Behaviour

The command should clone the git repo

Relevant Logs / Console output

image

Your Environment

  • NR1 CLI version used: @datanerd/nr1/2.83.5 darwin-x64 node-v16.11.1
  • Node version: v18.13.0
  • Operating System and version: macOS 13.3

[Repolinter] Open Source Policy Issues

Repolinter Report

๐Ÿค–This issue was automatically generated by repolinter-action, developed by the Open Source and Developer Advocacy team at New Relic. This issue will be automatically updated or closed when changes are pushed. If you have any problems with this tool, please feel free to open a GitHub issue or give us a ping in #help-opensource.

This Repolinter run generated the following results:

โ— Error โŒ Fail โš ๏ธ Warn โœ… Pass Ignored Total
0 0 0 13 0 13

Passed #

Click to see rules

โœ… license-file-exists #

Found file (LICENSE). New Relic requires that all open source projects have an associated license contained within the project. This license must be permissive (e.g. non-viral or copyleft), and we recommend Apache 2.0 for most use cases. For more information please visit https://docs.google.com/document/d/1vML4aY_czsY0URu2yiP3xLAKYufNrKsc7o4kjuegpDw/edit.

โœ… readme-file-exists #

Found file (README.md). New Relic requires a README file in all projects. This README should give a general overview of the project, and should point to additional resources (security, contributing, etc.) where developers and users can learn further. For more information please visit https://github.com/newrelic/open-source-tools/tree/master/javascript/oss-template.

โœ… readme-starts-with-nr1-catalog-header #

The first 1 lines contain all of the requested patterns. (README.md). The README of a community plus project should have a NR1 Catalog header at the start of the README. If you already have a NR1 Catalog header and this rule is failing, your header may be out of date, and you should update your header with the suggested one below. For more information please visit https://opensource.newrelic.com/oss-category/.

โœ… readme-contains-security-section #

Contains a security section (README.md). New Relic recommends having a Security section in your README to address concerns such as vulnerability reporting. This security section should also contain a link to the security policy (found under the "Security" tab of the repository). For an example of this section, please see the NR1 Catalog Template. For more information please visit https://nerdlife.datanerd.us/new-relic/security-guidelines-for-publishing-source-code.

โœ… readme-contains-link-to-security-policy #

Contains a link to the security policy for this repository (README.md). New Relic recommends referencing the open source security policy (https://github.com/newrelic/<repo-name>/security/policy or ../../security/policy) in a Security section in the README. For an example of this, please see the NR1 Catalog Template. For more information please visit https://nerdlife.datanerd.us/new-relic/security-guidelines-for-publishing-source-code.

โœ… readme-contains-discuss-topic #

Contains a link to the appropriate discuss.newrelic.com topic (README.md). New Relic recommends directly linking the your appropriate discuss.newrelic.com topic in the README, allowing developer an alternate method of getting support. For more information please visit https://nerdlife.datanerd.us/new-relic/security-guidelines-for-publishing-source-code.

โœ… third-party-notices-file-exists #

Found file (THIRD_PARTY_NOTICES.md). A THIRD_PARTY_NOTICES.md file must be present to grant attribution to all dependencies being used by this project. For JavaScript projects, you can generate this file using the oss-cli. For more information please visit https://docs.google.com/document/d/1y644Pwi82kasNP5VPVjDV8rsmkBKclQVHFkz8pwRUtE/view.

โœ… code-of-conduct-should-not-exist-here #

New Relic has moved the CODE_OF_CONDUCT file to a centralized location where it is referenced automatically by every repository in the New Relic organization. Because of this change, any other CODE_OF_CONDUCT file in a repository is now redundant and should be removed. For more information please visit https://docs.google.com/document/d/1y644Pwi82kasNP5VPVjDV8rsmkBKclQVHFkz8pwRUtE/view. Did not find a file matching the specified patterns. All files passed this test.

โœ… github-actions-workflow-file-exists #

Found file (.github/workflows/catalog.yml). Any Community Plus project must integrate with GitHub actions. For more information please visit https://docs.google.com/document/d/1y644Pwi82kasNP5VPVjDV8rsmkBKclQVHFkz8pwRUtE/view.

โœ… nr1-catalog-config-file-exists #

Found file (catalog/config.json).

โœ… nr1-catalog-screenshots-directory-exists #

Found file (catalog/screenshots).

โœ… nr1-catalog-documentation-file-exists #

Found file (catalog/documentation.md).

โœ… package-scripts-present #

An eslint-check and eslint-fix npm script found in file (package.json). NPM scripts for ESLint (eslint-check and eslint-fix) are required to properly integrate with the nerdpack system.

remember who set an entity's repo url

save in entity storage: last updated at {timestamp} by {user email/name/id}

Show that info at the bottom of the Repo Picker. Something like:

Last updated by Lew Cirne at 2019-09-19 at 1pm EST

Read me Does not render Emojis

Description

The README tab does not render emojis within the nr1 github application

Steps to Reproduce

  1. Set the repository url to https://github.com/newrelic/docs-website
  2. Swap to the README tab
  3. Notice that the emojis show up as odd text artifacts or random characters
    Example:

Screen Shot 2021-03-19 at 3 37 20 PM

Expected Behaviour

The emojis should be rendered correctly, see screenshot below.
Screen Shot 2021-03-19 at 3 45 19 PM

Failure to load data in Github Application

Filed on behalf of a user from a JIRA bug logged via the NR1 platform feedback widget.

Issue

I seem to have been able to make it past the GitHub app configuration (by refreshing on the prior error page I got), but now when I select "GitHub Repo" from the more views section in the left nav, I get a flash of content that's rapidly replaced with "Oops! Something went wrong."

expected

my linked Github repo data loads in the application

Fix XSS vulnerability for github links

We had a report of a vulnerability in this nerdpack that we'll want to resolve. please refer to the internal JIRA issue for specifics

Suggested solutions include reseting the repository URL and the token when the Github URL is changed and displaying a message about the URLs being changed.

Acceptance Criteria

  • see Ticket ID: jira/INFOSEC-3231
  • resolve issue
  • deploy the update via the catalog manager to the EU / Stage and Prod env

Github token security issue

We had a report of a vulnerability in this nerdpack that we'll want to resolve. please refer to the internal JIRA issue for specifics

Acceptance Criteria

  • see Ticket ID: jira/INFOSEC-3228
  • resolve issue
  • deploy the update via the catalog manager to the EU / Stage and Prod env

Does not support fine-grained personal access tokens

Description

This integration should support fine-grained personal access tokens from GitHub. I think a regex test is not matching on the new string format of these tokens.

Steps to Reproduce

Attempt to use a fine-grained token in the PAT setting field.

Expected Behaviour

The fine-grained token should be accepted.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.