Skip to content

Commit ac353d7

Browse files
authored
Merge pull request #41142 from github/repo-sync
Repo sync
2 parents 575894c + 9bc51e5 commit ac353d7

File tree

28 files changed

+487
-270
lines changed

28 files changed

+487
-270
lines changed

.github/actions/node-npm-setup/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ runs:
1717
key: ${{ runner.os }}-node_modules-${{ hashFiles('package*.json') }}-${{ hashFiles('.github/actions/node-npm-setup/action.yml') }}
1818

1919
- name: Setup Node.js
20-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
20+
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
2121
with:
2222
node-version-file: 'package.json'
2323
cache: npm

content/copilot/concepts/prompting/response-customization.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ category:
3030

3131
There are three main types of custom instructions that you can use to customize {% data variables.product.prodname_copilot_short %} responses on the {% data variables.product.github %} website:
3232

33-
* **[Personal custom instructions](#about-personal-custom-instructions)** apply to all conversations you have with {% data variables.copilot.copilot_chat_short %} across the {% data variables.product.github %} website. They allow you to specify your individual preferences, such as preferred language or response style, ensuring that the responses are tailored to your personal needs.
33+
* **[Personal instructions](#about-personal-instructions)** apply to all conversations you have with {% data variables.copilot.copilot_chat_short %} across the {% data variables.product.github %} website. They allow you to specify your individual preferences, such as preferred language or response style, ensuring that the responses are tailored to your personal needs.
3434
* **[Repository custom instructions](#about-repository-custom-instructions)** apply to conversations within the context of a specific repository. They are useful for defining project-specific coding standards, frameworks, or tools. For example, you can specify that a repository uses TypeScript and a particular library, ensuring consistent responses for all contributors.
3535
* **[Organization custom instructions](#about-organization-custom-instructions)** (public preview) apply to conversations within the context of an organization on the {% data variables.product.github %} website. They are ideal for enforcing organization-wide preferences, such as a common language or security guidelines. Organization custom instructions can only be set by organization owners for organizations with a {% data variables.copilot.copilot_enterprise_short %} subscription.
3636

37-
## About personal custom instructions
37+
## About personal instructions
3838

3939
{% data reusables.copilot.personal-instructions-note %}
4040

@@ -67,12 +67,12 @@ Some examples of instructions you could add are:
6767

6868
The following list shows the complete order of precedence, with instructions higher in this list taking precedence over those lower in the list:
6969

70-
* Personal custom instructions
71-
* Repository custom instructions:
72-
* Path-specific instructions in any applicable `.github/instructions/**/NAME.instructions.md` file
73-
* Repository-wide instructions in the `.github/copilot-instructions.md` file
74-
* Agent instructions (for example, in an `AGENTS.md` file)
75-
* Organization custom instructions
70+
* **Personal** instructions
71+
* **Repository** custom instructions:
72+
* **Path-specific** instructions in any applicable `.github/instructions/**/NAME.instructions.md` file
73+
* **Repository-wide** instructions in the `.github/copilot-instructions.md` file
74+
* **Agent** instructions (for example, in an `AGENTS.md` file)
75+
* **Organization** custom instructions
7676

7777
{% data reusables.copilot.custom-instructions-conflict %}
7878

@@ -81,7 +81,7 @@ The following list shows the complete order of precedence, with instructions hig
8181
Custom instructions consist of natural language instructions and are most effective when they are short, self-contained statements. Consider the scope over which you want the instruction to apply when choosing whether to add an instruction on the personal, repository, or organization level.
8282

8383
Here are some common use cases and examples for each type of custom instructions:
84-
* **Personal custom instructions:**
84+
* **Personal instructions:**
8585
* Preferred individual language: `Always respond in Portuguese.`
8686
* Individual response preferences: `Explain a single concept per line. Be clear and concise.`
8787
* **Repository custom instructions:**

data/reusables/contributing/content-linter-rules.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
| GHD041 | third-party-action-pinning | Code examples that use third-party actions must always pin to a full length commit SHA | error | feature, actions |
5353
| GHD042 | liquid-tag-whitespace | Liquid tags should start and end with one whitespace. Liquid tag arguments should be separated by only one whitespace. | error | liquid, format |
5454
| GHD043 | link-quotation | Internal link titles must not be surrounded by quotations | error | links, url |
55-
| GHD044 | octicon-aria-labels | Octicons should always have an aria-label attribute even if aria-hidden. | warning | accessibility, octicons |
5655
| GHD045 | code-annotation-comment-spacing | Code comments in annotation blocks must have exactly one space after the comment character(s) | warning | code, comments, annotate, spacing |
5756
| GHD046 | outdated-release-phase-terminology | Outdated release phase terminology should be replaced with current GitHub terminology | warning | terminology, consistency, release-phases |
5857
| GHD047 | table-column-integrity | Tables must have consistent column counts across all rows | warning | tables, accessibility, formatting |
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
> [!NOTE]
22
> This feature is currently in {% data variables.release-phases.public_preview %} and is subject to change.
33
>
4-
> **Support:** Organization custom instructions are currently only supported for {% data variables.copilot.copilot_chat_short %} on {% data variables.product.prodname_dotcom_the_website %} and {% data variables.copilot.copilot_code-review_short %} on {% data variables.product.prodname_dotcom_the_website %}.
4+
> **Support:** Organization custom instructions are currently only supported for {% data variables.copilot.copilot_chat_short %} on {% data variables.product.prodname_dotcom_the_website %}, {% data variables.copilot.copilot_code-review_short %} on {% data variables.product.prodname_dotcom_the_website %} and {% data variables.copilot.copilot_coding_agent %} on {% data variables.product.prodname_dotcom_the_website %}.
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
import { beforeAll, describe, expect, test } from 'vitest'
2+
3+
import { get } from '@/tests/helpers/e2etest'
4+
5+
const makeURL = (pathname: string): string =>
6+
`/api/article/body?${new URLSearchParams({ pathname })}`
7+
8+
describe('article body api', () => {
9+
beforeAll(() => {
10+
// If you didn't set the `ROOT` variable, the tests will fail rather
11+
// cryptically. So as a warning for engineers running these tests,
12+
// alert in case it was accidentally forgotten.
13+
if (!process.env.ROOT) {
14+
console.warn(
15+
'WARNING: The article body tests require the ROOT environment variable to be set to the fixture root',
16+
)
17+
}
18+
})
19+
20+
test('happy path', async () => {
21+
const res = await get(makeURL('/en/get-started/start-your-journey/hello-world'))
22+
expect(res.statusCode).toBe(200)
23+
expect(res.body).toContain('## Introduction')
24+
expect(res.body).toContain('This is just a test.')
25+
expect(res.headers['content-type']).toContain('text/markdown')
26+
})
27+
28+
test('octicons auto-generate aria-labels', async () => {
29+
const res = await get(makeURL('/en/get-started/start-your-journey/hello-world'))
30+
expect(res.statusCode).toBe(200)
31+
32+
// Check that octicons without aria-label get auto-generated ones
33+
expect(res.body).toContain('aria-label="check icon"')
34+
expect(res.body).toContain('aria-label="git branch icon"')
35+
})
36+
37+
test('octicons with custom aria-labels use the custom value', async () => {
38+
const res = await get(makeURL('/en/get-started/start-your-journey/hello-world'))
39+
expect(res.statusCode).toBe(200)
40+
41+
// Check that custom aria-labels are preserved
42+
expect(res.body).toContain('aria-label="Supported"')
43+
expect(res.body).toContain('aria-label="Not supported"')
44+
})
45+
46+
test('octicons with other attributes still get auto-generated aria-labels', async () => {
47+
const res = await get(makeURL('/en/get-started/start-your-journey/hello-world'))
48+
expect(res.statusCode).toBe(200)
49+
50+
// Check that octicons with width attribute still get aria-labels
51+
expect(res.body).toContain('aria-label="rocket icon"')
52+
expect(res.body).toContain('width="32"')
53+
})
54+
55+
test('a pathname that does not exist', async () => {
56+
const res = await get(makeURL('/en/never/heard/of'))
57+
expect(res.statusCode).toBe(404)
58+
const { error } = JSON.parse(res.body)
59+
expect(error).toBe("No page found for '/en/never/heard/of'")
60+
})
61+
62+
test('non-article pages return error', async () => {
63+
// Index pages are not articles and should not be renderable
64+
const res = await get(makeURL('/en/get-started'))
65+
expect(res.statusCode).toBe(403)
66+
const { error } = JSON.parse(res.body)
67+
expect(error).toContain("isn't yet available in markdown")
68+
})
69+
})

src/content-linter/lib/linting-rules/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ import { tableColumnIntegrity } from '@/content-linter/lib/linting-rules/table-c
4242
import { thirdPartyActionPinning } from '@/content-linter/lib/linting-rules/third-party-action-pinning'
4343
import { liquidTagWhitespace } from '@/content-linter/lib/linting-rules/liquid-tag-whitespace'
4444
import { linkQuotation } from '@/content-linter/lib/linting-rules/link-quotation'
45-
import { octiconAriaLabels } from '@/content-linter/lib/linting-rules/octicon-aria-labels'
4645
import { liquidIfversionVersions } from '@/content-linter/lib/linting-rules/liquid-ifversion-versions'
4746
import { outdatedReleasePhaseTerminology } from '@/content-linter/lib/linting-rules/outdated-release-phase-terminology'
4847
import { frontmatterVersionsWhitespace } from '@/content-linter/lib/linting-rules/frontmatter-versions-whitespace'
@@ -105,7 +104,7 @@ export const gitHubDocsMarkdownlint = {
105104
thirdPartyActionPinning, // GHD041
106105
liquidTagWhitespace, // GHD042
107106
linkQuotation, // GHD043
108-
octiconAriaLabels, // GHD044
107+
// GHD044 removed - octicon aria-labels are now auto-generated
109108
codeAnnotationCommentSpacing, // GHD045
110109
outdatedReleasePhaseTerminology, // GHD046
111110
tableColumnIntegrity, // GHD047

src/content-linter/lib/linting-rules/octicon-aria-labels.ts

Lines changed: 0 additions & 58 deletions
This file was deleted.

src/content-linter/style/github-docs.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,7 @@ const githubDocsConfig = {
162162
'partial-markdown-files': true,
163163
'yml-files': true,
164164
},
165-
'octicon-aria-labels': {
166-
// GHD044
167-
severity: 'warning',
168-
'partial-markdown-files': true,
169-
'yml-files': true,
170-
},
165+
// GHD044 removed - octicon aria-labels are now auto-generated
171166
'code-annotation-comment-spacing': {
172167
// GHD045
173168
severity: 'warning',

src/content-linter/tests/unit/octicon-aria-labels.ts

Lines changed: 0 additions & 155 deletions
This file was deleted.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import murmur from 'imurmurhash'
2+
3+
/**
4+
* Generate a deterministic ID for a prompt based on its content.
5+
* Uses MurmurHash to create a unique ID that remains consistent across renders,
6+
* avoiding hydration mismatches in the client.
7+
*/
8+
export function generatePromptId(promptContent: string): string {
9+
return murmur('prompt').hash(promptContent).result().toString()
10+
}

0 commit comments

Comments
 (0)