diff --git a/agent/recordings/enterpriseClient_3965582033/recording.har.yaml b/agent/recordings/enterpriseClient_3965582033/recording.har.yaml index 45175cc0a007..e29068373154 100644 --- a/agent/recordings/enterpriseClient_3965582033/recording.har.yaml +++ b/agent/recordings/enterpriseClient_3965582033/recording.har.yaml @@ -3469,6 +3469,114 @@ log: send: 0 ssl: -1 wait: 0 + - _id: c4c4ae6b9ce5d1c03e9505c20db6e1b3 + _order: 0 + cache: {} + request: + bodySize: 346 + cookies: [] + headers: + - _fromType: array + name: content-type + value: application/json; charset=utf-8 + - _fromType: array + name: user-agent + value: enterpriseClient / v1 + - _fromType: array + name: x-sourcegraph-actor-anonymous-uid + value: enterpriseClientabcde1234 + - _fromType: array + name: accept + value: "*/*" + - _fromType: array + name: content-length + value: "346" + - _fromType: array + name: accept-encoding + value: gzip,deflate + - _fromType: array + name: connection + value: close + - name: host + value: demo.sourcegraph.com + headersSize: 337 + httpVersion: HTTP/1.1 + method: POST + postData: + mimeType: application/json; charset=utf-8 + params: [] + textJSON: + query: | + + mutation RecordTelemetryEvents($events: [TelemetryEventInput!]!) { + telemetry { + recordEvents(events: $events) { + alwaysNil + } + } + } + variables: + events: + - action: hasFile + feature: cody.codyIgnore + parameters: + privateMetadata: {} + version: 0 + source: + client: VSCode.Cody + clientVersion: 1.8.0 + queryString: + - name: RecordTelemetryEvents + value: null + url: https://demo.sourcegraph.com/.api/graphql?RecordTelemetryEvents + response: + bodySize: 38 + content: + mimeType: text/plain; charset=utf-8 + size: 38 + text: | + Private mode requires authentication. + cookies: [] + headers: + - name: date + value: Thu, 07 Mar 2024 14:35:31 GMT + - name: content-type + value: text/plain; charset=utf-8 + - name: content-length + value: "38" + - name: connection + value: close + - name: access-control-allow-credentials + value: "true" + - name: access-control-allow-origin + value: "" + - name: cache-control + value: no-cache, max-age=0 + - name: vary + value: Accept-Encoding, Authorization, Cookie, Authorization, X-Requested-With + - name: x-content-type-options + value: nosniff + - name: x-frame-options + value: DENY + - name: x-xss-protection + value: 1; mode=block + - name: strict-transport-security + value: max-age=31536000; includeSubDomains; preload + headersSize: 1212 + httpVersion: HTTP/1.1 + redirectURL: "" + status: 401 + statusText: Unauthorized + startedDateTime: 2024-03-07T14:35:30.959Z + time: 0 + timings: + blocked: -1 + connect: -1 + dns: -1 + receive: 0 + send: 0 + ssl: -1 + wait: 0 - _id: b38540ce2256c839f6ea9b4ee26f34fd _order: 0 cache: {} @@ -4298,5 +4406,102 @@ log: send: 0 ssl: -1 wait: 0 + - _id: ad22e9eaa01bebade8a4333120346c0f + _order: 0 + cache: {} + request: + bodySize: 101 + cookies: [] + headers: + - _fromType: array + name: content-type + value: application/json; charset=utf-8 + - _fromType: array + name: user-agent + value: enterpriseClient / v1 + - _fromType: array + name: x-sourcegraph-actor-anonymous-uid + value: enterpriseClientabcde1234 + - _fromType: array + name: accept + value: "*/*" + - _fromType: array + name: content-length + value: "101" + - _fromType: array + name: accept-encoding + value: gzip,deflate + - _fromType: array + name: connection + value: close + - name: host + value: demo.sourcegraph.com + headersSize: 334 + httpVersion: HTTP/1.1 + method: POST + postData: + mimeType: application/json; charset=utf-8 + params: [] + textJSON: + query: |- + + query SiteProductVersion { + site { + productVersion + } + } + variables: {} + queryString: + - name: SiteProductVersion + value: null + url: https://demo.sourcegraph.com/.api/graphql?SiteProductVersion + response: + bodySize: 38 + content: + mimeType: text/plain; charset=utf-8 + size: 38 + text: | + Private mode requires authentication. + cookies: [] + headers: + - name: date + value: Thu, 07 Mar 2024 00:09:37 GMT + - name: content-type + value: text/plain; charset=utf-8 + - name: content-length + value: "38" + - name: connection + value: close + - name: access-control-allow-credentials + value: "true" + - name: access-control-allow-origin + value: "" + - name: cache-control + value: no-cache, max-age=0 + - name: vary + value: Accept-Encoding, Authorization, Cookie, Authorization, X-Requested-With + - name: x-content-type-options + value: nosniff + - name: x-frame-options + value: DENY + - name: x-xss-protection + value: 1; mode=block + - name: strict-transport-security + value: max-age=31536000; includeSubDomains; preload + headersSize: 1212 + httpVersion: HTTP/1.1 + redirectURL: "" + status: 401 + statusText: Unauthorized + startedDateTime: 2024-03-07T00:09:37.302Z + time: 0 + timings: + blocked: -1 + connect: -1 + dns: -1 + receive: 0 + send: 0 + ssl: -1 + wait: 0 pages: [] version: "1.2" diff --git a/agent/recordings/enterpriseMainBranchClient_759014996/recording.har.yaml b/agent/recordings/enterpriseMainBranchClient_759014996/recording.har.yaml index 67abde7d4c23..ecf0c6176ed3 100644 --- a/agent/recordings/enterpriseMainBranchClient_759014996/recording.har.yaml +++ b/agent/recordings/enterpriseMainBranchClient_759014996/recording.har.yaml @@ -439,109 +439,11 @@ log: send: 0 ssl: -1 wait: 0 - - _id: 4b999362bf48f8605ed17365df57ca60 - _order: 0 - cache: {} - request: - bodySize: 147 - cookies: [] - headers: - - _fromType: array - name: content-type - value: application/json; charset=utf-8 - - _fromType: array - name: user-agent - value: enterpriseMainBranchClient / v1 - - _fromType: array - name: x-sourcegraph-actor-anonymous-uid - value: enterpriseMainBranchClientabcde1234 - - _fromType: array - name: accept - value: "*/*" - - _fromType: array - name: content-length - value: "147" - - _fromType: array - name: accept-encoding - value: gzip,deflate - - _fromType: array - name: connection - value: close - - name: host - value: sourcegraph.sourcegraph.com - headersSize: 362 - httpVersion: HTTP/1.1 - method: POST - postData: - mimeType: application/json; charset=utf-8 - params: [] - textJSON: - query: |2 - - query FeatureFlags { - evaluatedFeatureFlags() { - name - value - } - } - variables: {} - queryString: - - name: FeatureFlags - value: null - url: https://sourcegraph.sourcegraph.com/.api/graphql?FeatureFlags - response: - bodySize: 38 - content: - mimeType: text/plain; charset=utf-8 - size: 38 - text: | - Private mode requires authentication. - cookies: [] - headers: - - name: date - value: Sat, 27 Jan 2024 14:34:09 GMT - - name: content-type - value: text/plain; charset=utf-8 - - name: content-length - value: "38" - - name: connection - value: close - - name: access-control-allow-credentials - value: "true" - - name: access-control-allow-origin - value: "" - - name: cache-control - value: no-cache, max-age=0 - - name: vary - value: Accept-Encoding, Authorization, Cookie, Authorization, X-Requested-With - - name: x-content-type-options - value: nosniff - - name: x-frame-options - value: DENY - - name: x-xss-protection - value: 1; mode=block - - name: strict-transport-security - value: max-age=31536000; includeSubDomains; preload - headersSize: 1209 - httpVersion: HTTP/1.1 - redirectURL: "" - status: 401 - statusText: Unauthorized - startedDateTime: 2024-03-06T07:55:58.253Z - time: 0 - timings: - blocked: -1 - connect: -1 - dns: -1 - receive: 0 - send: 0 - ssl: -1 - wait: 0 - - _id: 9382c2d6921a1358e3ea520bb6920b9e + - _id: 1067276db43cbdaea5b6b69eb2b11954 _order: 0 cache: {} request: - bodySize: 147 + bodySize: 699 cookies: [] headers: - _fromType: array @@ -559,7 +461,7 @@ log: value: "*/*" - _fromType: array name: content-length - value: "147" + value: "699" - _fromType: array name: accept-encoding value: gzip,deflate @@ -568,43 +470,54 @@ log: value: close - name: host value: sourcegraph.sourcegraph.com - headersSize: 374 + headersSize: 378 httpVersion: HTTP/1.1 method: POST postData: mimeType: application/json; charset=utf-8 params: [] textJSON: - query: |2 + query: >- - query FeatureFlags { - evaluatedFeatureFlags() { - name - value - } - } - variables: {} + mutation LogEventMutation($event: String!, $userCookieID: String!, $url: String!, $source: EventSource!, $argument: String, $publicArgument: String, $client: String, $connectedSiteID: String, $hashedLicenseKey: String) { + logEvent( + event: $event + userCookieID: $userCookieID + url: $url + source: $source + argument: $argument + publicArgument: $publicArgument + client: $client + connectedSiteID: $connectedSiteID + hashedLicenseKey: $hashedLicenseKey + ) { + alwaysNil + } + } + variables: + client: VSCODE_CODY_EXTENSION + event: CodyVSCodeExtension:Auth:connected + source: IDEEXTENSION + url: "" + userCookieID: ANONYMOUS_USER_COOKIE_ID queryString: - - name: FeatureFlags + - name: LogEventMutation value: null - url: https://sourcegraph.sourcegraph.com/.api/graphql?FeatureFlags + url: https://sourcegraph.sourcegraph.com/.api/graphql?LogEventMutation response: - bodySize: 199 + bodySize: 26 content: - encoding: base64 mimeType: application/json - size: 199 - text: "[\"H4sIAAAAAAAAA3TNwQ3CMAxG4V18rhfIAF0CcXDxT6hwmypxCijK7ggJIS69v0+vkYoLh\ - UbYxao4dIR4zRhNYqFwarTKAgrkMCzw/GI8t5SdBvoQUPBc0Ydf\",\"iFUmA5cd5rj\ - Pzp5iNBz2m0X+GlHlS1LcUnF+zBrxt7mKFfRz728AAAD//wMAPQjj07UAAAA=\"]" + size: 26 + text: "{\"data\":{\"logEvent\":null}}" cookies: [] headers: - name: date - value: Sat, 27 Jan 2024 14:34:10 GMT + value: Wed, 06 Mar 2024 08:53:30 GMT - name: content-type value: application/json - - name: transfer-encoding - value: chunked + - name: content-length + value: "26" - name: connection value: close - name: access-control-allow-credentials @@ -624,14 +537,12 @@ log: value: 1; mode=block - name: strict-transport-security value: max-age=31536000; includeSubDomains; preload - - name: content-encoding - value: gzip - headersSize: 1240 + headersSize: 1212 httpVersion: HTTP/1.1 redirectURL: "" status: 200 statusText: OK - startedDateTime: 2024-03-06T07:55:58.931Z + startedDateTime: 2024-03-06T08:53:29.989Z time: 0 timings: blocked: -1 @@ -641,11 +552,11 @@ log: send: 0 ssl: -1 wait: 0 - - _id: 1067276db43cbdaea5b6b69eb2b11954 + - _id: d79ae221eac441b2c43b972276ea858b _order: 0 cache: {} request: - bodySize: 699 + bodySize: 342 cookies: [] headers: - _fromType: array @@ -663,7 +574,7 @@ log: value: "*/*" - _fromType: array name: content-length - value: "699" + value: "342" - _fromType: array name: accept-encoding value: gzip,deflate @@ -672,54 +583,57 @@ log: value: close - name: host value: sourcegraph.sourcegraph.com - headersSize: 378 + headersSize: 383 httpVersion: HTTP/1.1 method: POST postData: mimeType: application/json; charset=utf-8 params: [] textJSON: - query: >- + query: | - mutation LogEventMutation($event: String!, $userCookieID: String!, $url: String!, $source: EventSource!, $argument: String, $publicArgument: String, $client: String, $connectedSiteID: String, $hashedLicenseKey: String) { - logEvent( - event: $event - userCookieID: $userCookieID - url: $url - source: $source - argument: $argument - publicArgument: $publicArgument - client: $client - connectedSiteID: $connectedSiteID - hashedLicenseKey: $hashedLicenseKey - ) { - alwaysNil + mutation RecordTelemetryEvents($events: [TelemetryEventInput!]!) { + telemetry { + recordEvents(events: $events) { + alwaysNil + } } } variables: - client: VSCODE_CODY_EXTENSION - event: CodyVSCodeExtension:Auth:connected - source: IDEEXTENSION - url: "" - userCookieID: ANONYMOUS_USER_COOKIE_ID + events: + - action: connected + feature: cody.auth + parameters: + privateMetadata: {} + version: 0 + source: + client: VSCode.Cody + clientVersion: 1.8.0 queryString: - - name: LogEventMutation + - name: RecordTelemetryEvents value: null - url: https://sourcegraph.sourcegraph.com/.api/graphql?LogEventMutation + url: https://sourcegraph.sourcegraph.com/.api/graphql?RecordTelemetryEvents response: - bodySize: 26 + bodySize: 112 content: + encoding: base64 mimeType: application/json - size: 26 - text: "{\"data\":{\"logEvent\":null}}" + size: 112 + text: "[\"H4sIAAAAAAAAA6pWSkksSVSyqlYqSc1JzU0tKaoEcYpSk/OLUlzLUvNKikH8xJzyxMpiv\ + 8wcJau80pyc2traWgAAAAD//wMAhHZ9ajoAAAA=\"]" + textDecoded: + data: + telemetry: + recordEvents: + alwaysNil: null cookies: [] headers: - name: date - value: Wed, 06 Mar 2024 08:53:30 GMT + value: Wed, 06 Mar 2024 23:46:54 GMT - name: content-type value: application/json - - name: content-length - value: "26" + - name: transfer-encoding + value: chunked - name: connection value: close - name: access-control-allow-credentials @@ -739,12 +653,14 @@ log: value: 1; mode=block - name: strict-transport-security value: max-age=31536000; includeSubDomains; preload - headersSize: 1212 + - name: content-encoding + value: gzip + headersSize: 1244 httpVersion: HTTP/1.1 redirectURL: "" status: 200 statusText: OK - startedDateTime: 2024-03-06T08:53:29.989Z + startedDateTime: 2024-03-06T23:46:54.359Z time: 0 timings: blocked: -1 @@ -754,29 +670,28 @@ log: send: 0 ssl: -1 wait: 0 - - _id: d79ae221eac441b2c43b972276ea858b + - _id: 51e5286fc97bfeb8ca560a2ac7440017 _order: 0 cache: {} request: - bodySize: 342 + bodySize: 346 cookies: [] headers: - - _fromType: array - name: authorization - value: token - REDACTED_ad28238383af71357085701263df7766e6f7f8ad1afc344d71aaf69a07143677 - _fromType: array name: content-type value: application/json; charset=utf-8 - _fromType: array name: user-agent value: enterpriseMainBranchClient / v1 + - _fromType: array + name: x-sourcegraph-actor-anonymous-uid + value: enterpriseMainBranchClientabcde1234 - _fromType: array name: accept value: "*/*" - _fromType: array name: content-length - value: "342" + value: "346" - _fromType: array name: accept-encoding value: gzip,deflate @@ -785,7 +700,7 @@ log: value: close - name: host value: sourcegraph.sourcegraph.com - headersSize: 383 + headersSize: 371 httpVersion: HTTP/1.1 method: POST postData: @@ -803,8 +718,8 @@ log: } variables: events: - - action: connected - feature: cody.auth + - action: hasFile + feature: cody.codyIgnore parameters: privateMetadata: {} version: 0 @@ -816,26 +731,20 @@ log: value: null url: https://sourcegraph.sourcegraph.com/.api/graphql?RecordTelemetryEvents response: - bodySize: 112 + bodySize: 38 content: - encoding: base64 - mimeType: application/json - size: 112 - text: "[\"H4sIAAAAAAAAA6pWSkksSVSyqlYqSc1JzU0tKaoEcYpSk/OLUlzLUvNKikH8xJzyxMpiv\ - 8wcJau80pyc2traWgAAAAD//wMAhHZ9ajoAAAA=\"]" - textDecoded: - data: - telemetry: - recordEvents: - alwaysNil: null + mimeType: text/plain; charset=utf-8 + size: 38 + text: | + Private mode requires authentication. cookies: [] headers: - name: date - value: Wed, 06 Mar 2024 23:46:54 GMT + value: Thu, 07 Mar 2024 14:47:31 GMT - name: content-type - value: application/json - - name: transfer-encoding - value: chunked + value: text/plain; charset=utf-8 + - name: content-length + value: "38" - name: connection value: close - name: access-control-allow-credentials @@ -845,8 +754,7 @@ log: - name: cache-control value: no-cache, max-age=0 - name: vary - value: Accept-Encoding, Authorization, Cookie, Authorization, X-Requested-With, - Cookie + value: Accept-Encoding, Authorization, Cookie, Authorization, X-Requested-With - name: x-content-type-options value: nosniff - name: x-frame-options @@ -855,14 +763,12 @@ log: value: 1; mode=block - name: strict-transport-security value: max-age=31536000; includeSubDomains; preload - - name: content-encoding - value: gzip - headersSize: 1244 + headersSize: 1213 httpVersion: HTTP/1.1 redirectURL: "" - status: 200 - statusText: OK - startedDateTime: 2024-03-06T23:46:54.359Z + status: 401 + statusText: Unauthorized + startedDateTime: 2024-03-07T14:47:31.265Z time: 0 timings: blocked: -1 @@ -1388,6 +1294,103 @@ log: send: 0 ssl: -1 wait: 0 + - _id: 418afe625570889cafad386e94df6d32 + _order: 0 + cache: {} + request: + bodySize: 101 + cookies: [] + headers: + - _fromType: array + name: content-type + value: application/json; charset=utf-8 + - _fromType: array + name: user-agent + value: enterpriseMainBranchClient / v1 + - _fromType: array + name: x-sourcegraph-actor-anonymous-uid + value: enterpriseMainBranchClientabcde1234 + - _fromType: array + name: accept + value: "*/*" + - _fromType: array + name: content-length + value: "101" + - _fromType: array + name: accept-encoding + value: gzip,deflate + - _fromType: array + name: connection + value: close + - name: host + value: sourcegraph.sourcegraph.com + headersSize: 368 + httpVersion: HTTP/1.1 + method: POST + postData: + mimeType: application/json; charset=utf-8 + params: [] + textJSON: + query: |- + + query SiteProductVersion { + site { + productVersion + } + } + variables: {} + queryString: + - name: SiteProductVersion + value: null + url: https://sourcegraph.sourcegraph.com/.api/graphql?SiteProductVersion + response: + bodySize: 38 + content: + mimeType: text/plain; charset=utf-8 + size: 38 + text: | + Private mode requires authentication. + cookies: [] + headers: + - name: date + value: Thu, 07 Mar 2024 14:35:32 GMT + - name: content-type + value: text/plain; charset=utf-8 + - name: content-length + value: "38" + - name: connection + value: close + - name: access-control-allow-credentials + value: "true" + - name: access-control-allow-origin + value: "" + - name: cache-control + value: no-cache, max-age=0 + - name: vary + value: Accept-Encoding, Authorization, Cookie, Authorization, X-Requested-With + - name: x-content-type-options + value: nosniff + - name: x-frame-options + value: DENY + - name: x-xss-protection + value: 1; mode=block + - name: strict-transport-security + value: max-age=31536000; includeSubDomains; preload + headersSize: 1213 + httpVersion: HTTP/1.1 + redirectURL: "" + status: 401 + statusText: Unauthorized + startedDateTime: 2024-03-07T14:35:31.908Z + time: 0 + timings: + blocked: -1 + connect: -1 + dns: -1 + receive: 0 + send: 0 + ssl: -1 + wait: 0 - _id: b635aa83c2f05439f124938c5856379f _order: 0 cache: {} diff --git a/vscode/src/services/cody-ignore.ts b/vscode/src/services/cody-ignore.ts index d6805e2d1962..13372c6512be 100644 --- a/vscode/src/services/cody-ignore.ts +++ b/vscode/src/services/cody-ignore.ts @@ -8,6 +8,8 @@ import { } from '@sourcegraph/cody-shared' import { logDebug } from '../log' +import { telemetryService } from './telemetry' +import { telemetryRecorder } from './telemetry-v2' const utf8 = new TextDecoder('utf-8') @@ -124,7 +126,7 @@ async function refresh(uri: vscode.Uri): Promise { const ignoreFileAtRoot = vscode.Uri.joinPath(wf.uri, '.cody', 'ignore') tryReadFile(ignoreFileAtRoot).then(content => { if (content.length) { - ignores.setIgnoreFiles(wf.uri, [{ uri: ignoreFileAtRoot, content }]) + setCodyIgnoreFiles(wf.uri, [{ uri: ignoreFileAtRoot, content }]) logDebug('CodyIgnore:refresh', 'found ignore file at root', { verbose: wf.uri.path, }) @@ -157,7 +159,8 @@ async function refresh(uri: vscode.Uri): Promise { content: await tryReadFile(fileUri), })) ) - ignores.setIgnoreFiles(wf.uri, filesWithContent) + + setCodyIgnoreFiles(wf.uri, filesWithContent) // If we can locate the token, that means the job was completed before it times out. if (findInProgressTokens.get(uri.path)) { @@ -167,6 +170,14 @@ async function refresh(uri: vscode.Uri): Promise { } } +function setCodyIgnoreFiles(ws: vscode.Uri, files: IgnoreFileContent[]): void { + ignores.setIgnoreFiles(ws, files) + if (files.length) { + telemetryService.log('CodyVSCodeExtension:codyIgnore:hasFile') + telemetryRecorder.recordEvent('cody.codyIgnore', 'hasFile') + } +} + /** * Removes ignore rules for the provided WorkspaceFolder. */