Skip to content

Commit

Permalink
Merge pull request github#35394 from github/repo-sync
Browse files Browse the repository at this point in the history
Repo sync
  • Loading branch information
docs-bot authored Nov 22, 2024
2 parents 465b512 + 46cd4cc commit a7a8033
Show file tree
Hide file tree
Showing 21 changed files with 158 additions and 71 deletions.
Binary file modified assets/images/help/copilot/chat-general-purpose-button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/help/copilot/chat-new-conversation-button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/help/copilot/copilot-chat-all-repositories.png
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 @@ -44,7 +44,7 @@ If you hold a trademark for the username, you can find more information about ma

If you do not hold a trademark for the name, you can choose another username or keep your current username. {% data variables.contact.github_support %} cannot release the unavailable username for you. For more information, see "[Changing your username](#changing-your-username)."{% endif %}

After changing your username, your previous username will be unavailable for anyone to claim for 90 days. Most references to your repositories under the previous username automatically change to the new username. However, some links to your profile won't automatically redirect.
After changing your username, your old username becomes available for anyone else to claim. Most references to your repositories under the old username automatically change to the new username. However, some links to your profile won't automatically redirect.

{% data variables.product.product_name %} cannot set up redirects for:
* [@mentions](/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#mentioning-people-and-teams) using your old username
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ Set up a new instance to act as your staging environment. You can use the same g

If you plan to restore a backup of your production instance, continue to the next step. Alternatively, you can configure the instance manually and skip the following steps.

> [!WARNING]
> Restoring backups with {% data variables.product.prodname_actions %} will not succeed on a non-configured instance. To enable {% data variables.product.prodname_actions %}, an instance with a hostname configured is required. For more information, see "[AUTOTITLE](/admin/configuring-settings/configuring-network-settings/configuring-the-hostname-for-your-instance)."
### 3. Configure {% data variables.product.prodname_actions %}

Optionally, if you use {% data variables.product.prodname_actions %} on your production instance, configure the feature on the staging instance before restoring your production backup. If you don't use {% data variables.product.prodname_actions %}, skip to "[1. Configure {% data variables.product.prodname_registry %}](#4-configure-github-packages)."
Expand All @@ -78,6 +81,12 @@ Optionally, if you use {% data variables.product.prodname_actions %} on your pro
ghe-config app.actions.enabled true
```

1. To apply the configuration changes, enter the following command.

```shell copy
ghe-config-apply
```

### 4. Configure {% data variables.product.prodname_registry %}

Optionally, if you use {% data variables.product.prodname_registry %} on your production instance, configure the feature on the staging instance before restoring your production backup. If you don't use {% data variables.product.prodname_registry %}, skip to "[1. Restore your production backup](#5-restore-your-production-backup)."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ Once enabled, automatic dependency submission jobs will run on the self-hosted r

Automatic dependency submission is currently only supported for Maven. The feature uses the Maven Dependency Tree Submission action. For more information, see the documentation for the [Maven Dependency Tree Dependency Submission](https://github.com/marketplace/actions/maven-dependency-tree-dependency-submission) action in the {% data variables.product.prodname_marketplace %}. If your project uses a non-standard Maven configuration, it may not properly generate the dependencies and submit them to the dependency graph.

Automatic dependency submission makes a best effort to cache package downloads between runs using the [Cache](https://github.com/marketplace/actions/cache) action to speed up workflows. For self-hosted runners, you may want to manage this cache within your own infrastructure. To do this, you can disable the built-in caching by setting an environment variable of `GH_DEPENDENCY_SUBMISSION_SKIP_CACHE` to `true`. For more information, see "[AUTOTITLE](/actions/learn-github-actions/variables)."

## Further reading

* "[AUTOTITLE](/code-security/supply-chain-security/understanding-your-software-supply-chain/about-supply-chain-security)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ The skills you can use in {% data variables.product.prodname_copilot_chat_dotcom
> [!NOTE] If you use {% data variables.product.prodname_copilot_extensions_short %}, they may override the model you select.
{% data reusables.copilot.model-picker-enable-o1-models %}
1. In the bottom right of any page on {% data variables.product.github %}, click {% octicon "copilot" aria-label="Open Copilot Chat" %}.
1. In the top right of any page on {% data variables.product.github %}, click the **{% octicon "copilot" aria-hidden="true" %}** {% data variables.product.prodname_copilot %} icon next to the search bar.
1. If the panel contains a previous conversation you had with {% data variables.product.prodname_copilot_short %}, in the top right of the panel, click {% octicon "plus" aria-label="New conversation" %}.

![Screenshot of the new conversation button, highlighted with a dark orange outline.](/assets/images/help/copilot/chat-new-conversation-button.png)

1. In the top right of the panel, select the {% octicon "kebab-horizontal" aria-label="Open conversation options" %} dropdown menu, then click **{% octicon "screen-full" aria-hidden="true" %} Take conversation to immersive**. Multi-model {% data variables.product.prodname_copilot_chat_short %} is currently only available in the immersive view.
1. In the top right of the panel, click **{% octicon "screen-full" aria-hidden="true" %} Take conversation to immersive**. Multi-model {% data variables.product.prodname_copilot_chat_short %} is currently only available in the immersive view.
1. In the top left of the immersive view, select the **CURRENT-MODEL** {% octicon "chevron-down" aria-hidden="true" %} dropdown menu, then click the AI model of your choice.

## Asking a general question about software development
Expand Down Expand Up @@ -131,7 +131,7 @@ Depending on the question you ask, and your enterprise and organization settings

1. On the {% data variables.product.prodname_dotcom %} website, go to the repository you want to chat about.

1. Click the **{% octicon "copilot" aria-hidden="true" %}** {% data variables.product.prodname_copilot %} icon at the bottom right of the page.
1. In the top right of any page on {% data variables.product.github %}, click the **{% octicon "copilot" aria-hidden="true" %}** {% data variables.product.prodname_copilot %} icon next to the search bar.

The {% data variables.product.prodname_copilot_chat %} panel is displayed. To resize the panel, click and drag the top or left edge.

Expand Down Expand Up @@ -281,7 +281,7 @@ You can chat with {% data variables.product.prodname_copilot_short %} about a fi
1. You can continue the conversation by asking a follow-up question. For example, you could type "tell me more" to get {% data variables.product.prodname_copilot_short %} to expand on its last comment.
1. To clear, delete, or rename the current conversation thread, or to start a new thread, type `/` in the "Ask {% data variables.product.prodname_copilot_short %}" box, select from the options that are displayed, then press <kbd>Enter</kbd>.

1. To view a conversation in immersive mode, displaying just the conversation thread, click {% octicon "kebab-horizontal" aria-label="Open conversation options" %} at the top right of the conversation thread, then click **{% octicon "screen-full" aria-hidden="true" %} Take conversation to immersive**.
1. To view a conversation in immersive mode, displaying just the conversation thread, click **{% octicon "screen-full" aria-hidden="true" %} Take conversation to immersive**.

## Asking questions about {% data variables.product.prodname_GH_advanced_security %} alerts

Expand Down Expand Up @@ -463,7 +463,7 @@ You can ask {% data variables.product.prodname_copilot_short %} a question about

To give feedback about a particular {% data variables.product.prodname_copilot_chat_short %} response, click either the thumbs up or thumbs down icon at the bottom of each chat response.

To give feedback about {% data variables.product.prodname_copilot_chat_short %} in general, click the ellipsis (**...**) at the top right of the chat panel, then click **Give feedback**.
To give feedback about {% data variables.product.prodname_copilot_chat_short %} in general, click the ellipsis (**...**) at the top right of the chat panel, then click **{% octicon "comment-discussion" aria-hidden="true" %} Give feedback**.

## Further reading

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ shortTitle: Delete organization
{% endif %}
Deleting your organization account removes all repositories, forks of private repositories, wikis, issues, pull requests, and project or organization pages. {% ifversion fpt or ghec %}Your billing will end and, after 90 days, the organization name becomes available for use on a new user or organization account.

{% tip %}

**Tip**: If you rename an organization, you can create a new organization with the same name immediately. For more information, see "[AUTOTITLE](/organizations/managing-organization-settings/renaming-an-organization)."

{% endtip %}

{% endif %}

{% ifversion fpt or ghec %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ topics:
## What happens when I change my organization's name?

After changing your organization's name, your previous organization name will be unavailable for anyone to claim for 90 days. When you change your organization's name, most references to your repositories under the previous organization name automatically change to the new name. However, some links to your profile won't automatically redirect.
After changing your organization's name, your old organization name becomes available for someone else to claim. When you change your organization's name, most references to your repositories under the old organization name automatically change to the new name. However, some links to your profile won't automatically redirect.

### Changes that occur automatically

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Depending on which rules are active, you may need to edit your commit history lo

If a branch or tag is targeted by rules restricting the metadata of commits, your commits may be rejected if part of the commit's metadata does not match a certain pattern. For example, you might need to add an issue number to the start of your commit message, or change the name of a new branch or tag you're trying to push to the repository. If your commits are rejected, you will see a message telling you the pattern the relevant metadata needs to match. As with signed commits, you may need to perform a rebase to squash the commits or rewrite each commit individually. For more information, see "[AUTOTITLE](/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/available-rules-for-rulesets#metadata-restrictions)."

When utilizing push rulesets, a maximum of 1000 reference updates are allowed per push. If your push exceeds this limit, it will be rejected. For more information see "[AUTOTITLE](/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/creating-rulesets-for-a-repository#creating-a-push-ruleset)".

{% ifversion repo-rules-required-workflows %}

## Troubleshooting ruleset workflows
Expand Down
4 changes: 1 addition & 3 deletions data/reusables/copilot/chat-conversation-buttons.md
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
1. To jump back into a previous conversation you had with {% data variables.product.prodname_copilot_short %}, click the "View conversations" icon (a clock face surrounded by a circular arrow) at the top right of the panel.

![Screenshot of the "Conversation history" icon, highlighted with a dark orange outline.](/assets/images/help/copilot/chat-view-conversations-button.png)
1. To jump back into a previous conversation you had with {% data variables.product.prodname_copilot_short %}, select the {% octicon "kebab-horizontal" aria-label="Open conversation options" %} dropdown menu, then click **{% octicon "history" aria-hidden="true" %} View all conversations**.
2 changes: 1 addition & 1 deletion data/reusables/copilot/go-to-copilot-page.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
1. On any page on {% data variables.product.github %}, click the **{% octicon "copilot" aria-hidden="true" %}** {% data variables.product.prodname_copilot %} icon at the bottom right of the page.
1. In the top right of any page on {% data variables.product.github %}, click the **{% octicon "copilot" aria-hidden="true" %}** {% data variables.product.prodname_copilot %} icon next to the search bar.

The {% data variables.product.prodname_copilot_chat %} panel is displayed. To resize the panel, click and drag the top or left edge.

Expand Down
2 changes: 1 addition & 1 deletion data/reusables/copilot/open-copilot.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
1. At the bottom right of the page, click the **{% octicon "copilot" aria-hidden="true" %}** {% data variables.product.prodname_copilot %} icon.
1. In the top right of any page on {% data variables.product.github %}, click the **{% octicon "copilot" aria-hidden="true" %}** {% data variables.product.prodname_copilot %} icon next to the search bar.

The {% data variables.product.prodname_copilot_chat %} panel is displayed. To resize the panel, click and drag the top or left edge.

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": "014cf4c9c23bf1f27dd034a2a76b92388951c01c"
"sha": "49363b4aeeaf1b397f113178250e939829c4c684"
}
8 changes: 8 additions & 0 deletions src/search/middleware/ai-search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,16 @@ import express, { Request, Response } from 'express'

import catchMiddlewareError from '#src/observability/middleware/catch-middleware-error.js'
import { aiSearchProxy } from '../lib/ai-search-proxy'
import { createRateLimiter } from '#src/shielding/middleware/rate-limit.js'

const router = express.Router()
if (process.env.NODE_ENV === 'test') {
router.use(createRateLimiter(7)) // set to 7 so last test in api-ai-search.ts will exceed rate limit
} else if (process.env.NODE_ENV === 'development') {
router.use(createRateLimiter(10)) // just 1 worker in dev so 10 requests per minute allowed
} else if (process.env.NODE_ENV === 'production') {
router.use(createRateLimiter(1)) // 1 * 25 requests per minute for prod
}

router.post(
'/v1',
Expand Down
6 changes: 6 additions & 0 deletions src/search/middleware/search-routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,14 @@ import { getAutocompleteSearchResults } from '@/search/lib/get-elasticsearch-res
import { getAISearchAutocompleteResults } from '@/search/lib/get-elasticsearch-results/ai-search-autocomplete'
import { getSearchFromRequestParams } from '@/search/lib/search-request-params/get-search-from-request-params'
import { getGeneralSearchResults } from '@/search/lib/get-elasticsearch-results/general-search'
import { createRateLimiter } from '#src/shielding/middleware/rate-limit.js'

const router = express.Router()
if (process.env.NODE_ENV === 'development') {
router.use(createRateLimiter(10)) // just 1 worker in dev so 10 requests per minute allowed
} else if (process.env.NODE_ENV === 'production') {
router.use(createRateLimiter(1)) // 1 * 25 requests per minute for prod
}

router.get('/legacy', (req: Request, res: Response) => {
res.status(410).send('Use /api/search/v1 instead.')
Expand Down
51 changes: 51 additions & 0 deletions src/search/tests/api-ai-search.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// IMPORTANT: If you add more tests to this that make requests to
// http://localhost:4000/api/ai-search/v1 make sure you increment the rate limit
// value when NODE_ENV === 'test' in src/search/middleware/ai-search.ts
import { expect, test, describe, beforeAll, afterAll } from 'vitest'

import { post } from 'src/tests/helpers/e2etest.js'
Expand Down Expand Up @@ -79,6 +82,41 @@ describe('AI Search Routes', () => {
expect(receivedMessage).toBe(expectedMessage)
})

// We can't actually trigger a full rate limit because
// then all other tests will all fail. And we can't rely on this
// test always being run last.
test('should respect rate limiting', async () => {
let apiBody = { query: 'How do I create a Repository?', language: 'en', version: 'dotcom' }

const response = await fetch('http://localhost:4000/api/ai-search/v1', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(apiBody),
})

expect(response.ok).toBe(true)
expect(response.status).toBe(200)
const limit = parseInt(response.headers.get('ratelimit-limit') || '0')
const remaining = parseInt(response.headers.get('ratelimit-remaining') || '0')
expect(limit).toBeGreaterThan(0)
expect(remaining).toBeLessThan(limit)

const response2 = await fetch('http://localhost:4000/api/ai-search/v1', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(apiBody),
})

expect(response2.ok).toBe(true)
expect(response2.status).toBe(200)
const newLimit = parseInt(response2.headers.get('ratelimit-limit') || '0')
const newRemaining = parseInt(response2.headers.get('ratelimit-remaining') || '0')
expect(newLimit).toBe(limit)
// Can't rely on `newRemaining == remaining - 1` because of
// concurrency of test-running.
expect(newRemaining).toBeLessThan(remaining)
})

test('should handle validation errors: query missing', async () => {
let body = { language: 'en', version: 'dotcom' }
const response = await post('/api/ai-search/v1', {
Expand Down Expand Up @@ -145,4 +183,17 @@ describe('AI Search Routes', () => {
},
])
})

test('should rate limit when total number of requests exceeds max amount', async () => {
let apiBody = { query: 'How do I create a Repository?', language: 'en', version: 'dotcom' }

const response = await fetch('http://localhost:4000/api/ai-search/v1', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(apiBody),
})

expect(response.ok).toBe(false)
expect(response.status).toBe(429)
})
})
2 changes: 1 addition & 1 deletion src/secret-scanning/data/public-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2994,7 +2994,7 @@
fpt: '*'
ghec: '*'
ghes: '>=3.15'
isPublic: false
isPublic: true
isPrivateWithGhas: true
hasPushProtection: false
hasValidityCheck: false
Expand Down
4 changes: 2 additions & 2 deletions src/secret-scanning/lib/config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"sha": "2d12e72e667b4842e181cadaff7ad619e356d5d1",
"blob-sha": "b1855224a34264029de0f0e7d8967ac1ee009419",
"sha": "a24682e7de2b1053278de2c44d4062aa80ffac33",
"blob-sha": "2eedb5973d30edfcf497b0810c36ffc8a061b474",
"targetFilename": "code-security/secret-scanning/introduction/supported-secret-scanning-patterns"
}
4 changes: 2 additions & 2 deletions src/shielding/middleware/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import handleOldNextDataPaths from './handle-old-next-data-paths'
import handleInvalidQuerystringValues from './handle-invalid-query-string-values'
import handleInvalidNextPaths from './handle-invalid-nextjs-paths'
import handleInvalidHeaders from './handle-invalid-headers'
import rateLimit from './rate-limit'
import { createRateLimiter } from './rate-limit'

const router = express.Router()

router.use(rateLimit)
router.use(createRateLimiter())
router.use(handleInvalidQuerystrings)
router.use(handleInvalidPaths)
router.use(handleOldNextDataPaths)
Expand Down
Loading

0 comments on commit a7a8033

Please sign in to comment.