From 68ae87be98fcd84348dab0fdb8385ddf64ad04e0 Mon Sep 17 00:00:00 2001 From: Ryan Ghadimi <114221941+GhadimiR@users.noreply.github.com> Date: Wed, 2 Apr 2025 13:33:35 +0100 Subject: [PATCH 1/3] Specify GITHUB_TOKEN enterprise behaviour for new Orgs/Enterprises (#55110) Co-authored-by: Sophie <29382425+sophietheking@users.noreply.github.com> --- ...orcing-policies-for-github-actions-in-your-enterprise.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/content/admin/enforcing-policies/enforcing-policies-for-your-enterprise/enforcing-policies-for-github-actions-in-your-enterprise.md b/content/admin/enforcing-policies/enforcing-policies-for-your-enterprise/enforcing-policies-for-github-actions-in-your-enterprise.md index 16212430266f..2d3fe58ca26e 100644 --- a/content/admin/enforcing-policies/enforcing-policies-for-your-enterprise/enforcing-policies-for-github-actions-in-your-enterprise.md +++ b/content/admin/enforcing-policies/enforcing-policies-for-your-enterprise/enforcing-policies-for-github-actions-in-your-enterprise.md @@ -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. From 632815eaba33afda93b94ace170a2002b8b55ff4 Mon Sep 17 00:00:00 2001 From: docs-bot <77750099+docs-bot@users.noreply.github.com> Date: Wed, 2 Apr 2025 07:21:04 -0700 Subject: [PATCH 2/3] Update audit log event data (#55097) Co-authored-by: Sunbrye Ly <56200261+sunbrye@users.noreply.github.com> --- src/audit-logs/data/fpt/organization.json | 15 +++++++++++++++ src/audit-logs/data/ghec/organization.json | 15 +++++++++++++++ src/audit-logs/lib/config.json | 3 ++- 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/src/audit-logs/data/fpt/organization.json b/src/audit-logs/data/fpt/organization.json index 15aec76df57f..2dee7b9c700d 100644 --- a/src/audit-logs/data/fpt/organization.json +++ b/src/audit-logs/data/fpt/organization.json @@ -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.", diff --git a/src/audit-logs/data/ghec/organization.json b/src/audit-logs/data/ghec/organization.json index 15aec76df57f..2dee7b9c700d 100644 --- a/src/audit-logs/data/ghec/organization.json +++ b/src/audit-logs/data/ghec/organization.json @@ -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.", diff --git a/src/audit-logs/lib/config.json b/src/audit-logs/lib/config.json index a38c0fab4b76..4686e3525b1a 100644 --- a/src/audit-logs/lib/config.json +++ b/src/audit-logs/lib/config.json @@ -4,4 +4,5 @@ "apiRequestEvent": "This event is only available via audit log streaming." }, "sha": "d6aa2c08e5ced4ad92d2d6563fabaa683a9a7663" -} \ No newline at end of file +} + From 905d868502bccf294a457c3674cf7a161e8f463e Mon Sep 17 00:00:00 2001 From: Ashish Keshan Date: Wed, 2 Apr 2025 23:46:44 +0900 Subject: [PATCH 3/3] [AI Search] Support `conversation_id` in `AISearchResultEvent` and `SurveyEvent` (#55102) --- src/events/lib/schema.ts | 18 ++++++++---------- src/events/types.ts | 4 ++-- src/search/components/input/AskAIResults.tsx | 18 +++++++++++++++--- src/search/components/input/SearchOverlay.tsx | 3 +-- 4 files changed, 26 insertions(+), 17 deletions(-) diff --git a/src/events/lib/schema.ts b/src/events/lib/schema.ts index 831c5c8ea10d..55ad26277ce2 100644 --- a/src/events/lib/schema.ts +++ b/src/events/lib/schema.ts @@ -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', @@ -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: @@ -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.', + }, }, } @@ -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.', + }, }, } diff --git a/src/events/types.ts b/src/events/types.ts index 562cfc7298d6..8ceb69b8cfab 100644 --- a/src/events/types.ts +++ b/src/events/types.ts @@ -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 @@ -119,5 +118,6 @@ export type EventPropsByType = { survey_email?: string survey_rating?: number survey_comment_language?: string + survey_connected_event_id?: string } } diff --git a/src/search/components/input/AskAIResults.tsx b/src/search/components/input/AskAIResults.tsx index 5da276da5c9f..43b52df3cb90 100644 --- a/src/search/components/input/AskAIResults.tsx +++ b/src/search/components/input/AskAIResults.tsx @@ -38,6 +38,7 @@ type AISearchResultEventParams = { eventGroupId: string couldNotAnswer?: boolean status: number + connectedEventId?: string } export function AskAIResults({ @@ -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) + const [conversationId, setConversationId] = useState('') + const handleAICannotAnswer = () => { setInitialLoading(false) setResponseLoading(false) @@ -129,6 +133,7 @@ export function AskAIResults({ eventGroupId: askAIEventGroupId.current, couldNotAnswer: cachedData.aiCouldNotAnswer, status: cachedData.aiCouldNotAnswer ? 400 : 200, + connectedEventId: cachedData.connectedEventId, }) setTimeout(() => { @@ -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) @@ -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...') @@ -233,6 +242,7 @@ export function AskAIResults({ message: messageBuffer, sources: sourcesBuffer, aiCouldNotAnswer: false, + connectedEventId: conversationIdBuffer, }, version, router.locale || 'en', @@ -245,6 +255,7 @@ export function AskAIResults({ eventGroupId: askAIEventGroupId.current, couldNotAnswer: false, status: 200, + connectedEventId: conversationIdBuffer, }) } } @@ -299,6 +310,7 @@ export function AskAIResults({ survey_vote: true, eventGroupKey: ASK_AI_EVENT_GROUP, eventGroupId: askAIEventGroupId.current, + survey_connected_event_id: conversationId, }) }} > @@ -320,6 +332,7 @@ export function AskAIResults({ survey_vote: false, eventGroupKey: ASK_AI_EVENT_GROUP, eventGroupId: askAIEventGroupId.current, + survey_connected_event_id: conversationId, }) }} > @@ -409,6 +422,7 @@ function sendAISearchResultEvent({ eventGroupId, couldNotAnswer = false, status, + connectedEventId, }: AISearchResultEventParams) { let searchResultLinksJson = '[]' try { @@ -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, }) diff --git a/src/search/components/input/SearchOverlay.tsx b/src/search/components/input/SearchOverlay.tsx index 44713753091f..c9f316a8decd 100644 --- a/src/search/components/input/SearchOverlay.tsx +++ b/src/search/components/input/SearchOverlay.tsx @@ -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, @@ -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,