Merge branch 'main' into patch-1

This commit is contained in:
Felicity Chapman 2020-11-23 18:30:53 +00:00 коммит произвёл GitHub
Родитель 649368c16a 29e4de9de2
Коммит 59fbffc60c
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
12 изменённых файлов: 45 добавлений и 73 удалений

Просмотреть файл

@ -23,7 +23,7 @@ You must have write access to a repository to create a branch, open a pull reque
### About the default branch
{% data reusables.branches.new-repo-default-branch %} The default branch is the branch that {% data variables.product.prodname_dotcom %} displays when anyone visits your repository. The default branch is also the initial branch that Git checks out locally out when someone clones the repository. {% data reusables.branches.default-branch-automatically-base-branch %}
{% data reusables.branches.new-repo-default-branch %} The default branch is the branch that {% data variables.product.prodname_dotcom %} displays when anyone visits your repository. The default branch is also the initial branch that Git checks out locally when someone clones the repository. {% data reusables.branches.default-branch-automatically-base-branch %}
By default, {% data variables.product.product_name %} names the default branch {% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.22" or currentVersion == "github-ae@latest" %}`main`{% else %}`master`{% endif %} in any new repository.
@ -75,7 +75,7 @@ When a branch is protected:
- If required pull request reviews are enabled on the branch, you won't be able to merge changes into the branch until all requirements in the pull request review policy have been met. For more information, see "[Merging a pull request](/articles/merging-a-pull-request)."
- If required review from a code owner is enabled on a branch, and a pull request modifies code that has an owner, a code owner must approve the pull request before it can be merged. For more information, see "[About code owners](/articles/about-code-owners)."
- If required commit signing is enabled on a branch, you won't be able to push any commits to the branch that are not signed and verified. For more information, see "[About commit signature verification](/articles/about-commit-signature-verification)" and "[About required commit signing](/articles/about-required-commit-signing)."{% if currentVersion == "free-pro-team@latest" or currentVersion == "github-ae@latest" or currentVersion ver_gt "enterprise-server@2.21" %}
- If you use {% data variables.product.prodname_dotcom %} 's conflict editor to fix conflicts for a pull request that you created from a protected branch, {% data variables.product.prodname_dotcom %} helps you to create an alternative branch for the pull request, so that your resolution of the conflicts can be merged. For more information, see "[Resolving a merge conflict on {% data variables.product.prodname_dotcom %}](/github/collaborating-with-issues-and-pull-requests/resolving-a-merge-conflict-on-github)."{% endif %}
- If you use {% data variables.product.prodname_dotcom %}'s conflict editor to fix conflicts for a pull request that you created from a protected branch, {% data variables.product.prodname_dotcom %} helps you to create an alternative branch for the pull request, so that your resolution of the conflicts can be merged. For more information, see "[Resolving a merge conflict on {% data variables.product.prodname_dotcom %}](/github/collaborating-with-issues-and-pull-requests/resolving-a-merge-conflict-on-github)."{% endif %}
### Further reading

Просмотреть файл

@ -53,8 +53,12 @@ Connecting to {% data variables.product.prodname_github_codespaces %} with the
### Configuring a codespace for {% data variables.product.prodname_vs %}
The default codespace environment created by {% data variables.product.prodname_vs %} includes popular frameworks and tools such as .NET Core, Microsoft SQL Server, Python, and the Windows SDK. {% data variables.product.prodname_github_codespaces %} created with {% data variables.product.prodname_vs %} can be customized through a subset of `devcontainers.json` properties and a new tool called devinit, included with {% data variables.product.prodname_vs %}.
A codespace, created with {% data variables.product.prodname_vs %}, can be customized through a new tool called devinit, a command line tool included with {% data variables.product.prodname_vs %}.
#### devinit
The [devinit](https://docs.microsoft.com/visualstudio/devinit/getting-started-with-devinit) command-line tool lets you install additional frameworks and tools into your Windows development codespaces, as well as run PowerShell scripts or modify environment variables. devinit supports a configuration file called [devinit.json](https://docs.microsoft.com/visualstudio/devinit/devinit-json), which can be added to your project for creating customized and repeatable development environments. For more information about Windows codespace configuration and devinit, see [Customize a codespace](https://docs.microsoft.com/visualstudio/ide/codespaces/customize-codespaces) in the {% data variables.product.prodname_vs %} documentation.
[devinit](https://docs.microsoft.com/visualstudio/devinit/getting-started-with-devinit) lets you install additional frameworks and tools into your Windows development codespaces, modify environment variables, and more.
devinit supports a configuration file called [devinit.json](https://docs.microsoft.com/visualstudio/devinit/devinit-json). You can add this file to your project if you want to create a customized and repeatable development environment. When you use devinit with a [devcontainer.json](https://docs.microsoft.com/visualstudio/ide/codespaces/customize-codespaces#running-devinit-when-creating-a-codespace) file, your codespaces will be automatically configured on creation.
For more information about Windows codespace configuration and devinit, see [Customize a codespace](https://docs.microsoft.com/visualstudio/ide/codespaces/customize-codespaces) in the {% data variables.product.prodname_vs %} documentation. For more information about devinit, see [Getting started with devinit](https://docs.microsoft.com/visualstudio/devinit/getting-started-with-devinit).

Просмотреть файл

@ -1,3 +1,3 @@
```shell
$ ssh-add ~/.ssh/id_rsa
$ ssh-add ~/.ssh/id_ed25519
```

Просмотреть файл

@ -1 +1 @@
If you created your key with a different name, or if you are adding an existing key that has a different name, replace *id_rsa* in the command with the name of your private key file.
If you created your key with a different name, or if you are adding an existing key that has a different name, replace *id_ed25519* in the command with the name of your private key file.

Просмотреть файл

@ -55,11 +55,6 @@
{% endfor %}
</ul>
{% endif %}
<div class="d-none d-xl-block{% if miniTocItems.size > 1 %} border-top border-gray-light mt-4{% endif %}">
{% assign helpId = 'xl' %}
{% include helpfulness %}
{% include contribution %}
</div>
</div>
</div>
<div id="article-contents" class="article-grid-body">
@ -70,8 +65,7 @@
</div>
</div>
<div class="d-block d-xl-none border-top border-gray-light mt-4 markdown-body">
{% assign helpId = 'sm' %}
<div class="d-block border-top border-gray-light mt-4 markdown-body">
{% include helpfulness %}
{% include contribution %}
</div>

Просмотреть файл

@ -1,5 +1,5 @@
{% unless enterpriseServerReleases.isOldestReleaseDeprecated and currentVersion contains enterpriseServerReleases.oldestSupported %}
<form class="js-helpfulness mt-4 f5" id="helpfulness-{{ helpId }}">
<form class="js-helpfulness mt-4 f5">
<h4
data-help-start
data-help-yes
@ -19,24 +19,24 @@
>
<input
hidden
id="helpfulness-yes-{{ helpId }}"
id="helpfulness-yes"
type="radio"
name="helpfulness-vote"
value="Yes"
aria-label="{% data ui.helpfulness.yes %}"
/>
<label class="btn x-radio-label" for="helpfulness-yes-{{ helpId }}">
<label class="btn x-radio-label" for="helpfulness-yes">
{% octicon "thumbsup" height="24" %}
</label>
<input
hidden
id="helpfulness-no-{{ helpId }}"
id="helpfulness-no"
type="radio"
name="helpfulness-vote"
value="No"
aria-label="{% data ui.helpfulness.no %}"
/>
<label class="btn x-radio-label" for="helpfulness-no-{{ helpId }}">
<label class="btn x-radio-label" for="helpfulness-no">
{% octicon "thumbsdown" height="24" %}
</label>
</p>
@ -55,7 +55,7 @@
<p hidden data-help-no>
<label
class="d-block mb-1 f6"
for="helpfulness-category-{{ helpId }}"
for="helpfulness-category"
>
{% data ui.helpfulness.category_label %}
<span class="text-normal text-gray-light float-right ml-1">
@ -65,7 +65,7 @@
<select
class="form-control select-sm width-full"
name="helpfulness-category"
id="helpfulness-category-{{ helpId }}"
id="helpfulness-category"
>
<option value="">
{% data ui.helpfulness.category_default %}
@ -87,7 +87,7 @@
<p hidden data-help-no>
<label
class="d-block mb-1 f6"
for="helpfulness-comment-{{ helpId }}"
for="helpfulness-comment"
>
<span>{% data ui.helpfulness.comment_label %}</span>
<span class="text-normal text-gray-light float-right ml-1">
@ -97,13 +97,13 @@
<textarea
class="form-control input-sm width-full"
name="helpfulness-comment"
id="helpfulness-comment-{{ helpId }}"
id="helpfulness-comment"
></textarea>
</p>
<p>
<label
class="d-block mb-1 f6"
for="helpfulness-email-{{ helpId }}"
for="helpfulness-email"
hidden
data-help-no
>
@ -116,7 +116,7 @@
type="email"
class="form-control input-sm width-full"
name="helpfulness-email"
id="helpfulness-email-{{ helpId }}"
id="helpfulness-email"
placeholder="{% data ui.helpfulness.email_placeholder %}"
hidden
data-help-yes
@ -137,4 +137,4 @@
{% data ui.helpfulness.feedback %}
</p>
</form>
{% endunless %}
{% endunless %}

Просмотреть файл

@ -41,28 +41,4 @@ export default function () {
// const xbucket = bucket(testName)
// if (xbucket === TREATMENT) { ... }
// x.addEventListener('click', () => { sendSuccess(testName) })
const testName = 'helpfulness-prompt-to-bottom'
const xbucket = bucket(testName)
if (xbucket === TREATMENT) {
const bigHelpfulness = document.querySelector('#helpfulness-xl')
const smallHelpfulness = document.querySelector('#helpfulness-sm')
// Check that helpfulness prompt is present on this page
if (!(bigHelpfulness && smallHelpfulness)) {
return
}
// Remove the -xl prompts
bigHelpfulness.parentElement.parentElement.removeChild(bigHelpfulness.parentElement)
// Always show the -sm prompt
smallHelpfulness.parentElement.classList.remove('d-xl-none')
}
const votes = Array.from(document.querySelectorAll('.js-helpfulness [type=radio]'))
votes.forEach(voteEl => {
voteEl.addEventListener('change', () => { sendSuccess(testName) })
})
}

Просмотреть файл

@ -1,17 +1,15 @@
import { sendEvent } from './events'
export default function helpfulness () {
const forms = Array.from(document.querySelectorAll('.js-helpfulness'))
const form = document.querySelector('.js-helpfulness')
const texts = Array.from(document.querySelectorAll('.js-helpfulness input, .js-helpfulness textarea'))
const votes = Array.from(document.querySelectorAll('.js-helpfulness [type=radio]'))
if (!forms.length || !texts.length || !votes.length) return
if (!form || !texts.length || !votes.length) return
forms.forEach(form => {
form.addEventListener('submit', async evt => {
evt.preventDefault()
await submitForm(evt.target)
updateDisplay(form, 'end')
})
form.addEventListener('submit', async evt => {
evt.preventDefault()
await submitForm(evt.target)
updateDisplay(form, 'end')
})
votes.forEach(voteEl => {

18
package-lock.json сгенерированный
Просмотреть файл

@ -1213,9 +1213,9 @@
}
},
"@github/rest-api-operations": {
"version": "3.7.1",
"resolved": "https://registry.npmjs.org/@github/rest-api-operations/-/rest-api-operations-3.7.1.tgz",
"integrity": "sha512-ppNyeJAOgCpMqmkBBbSwj2JPfzfpN9ST4xe1G3sLl9OsYSasHTb39s1ZiHAIdIaVAtyeRnGL/3wp8dUqrX6G4A=="
"version": "3.7.3",
"resolved": "https://registry.npmjs.org/@github/rest-api-operations/-/rest-api-operations-3.7.3.tgz",
"integrity": "sha512-yQOEWZOOnGuZnJMqWnw7UDvACybqRRJaIJ6ouX/4RX+3f1Yhpz0YQ9ONg/J2P6PlmHSoW6puYWgaFs62zC0HVw=="
},
"@hapi/address": {
"version": "2.1.4",
@ -3243,7 +3243,7 @@
},
"agentkeepalive": {
"version": "2.2.0",
"resolved": "http://registry.npmjs.org/agentkeepalive/-/agentkeepalive-2.2.0.tgz",
"resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-2.2.0.tgz",
"integrity": "sha1-xdG9SxKQCPEWPyNvhuX66iAm4u8="
},
"aggregate-error": {
@ -3391,7 +3391,7 @@
"argparse": {
"version": "1.0.10",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
"integrity": "sha1-vNZ5HqWuCXJeF+WtmIE0zUCz2RE=",
"integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
"requires": {
"sprintf-js": "~1.0.2"
}
@ -4140,7 +4140,7 @@
},
"brfs": {
"version": "1.6.1",
"resolved": "http://registry.npmjs.org/brfs/-/brfs-1.6.1.tgz",
"resolved": "https://registry.npmjs.org/brfs/-/brfs-1.6.1.tgz",
"integrity": "sha512-OfZpABRQQf+Xsmju8XE9bDjs+uU4vLREGolP7bDgcpsI17QREyZ4Bl+2KLxxx1kCgA0fAIhKQBaBYh+PEcCqYQ==",
"requires": {
"quote-stream": "^1.0.1",
@ -6713,7 +6713,7 @@
"error-ex": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz",
"integrity": "sha1-tKxAZIEH/c3PriQvQovqihTU8b8=",
"integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==",
"requires": {
"is-arrayish": "^0.2.1"
}
@ -9868,7 +9868,7 @@
"dependencies": {
"mkdirp": {
"version": "0.3.0",
"resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.3.0.tgz",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.0.tgz",
"integrity": "sha1-G79asbqCevI1dRQ0kEJkVfSB/h4="
},
"nopt": {
@ -14962,7 +14962,7 @@
},
"magic-string": {
"version": "0.22.5",
"resolved": "http://registry.npmjs.org/magic-string/-/magic-string-0.22.5.tgz",
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.22.5.tgz",
"integrity": "sha512-oreip9rJZkzvA8Qzk9HFs8fZGF/u7H/gtrE8EN6RjKJ9kh2HlC+yQ2QezifqTZfGyiuAV0dRv5a+y/8gBb1m9w==",
"requires": {
"vlq": "^0.2.2"

Просмотреть файл

@ -16,7 +16,7 @@
"@github-docs/data-directory": "^1.2.0",
"@github-docs/frontmatter": "^1.3.1",
"@github-docs/render-content": "^5.2.0",
"@github/rest-api-operations": "^3.7.1",
"@github/rest-api-operations": "^3.7.3",
"@octokit/rest": "^16.38.1",
"@primer/css": "^15.1.0",
"@primer/octicons": "^11.0.0",

Просмотреть файл

@ -10,7 +10,7 @@ const app = express()
require('./middleware')(app)
// prevent the app from starting up durings tests
// prevent the app from starting up during tests
/* istanbul ignore next */
if (!module.parent) {
// check that the development server is not already running

Просмотреть файл

@ -134,20 +134,20 @@ describe('helpfulness', () => {
})
// When I click the "Yes" button
await page.click('#helpfulness-sm [for=helpfulness-yes-sm]')
await page.click('.js-helpfulness [for=helpfulness-yes]')
// (sent a POST request to /events)
// I see the request for my email
await page.waitForSelector('#helpfulness-sm [type="email"]')
await page.waitForSelector('.js-helpfulness [type="email"]')
// When I fill in my email and submit the form
await page.type('#helpfulness-sm [type="email"]', 'test@example.com')
await page.type('.js-helpfulness [type="email"]', 'test@example.com')
await sleep(1000)
await page.click('#helpfulness-sm [type="submit"]')
await page.click('.js-helpfulness [type="submit"]')
// (sent a PUT request to /events/{id})
// I see the feedback
await page.waitForSelector('#helpfulness-sm [data-help-end]')
await page.waitForSelector('.js-helpfulness [data-help-end]')
})
})