Skip to content

Repo sync #37263

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 3 commits into from
Apr 2, 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
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,11 @@ If a policy is enabled for an enterprise, the policy can be selectively disabled

In the "Workflow permissions" section, you can set the **default** permissions granted to the `GITHUB_TOKEN`.

* **Read and write permissions:** By default, `GITHUB_TOKEN` has read and write access for all scopes.
* **Read and write permissions:** The default permissions for the `GITHUB_TOKEN` depend on when the enterprise or organization was created:

* **Created on or after February 2, 2023** – Defaults to **read-only** access for all scopes.
* **Created before February 2, 2023** – Defaults to **read and write** access for all scopes.

* **Read repository contents and packages permissions:** By default, `GITHUB_TOKEN` has only read access for the `contents` and `packages` scopes. The more permissive setting cannot be chosen as the default for individual organizations or repositories.

Anyone with write access to a repository can still modify the permissions granted to the `GITHUB_TOKEN` for a specific workflow, by editing the `permissions` key in the workflow file.
Expand Down
15 changes: 15 additions & 0 deletions src/audit-logs/data/fpt/organization.json
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,21 @@
"description": "Triggered when a team discussion post is edited.",
"docs_reference_links": "/communities/moderating-comments-and-conversations/managing-disruptive-comments#editing-a-comment"
},
{
"action": "enterprise_announcement.create",
"description": "A global announcement banner was created for the enterprise.",
"docs_reference_links": "/admin/managing-accounts-and-repositories/communicating-information-to-users-in-your-enterprise/customizing-user-messages-for-your-enterprise#creating-a-global-announcement-banner"
},
{
"action": "enterprise_announcement.destroy",
"description": "A global announcement banner was removed from the enterprise.",
"docs_reference_links": "/admin/managing-accounts-and-repositories/communicating-information-to-users-in-your-enterprise/customizing-user-messages-for-your-enterprise"
},
{
"action": "enterprise_announcement.update",
"description": "A global announcement banner was updated for the enterprise.",
"docs_reference_links": "/admin/managing-accounts-and-repositories/communicating-information-to-users-in-your-enterprise/customizing-user-messages-for-your-enterprise"
},
{
"action": "enterprise_installation.create",
"description": "The GitHub App associated with a GitHub Connect connection was created.",
Expand Down
15 changes: 15 additions & 0 deletions src/audit-logs/data/ghec/organization.json
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,21 @@
"description": "Triggered when a team discussion post is edited.",
"docs_reference_links": "/communities/moderating-comments-and-conversations/managing-disruptive-comments#editing-a-comment"
},
{
"action": "enterprise_announcement.create",
"description": "A global announcement banner was created for the enterprise.",
"docs_reference_links": "/admin/managing-accounts-and-repositories/communicating-information-to-users-in-your-enterprise/customizing-user-messages-for-your-enterprise#creating-a-global-announcement-banner"
},
{
"action": "enterprise_announcement.destroy",
"description": "A global announcement banner was removed from the enterprise.",
"docs_reference_links": "/admin/managing-accounts-and-repositories/communicating-information-to-users-in-your-enterprise/customizing-user-messages-for-your-enterprise"
},
{
"action": "enterprise_announcement.update",
"description": "A global announcement banner was updated for the enterprise.",
"docs_reference_links": "/admin/managing-accounts-and-repositories/communicating-information-to-users-in-your-enterprise/customizing-user-messages-for-your-enterprise"
},
{
"action": "enterprise_installation.create",
"description": "The GitHub App associated with a GitHub Connect connection was created.",
Expand Down
3 changes: 2 additions & 1 deletion src/audit-logs/lib/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
"apiRequestEvent": "This event is only available via audit log streaming."
},
"sha": "d6aa2c08e5ced4ad92d2d6563fabaa683a9a7663"
}
}

18 changes: 8 additions & 10 deletions src/events/lib/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,6 @@ const aiSearchResult = {
required: [
'type',
'context',
'ai_search_result_query',
'ai_search_result_response',
'ai_search_result_links_json',
'ai_search_result_provided_answer',
'ai_search_result_response_status',
Expand All @@ -430,14 +428,6 @@ const aiSearchResult = {
type: 'string',
pattern: '^aiSearchResult$',
},
ai_search_result_query: {
type: 'string',
description: 'The query the user searched for.',
},
ai_search_result_response: {
type: 'string',
description: "The GPT's response to the query.",
},
ai_search_result_links_json: {
type: 'string',
description:
Expand All @@ -451,6 +441,10 @@ const aiSearchResult = {
type: 'number',
description: 'The status code of the GPT response.',
},
ai_search_result_connected_event_id: {
type: 'string',
description: 'The id of the corresponding CSE copilot conversation event.',
},
},
}

Expand Down Expand Up @@ -487,6 +481,10 @@ const survey = {
description:
'The guessed language of the survey comment. The guessed language is very inaccurate when the string contains fewer than 3 or 4 words.',
},
survey_connected_event_id: {
type: 'string',
description: 'The id of the corresponding CSE copilot conversation event.',
},
},
}

