diff --git a/content/communities/maintaining-your-safety-on-github/blocking-a-user-from-your-personal-account.md b/content/communities/maintaining-your-safety-on-github/blocking-a-user-from-your-personal-account.md index b3e3dc2059ca..a5bf2e06dfc9 100644 --- a/content/communities/maintaining-your-safety-on-github/blocking-a-user-from-your-personal-account.md +++ b/content/communities/maintaining-your-safety-on-github/blocking-a-user-from-your-personal-account.md @@ -53,17 +53,17 @@ After you've blocked a user, they cannot: In repositories you own, blocked users also cannot: * Open issues * Send, close, or merge pull requests -* Comment on issues, pull requests, or commits +* Comment on issues, pull requests, discussions, or commits * Comment on repository security advisories * Add or edit wiki pages -Blocking a user from a comment doesn't delete the original issue, pull request, or security advisory. +Blocking a user from a comment doesn't delete the original issue, pull request, discussion, or security advisory. -## Blocking a user in an issue, pull request, or repository security advisory +## Blocking a user in an issue, pull request, discussion, or repository security advisory You must own the repository to block a user from its content. -1. Navigate to the issue, pull request, or repository security advisory that contains the description or comment whose author you would like to block. +1. Navigate to the issue, pull request, discussion, or repository security advisory that contains the description or comment whose author you would like to block. 1. In the upper-right corner of the description or comment whose author you would like to block, click {% octicon "kebab-horizontal" aria-label="Show options" %}, then click **Block user**. {% data reusables.organizations.close-all-content-when-blocking-user %} 1. Optionally, add a note to describe why you blocked the user. The note will only be visible to you. diff --git a/content/copilot/concepts/agents/copilot-cli/about-copilot-cli.md b/content/copilot/concepts/agents/copilot-cli/about-copilot-cli.md index 138a38e49388..014ba043ea21 100644 --- a/content/copilot/concepts/agents/copilot-cli/about-copilot-cli.md +++ b/content/copilot/concepts/agents/copilot-cli/about-copilot-cli.md @@ -204,6 +204,10 @@ When you use {% data variables.copilot.copilot_cli_short %}, {% data variables.p You should therefore always keep security considerations in mind when using {% data variables.copilot.copilot_cli_short %}, just as you would when working directly with files yourself, or running commands directly in your terminal. You should always review suggested commands carefully when {% data variables.copilot.copilot_cli_short %} requests your approval. +### Content exclusion + +For {% data variables.copilot.copilot_business_short %} and {% data variables.copilot.copilot_enterprise_short %} users, {% data variables.copilot.copilot_cli_short %} respects content exclusion policies configured at the enterprise, organization, and repository levels. Excluded files are not used as context. For more information, see [AUTOTITLE](/copilot/concepts/context/content-exclusion). + ### Trusted directories Trusted directories control where {% data variables.copilot.copilot_cli_short %} can read, modify, and execute files. diff --git a/content/copilot/concepts/agents/github-copilot-app.md b/content/copilot/concepts/agents/github-copilot-app.md index 4584f0247f9f..26f6819dda6d 100644 --- a/content/copilot/concepts/agents/github-copilot-app.md +++ b/content/copilot/concepts/agents/github-copilot-app.md @@ -78,6 +78,10 @@ For more detailed optimization tips, see [AUTOTITLE](/copilot/tutorials/optimize To share feedback, click the **Give feedback** icon in the bottom-left corner of the app. +## Content exclusion + +For {% data variables.copilot.copilot_business_short %} and {% data variables.copilot.copilot_enterprise_short %} users, the {% data variables.copilot.github_copilot_app %} respects content exclusion policies configured at the enterprise, organization, and repository levels. Excluded files are not used as context. For more information, see [AUTOTITLE](/copilot/concepts/context/content-exclusion). + ## Public code {% data variables.copilot.github_copilot_app %} may generate code that is a match or near match of publicly available code, even if the "Suggestions matching public code" policy is set to "Block." See [AUTOTITLE](/copilot/how-tos/manage-your-account/manage-policies#enabling-or-disabling-suggestions-matching-public-code). diff --git a/content/copilot/concepts/context/content-exclusion.md b/content/copilot/concepts/context/content-exclusion.md index d28de1447ccf..8f5af0b71a67 100644 --- a/content/copilot/concepts/context/content-exclusion.md +++ b/content/copilot/concepts/context/content-exclusion.md @@ -19,7 +19,7 @@ You can use content exclusion to configure {% data variables.product.prodname_co * Inline suggestions will not be available in the affected files. * The content in affected files will not inform inline suggestions in other files. -* The content in affected files will not inform {% data variables.copilot.copilot_chat %}'s responses. +* The content in affected files will not inform {% data variables.product.prodname_copilot_short %}'s responses. * Affected files will not be reviewed in a {% data variables.product.prodname_copilot_short %} code review. ### Who can configure content exclusion @@ -32,17 +32,19 @@ Repository administrators, organization owners, and enterprise owners can config The {% data variables.copilot.copilot_business_short %} and {% data variables.copilot.copilot_enterprise_short %} plans provide the following level of support for content exclusion. -| Tool | Inline suggestions support | {% data variables.copilot.copilot_chat_short %} support | -|-------------------------------------------------|:---------------------------------------------:|:----------------------------------------------------------------:| -| {% data variables.product.prodname_vs %} | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | -| {% data variables.product.prodname_vscode %} | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | -| JetBrains IDEs | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | -| Vim/Neovim | {% octicon "check" aria-label="Supported" %} | Not applicable | -| Xcode | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Not supported" %} | -| Eclipse | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Not supported" %} | -| Azure Data Studio | {% octicon "x" aria-label="Not supported" %} | Not applicable | -| The {% data variables.product.github %} website | Not applicable | {% octicon "check" aria-label="Supported" %} | -| {% data variables.product.prodname_mobile %} | Not applicable | {% octicon "check" aria-label="Supported" %} | +| Tool | Inline suggestions support | Chat and agent support | +|-------------------------------------------------|:---------------------------------------------:|:----------------------------------------------:| +| {% data variables.product.prodname_vs %} | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | +| {% data variables.product.prodname_vscode %} | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | +| JetBrains IDEs | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | +| Vim/Neovim | {% octicon "check" aria-label="Supported" %} | Not applicable | +| Xcode | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Not supported" %} | +| Eclipse | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Not supported" %} | +| Azure Data Studio | {% octicon "x" aria-label="Not supported" %} | Not applicable | +| The {% data variables.product.github %} website | Not applicable | {% octicon "check" aria-label="Supported" %} | +| {% data variables.product.prodname_mobile %} | Not applicable | {% octicon "check" aria-label="Supported" %} | +| {% data variables.copilot.github_copilot_app %} | Not applicable | {% octicon "check" aria-label="Supported" %} | +| {% data variables.copilot.copilot_cli %} | Not applicable | {% octicon "check" aria-label="Supported" %} | Content exclusions also apply to {% data variables.copilot.copilot_code-review_short %} on the {% data variables.product.github %} website. diff --git a/content/copilot/how-tos/configure-content-exclusion/exclude-content-from-copilot.md b/content/copilot/how-tos/configure-content-exclusion/exclude-content-from-copilot.md index ff7d8a0a299e..9010d25e6d54 100644 --- a/content/copilot/how-tos/configure-content-exclusion/exclude-content-from-copilot.md +++ b/content/copilot/how-tos/configure-content-exclusion/exclude-content-from-copilot.md @@ -31,7 +31,7 @@ category: You can use your repository settings to specify content in your repository that {% data variables.product.prodname_copilot %} should ignore. > [!NOTE] -> {% data variables.copilot.copilot_cli %} and Agent mode in {% data variables.copilot.copilot_chat_short %} in IDEs do not support content exclusion. For more information about these {% data variables.product.prodname_copilot_short %} features, see [AUTOTITLE](/copilot/concepts/agents/copilot-cli/about-copilot-cli) and [AUTOTITLE](/copilot/how-tos/chat-with-copilot/chat-in-ide). +> Agent mode in {% data variables.copilot.copilot_chat_short %} in IDEs does not support content exclusion. For more information, see [AUTOTITLE](/copilot/how-tos/chat-with-copilot/chat-in-ide). {% data reusables.repositories.navigate-to-repo %} {% data reusables.repositories.sidebar-settings %} diff --git a/content/copilot/how-tos/copilot-cli/administer-copilot-cli-for-your-enterprise.md b/content/copilot/how-tos/copilot-cli/administer-copilot-cli-for-your-enterprise.md index a3201415c77b..f24f57769888 100644 --- a/content/copilot/how-tos/copilot-cli/administer-copilot-cli-for-your-enterprise.md +++ b/content/copilot/how-tos/copilot-cli/administer-copilot-cli-for-your-enterprise.md @@ -49,6 +49,10 @@ Separately, users can also provide their own LLM keys locally. This is not contr Enterprise-configured custom agents are available to use with {% data variables.copilot.copilot_cli_short %}. +### Content exclusion + +Content exclusion policies configured at the enterprise, organization, and repository levels apply to {% data variables.copilot.copilot_cli_short %}. Excluded files are not used as context. For more information, see [AUTOTITLE](/copilot/concepts/context/content-exclusion). + ### MCP server policies Enterprise and organization MCP policies apply to {% data variables.copilot.copilot_cli_short %}. You can configure an MCP registry URL so developers can discover approved servers, and set an allowlist policy to restrict which MCP servers can run. For more information, see [AUTOTITLE](/copilot/how-tos/administer-copilot/manage-mcp-usage/restrict-based-on-registry). @@ -70,7 +74,6 @@ Users must have an assigned {% data variables.product.prodname_copilot %} seat t All other controls do **not** affect {% data variables.copilot.copilot_cli_short %}, notably: * **IDE-specific policies**: Policies configured for specific IDEs or editor extensions -* **Content exclusions**: File path-based content exclusions ## Why can't my developers access {% data variables.copilot.copilot_cli_short %}? diff --git a/content/copilot/reference/supported-surfaces-for-policies.md b/content/copilot/reference/supported-surfaces-for-policies.md index 9f55ccfe606a..8661cffcb7ad 100644 --- a/content/copilot/reference/supported-surfaces-for-policies.md +++ b/content/copilot/reference/supported-surfaces-for-policies.md @@ -26,7 +26,7 @@ A dedicated policy exists to enable or disable each supported feature or surface | Suggestions matching public code | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %}[^1] | {% octicon "check" aria-label="Supported" %}[^1] | {% octicon "x" aria-label="Not supported" %} | {% octicon "x" aria-label="Not supported" %} | {% octicon "x" aria-label="Not supported" %} | {% octicon "x" aria-label="Not supported" %} | {% octicon "x" aria-label="Not supported" %} | | MCP servers in {% data variables.product.prodname_copilot_short %} | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Not supported" %} | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Not supported" %} | | Restrict MCP access to registry servers | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Not supported" %} | {% octicon "x" aria-label="Not supported" %} | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Not supported" %} | {% octicon "x" aria-label="Not supported" %} | {% octicon "x" aria-label="Not supported" %} | -| Content exclusion | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Not supported" %} | {% octicon "x" aria-label="Not supported" %} | {% octicon "x" aria-label="Not supported" %} | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Not supported" %} | +| Content exclusion | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Not supported" %} | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Not supported" %} | | Configure models | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Not supported" %} | {% octicon "x" aria-label="Not supported" %} | | {% data variables.copilot.copilot_memory %} | {% octicon "x" aria-label="Not supported" %} | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Not supported" %} | {% octicon "x" aria-label="Not supported" %} | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Not supported" %} | diff --git a/src/languages/lib/correct-translation-content.ts b/src/languages/lib/correct-translation-content.ts index b9084d1c55c7..01aa1fa2ebea 100644 --- a/src/languages/lib/correct-translation-content.ts +++ b/src/languages/lib/correct-translation-content.ts @@ -1122,6 +1122,17 @@ export function correctTranslatedContentStrings( } if (context.code === 'ru') { + // configuring-custom-footers.md: the translator scrambled the sentence + // around `{% data variables.product.prodname_dotcom %} footer{% ifversion + // ghes %}, ...{% elsif ghec %}...{% endif %}`, duplicating `{% данных` + // (data) twice, merging `ifversion ghes`/`elsif ghec` into a single + // invalid `{% ghversion %}` tag, and dropping the space before the final + // `{%endif %}` (`tag "ghversion" not found`). Reconstruct the original + // ifversion/elsif/endif structure with the correct Russian prose. + content = content.replaceAll( + '{% данных {% данных variables.product.prodname_dotcom %} нижнего колонтитула {% ghversion %}, для всех пользователей и участников совместной работы на всех страницах репозитория и организации для репозиториев и организаций, принадлежащих к корпоративным variables.location.product_location_enterprise{%endif %}.', + '{% data variables.product.prodname_dotcom %} нижнего колонтитула{% ifversion ghes %}, для всех пользователей и на всех страницах {% data variables.location.product_location_enterprise %}{% elsif ghec %} для всех пользователей и участников совместной работы на всех страницах репозитория и организации для репозиториев и организаций, принадлежащих к предприятию{% endif %}.', + ) content = content.replaceAll('[«AUTOTITLE»](', '[AUTOTITLE](') content = content.replaceAll('[АВТОЗАГОЛОВОК](', '[AUTOTITLE](') // `[{% autoTITLE](url)` — Liquid-embedded lowercase autotitle (translator lowercased @@ -2657,6 +2668,28 @@ export function correctTranslatedContentStrings( content = content.replace(reorderRegex, '$1$2{% else %}$3{% endif %}') } + // Restore a trailing `{% endif %}` that translators dropped when it was + // the very last token of the file (with no space before it in English, so + // there was nothing visually separating it from the preceding prose for + // the translator to notice and carry over). We only do this when the + // English content truly ends with an unspaced `{% endif %}` and the + // translated content is missing exactly one closer relative to its + // `ifversion`/`elsif` openers, so we don't add a spurious closer to + // content that is unrelated or already balanced. + if (englishContent) { + const englishTrimmed = englishContent.trimEnd() + if (englishTrimmed.endsWith('{% endif %}') && !/\s\{% endif %\}$/.test(englishTrimmed)) { + const contentTrimmed = content.trimEnd() + if (!contentTrimmed.endsWith('{% endif %}')) { + const openers = (contentTrimmed.match(/\{%-?\s*ifversion\b/g) || []).length + const closers = (contentTrimmed.match(/\{%-?\s*endif\b/g) || []).length + if (openers - closers === 1) { + content = `${contentTrimmed}{% endif %}\n` + } + } + } + } + // Final catch-all: earlier normalizations (e.g. space-in-braces regex) can // recreate `{{% KEYWORD` patterns after the per-keyword fixes already ran. // Strip the extra `{` for known Liquid tag names. diff --git a/src/languages/tests/correct-translation-content.ts b/src/languages/tests/correct-translation-content.ts index 3e99a6b66c69..cca713c96041 100644 --- a/src/languages/tests/correct-translation-content.ts +++ b/src/languages/tests/correct-translation-content.ts @@ -2939,4 +2939,54 @@ Para más información, consulta "[AUTOTITLE](/path)". ) }) }) + + describe('universal: restores a trailing {% endif %} dropped at end of file', () => { + const english = 'Some text is only shown{% ifversion fpt %} on the free plan{% endif %}' + + test('appends the missing endif when the translation drops it at end of file', () => { + const broken = 'Algún texto solo se muestra{% ifversion fpt %} en el plan gratuito' + const fixed = + 'Algún texto solo se muestra{% ifversion fpt %} en el plan gratuito{% endif %}\n' + expect(fix(broken, 'es', english)).toBe(fixed) + }) + + test('leaves already-correct translations unchanged', () => { + const correct = + 'Algún texto solo se muestra{% ifversion fpt %} en el plan gratuito{% endif %}' + expect(fix(correct, 'es', english)).toBe(correct) + }) + + test('does not add an endif when the translation is already balanced', () => { + const balanced = 'Texto normal sin condicionales.' + expect(fix(balanced, 'es', 'Texto normal sin condicionales.')).toBe(balanced) + }) + + test('renders the conditional text once the endif is restored', async () => { + const broken = 'Algún texto solo se muestra{% ifversion fpt %} en el plan gratuito' + const output = await render(fix(broken, 'es', english), 'free-pro-team@latest') + expect(output).toBe('Algún texto solo se muestra en el plan gratuito') + }) + }) + + describe('ru: configuring-custom-footers.md per-file fix', () => { + const broken = + 'Вы можете настроить веб-интерфейс для вашего предприятия, чтобы отобразить настраиваемый нижний колонтитул с до пяти дополнительных ссылок. Настраиваемый нижний колонтитул по умолчанию отображается над нижним колонтитулов {% данных {% данных variables.product.prodname_dotcom %} нижнего колонтитула {% ghversion %}, для всех пользователей и участников совместной работы на всех страницах репозитория и организации для репозиториев и организаций, принадлежащих к корпоративным variables.location.product_location_enterprise{%endif %}.' + const fixed = + 'Вы можете настроить веб-интерфейс для вашего предприятия, чтобы отобразить настраиваемый нижний колонтитул с до пяти дополнительных ссылок. Настраиваемый нижний колонтитул по умолчанию отображается над нижним колонтитулов {% data variables.product.prodname_dotcom %} нижнего колонтитула{% ifversion ghes %}, для всех пользователей и на всех страницах {% data variables.location.product_location_enterprise %}{% elsif ghec %} для всех пользователей и участников совместной работы на всех страницах репозитория и организации для репозиториев и организаций, принадлежащих к предприятию{% endif %}.' + + test('reconstructs the scrambled data/ifversion/elsif/endif structure', () => { + expect(fix(broken, 'ru')).toBe(fixed) + expect(fix(fixed, 'ru')).toBe(fixed) + }) + + test('renders the enterprise-cloud branch on ghec', async () => { + const output = await render(fix(broken, 'ru'), 'enterprise-cloud@latest') + expect(output).toContain('GitHub нижнего колонтитула для всех пользователей') + }) + + test('renders the ghes branch on ghes', async () => { + const output = await render(fix(broken, 'ru'), ghesVersion) + expect(output).toContain('GitHub нижнего колонтитула, для всех пользователей') + }) + }) })