Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repo sync #34508

Merged
merged 2 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -24,37 +24,39 @@ shortTitle: Recommended alert thresholds

## About recommended alert thresholds

You can configure external monitoring systems to alert you to storage, CPU, and memory usage that may cause problems with {% data variables.location.product_location %}. For more information, see "[AUTOTITLE](/admin/enterprise-management/monitoring-your-appliance/setting-up-external-monitoring)."
You can configure external monitoring systems to alert you to storage, CPU, and memory usage that may cause problems with {% data variables.location.product_location %}. For more information, see "[AUTOTITLE](/admin/enterprise-management/monitoring-your-appliance/setting-up-external-monitoring)" and "[AUTOTITLE](/admin/monitoring-and-managing-your-instance/monitoring-your-instance/accessing-the-monitor-dashboard)."

## Monitoring storage

We recommend that you monitor both the root and user storage devices and configure an alert with values that allow for ample response time when available disk space is low.

| Severity | Threshold |
| -------- | --------- |
| **Warning** | Disk use exceeds 70% of total available |
| **Critical** | Disk use exceeds 85% of total available |
| **Warning** | Disk use exceeds 60% of total available |
| **Critical** | Disk use exceeds 75% of total available |

You can adjust these values based on the total amount of storage allocated, historical growth patterns, and expected time to respond. We recommend over-allocating storage resources to allow for growth and prevent the downtime required to allocate additional storage.

## Monitoring CPU and load average usage

Although it is normal for CPU usage to fluctuate based on resource-intense Git operations, we recommend configuring an alert for abnormally high CPU utilization, as prolonged spikes can mean your instance is under-provisioned. We recommend monitoring the fifteen-minute system load average for values nearing or exceeding the number of CPU cores allocated to the virtual machine.
Although it is normal for CPU usage to fluctuate based on resource-intense Git operations, we recommend configuring an alert for abnormally high CPU utilization, as prolonged spikes can mean your instance is under-provisioned. Additionally, we recommend monitoring CPU utilization during a regular work week when the instance is in a healthy state to establish a baseline that can be used as a reference.

| Severity | Threshold |
| -------- | --------- |
| **Warning** | Fifteen minute load average exceeds 1x CPU cores |
| **Critical** | Fifteen minute load average exceeds 2x CPU cores |
| **Warning** | 20% above the baseline |
| **Critical** | 40% above the baseline |

We also recommend that you monitor virtualization "steal" time to ensure that other virtual machines running on the same host system are not using all of the instance's resources.

## Monitoring memory usage

The amount of physical memory allocated to {% data variables.location.product_location %} can have a large impact on overall performance and application responsiveness. The system is designed to make heavy use of the kernel disk cache to speed up Git operations. We recommend that the normal RSS working set fit within 50% of total available RAM at peak usage.
The amount of physical memory allocated to {% data variables.location.product_location %} can have a large impact on overall performance and application responsiveness. The system is designed to make heavy use of the kernel disk cache to speed up Git operations. We recommend that the amount of physical memory assigned to the processes fit within 50% of total available RAM at peak usage.

| Severity | Threshold |
| -------- | --------- |
| **Warning** | Sustained RSS usage exceeds 50% of total available memory |
| **Critical** | Sustained RSS usage exceeds 70% of total available memory |
| **Warning** | Sustained memory usage exceeds 50% of total available memory |
| **Critical** | Sustained memory usage exceeds 70% of total available memory |

Nevertheless, for cluster installations, we recommend following a similar approach to CPU monitoring: establish a baseline that defines what is considered normal usage, and set the threshold accordingly. This threshold may also vary between roles.

If memory is exhausted, the kernel OOM killer will attempt to free memory resources by forcibly killing RAM heavy application processes, which could result in a disruption of service. We recommend allocating more memory to the virtual machine than is required in the normal course of operations.
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ versions:
feature: desktop
shortTitle: Configure default editor
---
## Supported editors

{% data variables.product.prodname_desktop %} supports the following editors. If you installed an editor while {% data variables.product.prodname_desktop %} was open you will need to quit and reopen {% data variables.product.prodname_desktop %} in order for the editor to be detected.
## Introduction

{% data variables.product.prodname_desktop %} provides support for a number of editors, and also allows you to select a custom editor if your preferred editor is not supported. If you installed an editor while {% data variables.product.prodname_desktop %} was open you will need to quit and reopen {% data variables.product.prodname_desktop %} in order for the editor to be detected.

## Supported editors

{% mac %}

Expand Down Expand Up @@ -97,6 +100,17 @@ shortTitle: Configure default editor

{% endwindows %}

## Configuring a custom editor

{% data reusables.desktop.mac-select-desktop-menu %}
1. In the Preferences window, select **Integrations**.
![Screenshot of the "Preferences" window. In the left sidebar, the "Integrations" option is highlighted in blue and outlined in orange.](/assets/images/help/desktop/mac-select-integrations-pane.png)
1. Under "External Editor", use the dropdown menu to select **Configure Custom Editor**.
![Screenshot of the "Preferences window. Under "External Editor", the dropdown menu is displayed with "Configure Custom Editor" highlighted in blue and outlined in orange.](/assets/images/help/desktop/configure-custom-editor.png)
1. Click **Choose** to open the system dialog to navigate to the path of your custom editor.
1. Under "Arguments", enter any arguments you would like to use after the "%TARGET_PATH%" variable. Reference supporting documentation for your custom editor to ensure you have the arguments set correctly, as invalid arguments can prevent the editor from launching in {% data variables.product.prodname_desktop %}.
1. Click **Save**.

## Opening a repository in the default editor

To open the current repository in the default editor, you can use the menu bar:
Expand Down
2 changes: 1 addition & 1 deletion data/code-languages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ text:
name: Text
comment: number
typescript:
name: Typescript
name: TypeScript
comment: slash
xml:
name: XML
Expand Down
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@
"@octokit/request-error": "6.1.1",
"@primer/behaviors": "^1.7.0",
"@primer/css": "^21.3.1",
"@primer/live-region-element": "^0.7.0",
"@primer/octicons": "^19.11.0",
"@primer/octicons-react": "^19.11.0",
"@primer/react": "36.27.0",
Expand Down
2 changes: 1 addition & 1 deletion src/audit-logs/lib/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"apiOnlyEvents": "This event is not available in the web interface, only via the REST API, audit log streaming, or JSON/CSV exports.",
"apiRequestEvent": "This event is only available via audit log streaming."
},
"sha": "0da185a95ffe0bea6a17eb08ac06a03b5729e751"
"sha": "30ee4d895a808d2e9d1f96fe142fb9f939e57efb"
}
4 changes: 4 additions & 0 deletions src/content-render/stylesheets/annotate.scss
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,7 @@
.subnav-item[aria-current]:not([aria-current="false"]) {
z-index: 0;
}