Expand Down
4 changes: 2 additions & 2 deletions src/events/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,12 @@ export type EventProps = {

export type EventPropsByType = {
[EventType.aiSearchResult]: {
ai_search_result_query: string
ai_search_result_response: string
// Dynamic JSON string of an array of "link" objects in the form:
// [{ "type": "reference" | "inline", "url": "https://..", "product": "issues" | "pages" | ... }, ...]
ai_search_result_links_json: string
ai_search_result_provided_answer: boolean
ai_search_result_response_status: number
ai_search_result_connected_event_id?: string
}
[EventType.clipboard]: {
clipboard_operation: string
Expand Down Expand Up @@ -119,5 +118,6 @@ export type EventPropsByType = {
survey_email?: string
survey_rating?: number
survey_comment_language?: string
survey_connected_event_id?: string
}
}
18 changes: 15 additions & 3 deletions src/search/components/input/AskAIResults.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ type AISearchResultEventParams = {
eventGroupId: string
couldNotAnswer?: boolean
status: number
connectedEventId?: string
}

export function AskAIResults({
Expand Down Expand Up @@ -67,11 +68,14 @@ export function AskAIResults({
message: string
sources: AIReference[]
aiCouldNotAnswer: boolean
connectedEventId?: string
}>('ai-query-cache', 1000, 7)

const [isCopied, setCopied] = useClipboard(message, { successDuration: 1400 })
const [feedbackSelected, setFeedbackSelected] = useState<null | 'up' | 'down'>(null)

const [conversationId, setConversationId] = useState<string>('')

const handleAICannotAnswer = () => {
setInitialLoading(false)
setResponseLoading(false)
Expand Down Expand Up @@ -129,6 +133,7 @@ export function AskAIResults({
eventGroupId: askAIEventGroupId.current,
couldNotAnswer: cachedData.aiCouldNotAnswer,
status: cachedData.aiCouldNotAnswer ? 400 : 200,
connectedEventId: cachedData.connectedEventId,
})

setTimeout(() => {
Expand All @@ -141,6 +146,7 @@ export function AskAIResults({
async function fetchData() {
let messageBuffer = ''
let sourcesBuffer: AIReference[] = []
let conversationIdBuffer = ''

try {
const response = await executeAISearch(router, version, query, debug)
Expand Down Expand Up @@ -212,6 +218,9 @@ export function AskAIResults({
messageBuffer += parsedLine.text
setMessage(messageBuffer)
}
} else if (parsedLine.chunkType === 'CONVERSATION_ID') {
conversationIdBuffer = parsedLine.conversation_id
setConversationId(parsedLine.conversation_id)
}
if (!isCancelled) {
setAnnouncement('Copilot Response Loading...')
Expand All @@ -233,6 +242,7 @@ export function AskAIResults({
message: messageBuffer,
sources: sourcesBuffer,
aiCouldNotAnswer: false,
connectedEventId: conversationIdBuffer,
},
version,
router.locale || 'en',
Expand All @@ -245,6 +255,7 @@ export function AskAIResults({
eventGroupId: askAIEventGroupId.current,
couldNotAnswer: false,
status: 200,
connectedEventId: conversationIdBuffer,
})
}
}
Expand Down Expand Up @@ -299,6 +310,7 @@ export function AskAIResults({
survey_vote: true,
eventGroupKey: ASK_AI_EVENT_GROUP,
eventGroupId: askAIEventGroupId.current,
survey_connected_event_id: conversationId,
})
}}
></IconButton>
Expand All @@ -320,6 +332,7 @@ export function AskAIResults({
survey_vote: false,
eventGroupKey: ASK_AI_EVENT_GROUP,
eventGroupId: askAIEventGroupId.current,
survey_connected_event_id: conversationId,
})
}}
></IconButton>
Expand Down Expand Up @@ -409,6 +422,7 @@ function sendAISearchResultEvent({
eventGroupId,
couldNotAnswer = false,
status,
connectedEventId,
}: AISearchResultEventParams) {
let searchResultLinksJson = '[]'
try {
Expand All @@ -418,12 +432,10 @@ function sendAISearchResultEvent({
}
sendEvent({
type: EventType.aiSearchResult,
// TODO: Remove PII so we can include the actual data
ai_search_result_query: 'REDACTED',
ai_search_result_response: 'REDACTED',
ai_search_result_links_json: searchResultLinksJson,
ai_search_result_provided_answer: couldNotAnswer ? false : true,
ai_search_result_response_status: status,
ai_search_result_connected_event_id: connectedEventId,
eventGroupKey: ASK_AI_EVENT_GROUP,
eventGroupId: eventGroupId,
})
Expand Down
3 changes: 1 addition & 2 deletions src/search/components/input/SearchOverlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ export function SearchOverlay({
sendEvent({
type: EventType.search,
// TODO: Remove PII so we can include the actual query
search_query: 'REDACTED',
search_query: urlSearchInputQuery,
search_context: GENERAL_SEARCH_CONTEXT,
eventGroupKey: SEARCH_OVERLAY_EVENT_GROUP,
eventGroupId: searchEventGroupId.current,
Expand Down Expand Up @@ -343,7 +343,6 @@ export function SearchOverlay({
// Fire event from onSelect instead of inside the API request function (executeAISearch), because the result could be cached and not trigger an event
sendEvent({
type: EventType.search,
// TODO: Remove PII so we can include the actual query
search_query: 'REDACTED',
search_context: AI_SEARCH_CONTEXT,
eventGroupKey: ASK_AI_EVENT_GROUP,
Expand Down