Skip to content

Commit

Permalink
chore: update whats-new information and replaces mentions of GC
Browse files Browse the repository at this point in the history
  • Loading branch information
tabathadelane committed Aug 5, 2024
1 parent 69094ce commit 2785fe4
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 11 deletions.
18 changes: 12 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
- [Use `chore`](#use-chore)
- [Use `fix`](#use-fix)
- [Use `feat`](#use-feat)
- [Deploy previews with Gatsby Cloud](#deploy-previews-with-gatsby-cloud)
- [Deploy previews with Netlify](#deploy-previews-with-netlify)
- [Reusable components](#reusable-components)
- [Editing existing pages](#editing-existing-pages)
- [Private edits](#private-edits)
Expand All @@ -42,7 +42,7 @@ The Documentation Team and Developer Enablement Team at New Relic welcome contri
There are several ways you can contribute:

- If you wish to make documentation edits or add new
documentation, follow our [documentation contribution guidelines](https://docs.newrelic.com/docs/style-guide/writing-guidelines/create-edit-content/#edit-doc).
documentation, follow our [documentation contribution guidelines](https://docs.newrelic.com/docs/style-guide/writing-guidelines/create-edit-content/#edit-doc).
- If you'd like to make code contributions, or make content contributions locally, follow the contribution guidelines below.

## Getting started
Expand Down Expand Up @@ -135,7 +135,7 @@ If you plan on coordinating changes across several people, and feel your code is
use a shared working branch strategy.

1. create a new branch to collaborate with others via GIT and push that branch up to the remote repository. `git checkout -b shared-branch`
2. share that branch with others you are collaborating with. They'll need to run: `git pull origin shared-branch`
2. share that branch with others you are collaborating with. They'll need to run: `git pull origin shared-branch`
3. All contributors should keep that branch up to date by running `git pull origin develop` frequently.
4. Push all changes to the remote repository: `git push origin shared-branch`
5. Resolve any merge conflicts.
Expand All @@ -151,7 +151,7 @@ The `develop` and `main` branches have "Branch Protection" enabled in Github. In

You can review full Branch Protection details [here](https://docs.google.com/document/d/1O1SGS0i3OmPfvPhylpFe1CTMkE20889iAOF_cMFJ344/edit#heading=h.oh6pex9x0dx4), and check out a visual representation of the workflow below:

![Branch protection workflow](src/images/Docs_site_branch_protection_workflow.png "branch-protection-workflow")
![Branch protection workflow](src/images/Docs_site_branch_protection_workflow.png 'branch-protection-workflow')

### Draft PRs

Expand Down Expand Up @@ -207,9 +207,15 @@ Feat is for major functional changes or additions to code.
git commit -m "feat(errors inbox): add new documents"
```

### Deploy previews with Gatsby Cloud
### Deploy previews with Netlify

PRs that are opened from a branch in this repo (not forks) will generate preview links on Gatsby Cloud automatically. Gatsby Cloud preview links are posted as comments on your pull request when they are done building. You can monitor the progress via the `Gatsby Build Service` job under the `Checks` section.
PRs that are opened from a branch in this repo will generate preview links on Netlify automatically.

`netlify bot` will leave a comment on your PR. You can monitor the progress via the comment details which include:

- The status of the preview build. (`processing`, `ready`, or `failed`)
- The commit that is being built or has failed.
- Once the build succeeds, the comment will update with a link to view the preview site.

## Reusable components

Expand Down
6 changes: 3 additions & 3 deletions TRANSLATION_WORKFLOW.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Additionally, we've recently added the ability to have content be machine transl
- [Locales](#locales)
- [Statuses](#statuses)
- [Serialization / Deserialization](#serialization--deserialization)
- [Gatsby Cloud](#gatsby-cloud)
- [Netlify sites](#netlify-sites)
- [Context](#context)
<!-- toc -->

Expand Down Expand Up @@ -285,9 +285,9 @@ When getting this content back from TV, we get back the same format that we sent

This can be tested via the `yarn serialize` && `yarn deserialize` scripts. These scripts are used by passing a file path to them and will output the result of the function to the terminal. ex: `yarn serialize path/to/file.mdx`.

# Gatsby Cloud
# Netlify sites

Although not listed on the diagrams above, Gatsby Cloud is where we host and deploy our site. Every time we merge into the main branch, Gatsby Cloud is triggered to build the latest updates from GitHub. It fetches the code from the main branch and builds the site. Once the site has passed the checks, it deploys the built site to [docs.newrelic.com](https://docs.newrelic.com). If the site fails to build, then the new version is not deployed and the engineers are notified.
Although not listed on the diagrams above, Netlify is where we host and deploy [docs.newrelic.com](https://docs.newrelic.com). We build each language on it's own Netlify site. Every time we merge into the main branch, Netlify is triggered to build the latest `EN` updates from GitHub by default. `trigger-i18n-merge` is a Github action that runs on each release PR to see if any files were modified in the `src/i18n/` directories. For each language with modifications, a build is also triggered in that Netlify site. It fetches the code from the main branch and builds that site with its translated content. If any of these sites fail to build, then the new version is not deployed and the engineers are notified via the Netlify Slack app integration.

# Context

Expand Down
21 changes: 21 additions & 0 deletions scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,27 @@ It takes no arguments and will complete in about ~20min. It was created to be ru

This script runs upon making a PR to the develop branch via a github action (`.github/workflows/check-for-keys.yml`). It scans all files, save one (`gatsby-config.js`), for any potential New Relic API keys based on a list of regex. It also scans all git commit history for any commits made in a PR to develop, looks at the diff for all said commits and scans those for API keys as well. This is intended to ensure no API keys are committed to the docs site or git history.

## actions/generate-whats-new-ids.js

This script generates id's for What's new posts upon opening a PR to `main` in a github action (`.github/workflows/update-whats-new-ids.yml`). These are referenced by the NR One product from `/api/nr1/content/nr1-announcements.json` and used to show What's new posts to customers within the UI.

When the action runs, it checks out `develop` and compares the content in `src/data/whats-new-ids.json` vs posts in `src/content/whats-new/`. If there is a new posts not in the json, the script adds a new item to the array containing the path to the post and a new generated id:

```json
"/whats-new/2020/09/new-post-slug": "12345",
```

> [!IMPORTANT]
> The changes made to the json are committed to **`develop`** and will not be published and available to the NR One UI until a second release is merged that contains the updated json!
What's new workflow from new `.mdx` page to rendering in Product UI:

1. New post is merged into `develop`
2. Release PR #1 is opened to `main`
3. `update-whats-new-ids.yml` runs > adds post path & id to json > commits changes to ``develop`
4. Release PR #2 is released and `/api/nr1/content/nr1-announcements.json` endpoint is updated
5. Product service picks up changes and is able to display new post in UI

## addRemoveRedirects.js

This script has two options: one will add redirects for all files' current paths in a given directory (including all sub-directories), or it will remove any redirects of a file's current path in a given directory.
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/agile-handbook/heroing/what-is-a-hero.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ The bulk of your time is generally spent reviewing and approving PRs from non-wr
* **If it's a deeper edit, or a completely new doc**, give it an in-depth review. The [Docs site edit checklist](/docs/style-guide/processes-procedures/docs-site-edit-checklist/) is a great resource here. If it's a really complex or large edit, consider creating a Jira ticket for an upcoming sprint to give it the review time it needs.
* **If it's a What's new post**, pay special attention to frontmatter, links, and image formatting. This content follows marketing style, so it doesn't need to fully match our style guidelines for things like capitalization.
* **If it's a release note**, focus your review on formatting and basic style, and ensuring the release note itself is helpful. Release notes don't need to follow all docs style guidelines religiously.
4. Preview your change in Gatsby Cloud or locally.
4. Preview your change in Netlify or locally.
5. Merge the pull request into **develop**.

### Merge develop into main
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ This command returns more information about the error than the normal Gatsby out
title="Example"
>

Let's pretend I've made a changes to multiple docs in my branch. When I try to either run the site locally or access the Gatsby Cloud build, I get the following error:
Let's pretend I've made a changes to multiple docs in my branch. When I try to either run the site locally or access the Netlify build, I get the following error:

```
Unexpected character = (U+003D) before name, expected a character that can start a name, such as a letter, $, or _/usr/src/app/www/src/content/docs/new-relic-solutions/observability-maturity/uptime-performance-reliability/aqm-implementation-guide.mdx: Unexpected character = (U+003D) before name, expected a character that can start a name, such as a letter, $, or _
Expand Down

0 comments on commit 2785fe4

Please sign in to comment.