button.js-btn-copy.copied::after {
content: "Copied!";
}
2 changes: 1 addition & 1 deletion src/content-render/tests/__snapshots__/annotate.js.snap
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`annotate > renders annotations 1`] = `
"<div class="annotate beside"><div class="annotate-header"><header class="d-flex flex-items-center flex-justify-between p-2 text-small rounded-top-1 border-top border-left border-right"><span class="flex-1">YAML</span><div class="annotate-toggle"><button name="annotate-display" value="beside" type="button" class="annotate-option">Beside</button><button name="annotate-display" value="inline" type="button" class="annotate-option">Inline</button></div><button class="js-btn-copy btn btn-sm tooltipped tooltipped-nw" aria-label="Copy YAML code to clipboard" data-clipboard="1746955726" aria-live="polite" aria-atomic="true"><svg version="1.1" width="16" height="16" viewBox="0 0 16 16" class="octicon octicon-copy" aria-hidden="true"><path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path></svg></button><pre hidden data-clipboard="1746955726"># The name of the workflow as it will appear in the "Actions" tab of the GitHub repository.
"<div class="annotate beside"><div class="annotate-header"><header class="d-flex flex-items-center flex-justify-between p-2 text-small rounded-top-1 border-top border-left border-right"><span class="flex-1">YAML</span><div class="annotate-toggle"><button name="annotate-display" value="beside" type="button" class="annotate-option">Beside</button><button name="annotate-display" value="inline" type="button" class="annotate-option">Inline</button></div><button class="js-btn-copy btn btn-sm tooltipped tooltipped-nw" aria-label="Copy YAML code to clipboard" data-clipboard="1746955726"><svg version="1.1" width="16" height="16" viewBox="0 0 16 16" class="octicon octicon-copy" aria-hidden="true"><path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path></svg></button><pre hidden data-clipboard="1746955726"># The name of the workflow as it will appear in the "Actions" tab of the GitHub repository.
name: Post welcome comment

# Add the \`pull_request\` event, so that the workflow runs automatically
Expand Down
2 changes: 0 additions & 2 deletions src/content-render/unified/code-header.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ export function header(lang, code, subnav) {
class: ['js-btn-copy', 'btn', 'btn-sm', 'tooltipped', 'tooltipped-nw'],
'aria-label': `Copy ${languages[lang]?.name} code to clipboard`,
'data-clipboard': codeId,
'aria-live': 'polite',
'aria-atomic': 'true',
},
btnIcon(),
),
Expand Down
9 changes: 6 additions & 3 deletions src/frame/components/lib/copy-code.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { announce } from '@primer/live-region-element'

export default function copyCode() {
const buttons = Array.from(document.querySelectorAll('button.js-btn-copy'))

Expand All @@ -13,11 +15,12 @@ export default function copyCode() {
if (!text) return
await navigator.clipboard.writeText(text)

const beforeTooltip = button.getAttribute('aria-label') || ''
button.setAttribute('aria-label', 'Copied!')
button.classList.add('copied')

announce('Copied!')

setTimeout(() => {
button.setAttribute('aria-label', beforeTooltip)
button.classList.remove('copied')
}, 2000)
}),
)
Expand Down
2 changes: 1 addition & 1 deletion src/github-apps/lib/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,5 @@
"2022-11-28"
]
},
"sha": "272a391f5bfe7d533f35ecfb65adfcf137162fb3"
"sha": "fe797834e6a9f3216737d6e0bc9fb3237ecb7957"
}
14 changes: 6 additions & 8 deletions src/rest/components/RestCodeSamples.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { useState, useEffect, useRef, FormEvent } from 'react'
import { FormControl, Select, TabNav } from '@primer/react'
import { Tooltip } from '@primer/react/next'
import { CheckIcon, CopyIcon } from '@primer/octicons-react'
import { announce } from '@primer/live-region-element'
import Cookies from 'src/frame/components/lib/cookies'
import cx from 'classnames'

Expand Down Expand Up @@ -288,14 +289,11 @@ export function RestCodeSamples({ operation, slug, heading }: Props) {
>
<button
className="js-btn-copy btn-octicon"
aria-label={
isCopied
? t('button_text.copied')
: `${t('button_text.copy_to_clipboard')} ${selectedLanguage} request example`
}
aria-live="polite"
aria-atomic="true"
onClick={() => setCopied()}
aria-label={`${t('button_text.copy_to_clipboard')} ${selectedLanguage} request example`}
onClick={() => {
setCopied()
announce('Copied!')
}}
>
{isCopied ? <CheckIcon /> : <CopyIcon />}
</button>
Expand Down
Loading
Loading