Skip to content

Repo sync #37991

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

Merged
merged 4 commits into from
May 1, 2025
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
Binary file added assets/images/search/copilot-action.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 @@ -237,7 +237,7 @@ The following table summarizes when an alternative model may be a better choice:

OpenAI o3-mini is a fast, cost-effective reasoning model designed to deliver coding performance while maintaining lower latency and resource usage. o3-mini outperforms o1 on coding benchmarks with response times that are comparable to o1-mini. Copilot is configured to use OpenAI's "medium" reasoning effort.

For more information about o1, see [OpenAI's documentation](https://platform.openai.com/docs/models/o3-mini).
For more information about o3-mini, see [OpenAI's documentation](https://platform.openai.com/docs/models/o3-mini).

### Use cases

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ children:
- /about-email-notifications-for-pushes-to-your-repository
- /configuring-autolinks-to-reference-external-resources
- /configuring-tag-protection-rules
- /managing-auto-closing-issues
shortTitle: Manage repository settings
---

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
title: Managing the automatic closing of issues in your repository
intro: You can select whether merged linked pull requests will auto-close your issues.
versions:
fpt: '*'
ghes: '*'
ghec: '*'
permissions: Repository administrators and maintainers can configure the automating closing of issues in the repository, once related pull requests are merged.
topics:
- Repositories
- Issues
- Pull requests
shortTitle: Manage auto-closing issues
allowTitleToDifferFromFilename: true
---

## About auto-closing issues

By default, merging a linked pull request automatically closes the associated issue. You can override the default behavior by disabling auto-closing.

## Enabling or disabling auto-closing of issues

{% data reusables.repositories.navigate-to-repo %}
{% data reusables.repositories.sidebar-settings %}
1. Under **General**, scroll down to the **Issues** section.
1. Select or deselect **Auto-close issues with merged linked pull requests** to enable or disable auto-closing.
3 changes: 3 additions & 0 deletions data/ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ search:
general_title: There was an error loading search results.
ai_title: There was an error loading Copilot.
description: You can still use this field to search our docs.
cta:
heading: New! Copilot for Docs
description: Ask your question in the search bar and get help in seconds.
old_search:
description: Enter a search term to find it in the GitHub Docs.
placeholder: Search GitHub Docs
Expand Down
3 changes: 3 additions & 0 deletions src/fixtures/fixtures/data/ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ search:
general_title: There was an error loading search results.
ai_title: There was an error loading Copilot.
description: You can still use this field to search our docs.
cta:
heading: New! Copilot for Docs
description: Ask your question in the search bar and get help in seconds.
old_search:
description: Enter a search term to find it in the GitHub Docs.
placeholder: Search GitHub Docs
Expand Down
78 changes: 78 additions & 0 deletions src/frame/components/context/CTAContext.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
// Context to keep track of a call to action (e.g. popover introducing a new feature)
// The state of the CTA will be stored in local storage, so it will persist across page reloads
// If `dismiss` is called, the CTA will not be shown again
import {
createContext,
useCallback,
useContext,
useEffect,
useState,
PropsWithChildren,
} from 'react'

type CTAPopoverState = {
isOpen: boolean
initializeCTA: () => void // Call to "open" the CTA if it's not already been dismissed by the user
dismiss: () => void // Call to "close" the CTA and store the dismissal in local storage
}

type StoredValue = { dismissed: true }

const CTAPopoverContext = createContext<CTAPopoverState | undefined>(undefined)

const STORAGE_KEY = 'ctaPopoverDismissed'

const isDismissed = (): boolean => {
if (typeof window === 'undefined') return false // SSR guard
try {
const raw = localStorage.getItem(STORAGE_KEY)
if (!raw) return false
const parsed = JSON.parse(raw) as StoredValue
return parsed?.dismissed
} catch {
return false // corruption / quota / disabled storage
}
}

export function CTAPopoverProvider({ children }: PropsWithChildren) {
// We start closed because we might only want to "turn on" the CTA if an experiment is active
const [isOpen, setIsOpen] = useState(false)

const persistDismissal = useCallback(() => {
setIsOpen(false)
try {
const obj: StoredValue = { dismissed: true }
localStorage.setItem(STORAGE_KEY, JSON.stringify(obj))
} catch {
/* ignore */
}
}, [])

const dismiss = useCallback(() => persistDismissal(), [persistDismissal])
const initializeCTA = useCallback(() => {
const dismissed = isDismissed()
if (dismissed) {
setIsOpen(false)
} else {
setIsOpen(true)
}
}, [isDismissed])

// Wrap in a useEffect to avoid a hydration mismatch (SSR guard)
useEffect(() => {
const stored = isDismissed()
setIsOpen(!stored)
}, [])

return (
<CTAPopoverContext.Provider value={{ isOpen, initializeCTA, dismiss }}>
{children}
</CTAPopoverContext.Provider>
)
}

export const useCTAPopoverContext = () => {
const ctx = useContext(CTAPopoverContext)
if (!ctx) throw new Error('useCTAPopoverContext must be used inside <CTAPopoverProvider>')
return ctx
}
4 changes: 4 additions & 0 deletions src/frame/components/page-header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { useShouldShowExperiment } from '@/events/components/experiments/useShou
import { useQueryParam } from '@/frame/components/hooks/useQueryParam'
import { useMultiQueryParams } from '@/search/components/hooks/useMultiQueryParams'
import { SearchOverlayContainer } from '@/search/components/input/SearchOverlayContainer'
import { useCTAPopoverContext } from '@/frame/components/context/CTAContext'

import styles from './Header.module.scss'

Expand Down Expand Up @@ -50,6 +51,7 @@ export const Header = () => {
const { width } = useInnerWindowWidth()
const returnFocusRef = useRef(null)
const searchButtonRef = useRef<HTMLButtonElement>(null)
const { initializeCTA } = useCTAPopoverContext()

const showNewSearch = useShouldShowExperiment(EXPERIMENTS.ai_search_experiment)
let SearchButton: JSX.Element | null = (
Expand All @@ -62,6 +64,8 @@ export const Header = () => {
)
if (!showNewSearch) {
SearchButton = null
} else {
initializeCTA()
}

useEffect(() => {
Comment on lines +67 to 71
Copy link
Preview

Copilot AI May 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling initializeCTA() directly during render causes a state update in the render phase. Move this call into a useEffect that depends on showNewSearch to avoid side effects in the render path.

Suggested change
} else {
initializeCTA()
}
useEffect(() => {
}
useEffect(() => {
if (showNewSearch) {
initializeCTA()
}
}, [showNewSearch])
useEffect(() => {

Copilot uses AI. Check for mistakes.

Expand Down
5 changes: 4 additions & 1 deletion src/frame/pages/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
} from 'src/languages/components/LanguagesContext'
import { useTheme } from 'src/color-schemes/components/useTheme'
import { SharedUIContextProvider } from 'src/frame/components/context/SharedUIContext'
import { CTAPopoverProvider } from 'src/frame/components/context/CTAContext'

type MyAppProps = AppProps & {
isDotComAuthenticated: boolean
Expand Down Expand Up @@ -140,7 +141,9 @@ const MyApp = ({ Component, pageProps, languagesContext, stagingName }: MyAppPro
>
<LanguagesContext.Provider value={languagesContext}>
<SharedUIContextProvider>
<Component {...pageProps} />
<CTAPopoverProvider>
<Component {...pageProps} />
</CTAPopoverProvider>
</SharedUIContextProvider>
</LanguagesContext.Provider>
</ThemeProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8222,6 +8222,15 @@
"requestPath": "/users/{username}/settings/billing/shared-storage",
"additional-permissions": false,
"access": "read"
},
{
"category": "billing",
"slug": "get-billing-usage-report-for-a-user",
"subcategory": "enhanced-billing",
"verb": "get",
"requestPath": "/users/{username}/settings/billing/usage",
"additional-permissions": false,
"access": "read"
}
]
},
Expand Down
6 changes: 6 additions & 0 deletions src/github-apps/data/fpt-2022-11-28/fine-grained-pat.json
Original file line number Diff line number Diff line change
Expand Up @@ -1085,6 +1085,12 @@
"subcategory": "billing",
"verb": "get",
"requestPath": "/users/{username}/settings/billing/shared-storage"
},
{
"slug": "get-billing-usage-report-for-a-user",
"subcategory": "enhanced-billing",
"verb": "get",
"requestPath": "/users/{username}/settings/billing/usage"
}
],
"branches": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9981,6 +9981,17 @@
"user-to-server": true,
"server-to-server": false,
"additional-permissions": false
},
{
"category": "billing",
"slug": "get-billing-usage-report-for-a-user",
"subcategory": "enhanced-billing",
"verb": "get",
"requestPath": "/users/{username}/settings/billing/usage",
"access": "read",
"user-to-server": true,
"server-to-server": false,
"additional-permissions": false
}
]
},
Expand Down
6 changes: 6 additions & 0 deletions src/github-apps/data/fpt-2022-11-28/user-to-server-rest.json
Original file line number Diff line number Diff line change
Expand Up @@ -1085,6 +1085,12 @@
"subcategory": "billing",
"verb": "get",
"requestPath": "/users/{username}/settings/billing/shared-storage"
},
{
"slug": "get-billing-usage-report-for-a-user",
"subcategory": "enhanced-billing",
"verb": "get",
"requestPath": "/users/{username}/settings/billing/usage"
}
],
"branches": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8921,6 +8921,15 @@
"requestPath": "/users/{username}/settings/billing/shared-storage",
"additional-permissions": false,
"access": "read"
},
{
"category": "billing",
"slug": "get-billing-usage-report-for-a-user",
"subcategory": "enhanced-billing",
"verb": "get",
"requestPath": "/users/{username}/settings/billing/usage",
"additional-permissions": false,
"access": "read"
}
]
},
Expand Down
6 changes: 6 additions & 0 deletions src/github-apps/data/ghec-2022-11-28/fine-grained-pat.json
Original file line number Diff line number Diff line change
Expand Up @@ -1123,6 +1123,12 @@
"subcategory": "billing",
"verb": "get",
"requestPath": "/users/{username}/settings/billing/shared-storage"
},
{
"slug": "get-billing-usage-report-for-a-user",
"subcategory": "enhanced-billing",
"verb": "get",
"requestPath": "/users/{username}/settings/billing/usage"
}
],
"branches": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10830,6 +10830,17 @@
"user-to-server": true,
"server-to-server": false,
"additional-permissions": false
},
{
"category": "billing",
"slug": "get-billing-usage-report-for-a-user",
"subcategory": "enhanced-billing",
"verb": "get",
"requestPath": "/users/{username}/settings/billing/usage",
"access": "read",
"user-to-server": true,
"server-to-server": false,
"additional-permissions": false
}
]
},
Expand Down
6 changes: 6 additions & 0 deletions src/github-apps/data/ghec-2022-11-28/user-to-server-rest.json
Original file line number Diff line number Diff line change
Expand Up @@ -1123,6 +1123,12 @@
"subcategory": "billing",
"verb": "get",
"requestPath": "/users/{username}/settings/billing/shared-storage"
},
{
"slug": "get-billing-usage-report-for-a-user",
"subcategory": "enhanced-billing",
"verb": "get",
"requestPath": "/users/{username}/settings/billing/usage"
}
],
"branches": [
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": "1c22f3361af92533fad97262cf4b7c18574f22a6"
"sha": "467f6a98a97a73630a1f1e75ddee01cb59f33dd5"
}
Loading
Loading