Skip to content

Commit 50e65c8

Browse files
Add artifacts for v6.7.0
1 parent ff21f87 commit 50e65c8

43 files changed

Lines changed: 775 additions & 411 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

TAG

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v6.6.2517
1+
v6.7.0

gql/codeintel.policies.graphql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ extend type Query {
3939
If set to true, then only configuration policies with embeddings enabled are returned.
4040
If set to false, then configuration policies with embeddings enabled are filtered out.
4141
"""
42-
forEmbeddings: Boolean
42+
forEmbeddings: Boolean @deprecated(reason: "Embeddings are not used.")
4343

4444
"""
4545
If set to true, then only protected configuration policies are returned.
@@ -120,7 +120,7 @@ extend type Mutation {
120120
"""
121121
embeddingsEnabled, if not provided, currently defaults to false.
122122
"""
123-
embeddingsEnabled: Boolean
123+
embeddingsEnabled: Boolean @deprecated(reason: "Embeddings are not used.")
124124
): CodeIntelligenceConfigurationPolicy!
125125

126126
"""
@@ -150,7 +150,7 @@ extend type Mutation {
150150
"""
151151
embeddingsEnabled, if not provided, currently defaults to false.
152152
"""
153-
embeddingsEnabled: Boolean
153+
embeddingsEnabled: Boolean @deprecated(reason: "Embeddings are not used.")
154154
): EmptyResponse
155155

156156
"""
@@ -347,7 +347,7 @@ type CodeIntelligenceConfigurationPolicy implements Node {
347347
"""
348348
Whether or not this configuration policy affects embeddings.
349349
"""
350-
embeddingsEnabled: Boolean!
350+
embeddingsEnabled: Boolean! @deprecated(reason: "Embeddings are not used.")
351351
}
352352

353353
"""

gql/embeddings.graphql

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ extend type Query {
3131
Filter by the state of the job.
3232
"""
3333
state: String
34-
): RepoEmbeddingJobsConnection!
34+
): RepoEmbeddingJobsConnection! @deprecated(reason: "Embeddings are not used")
3535
}
3636

3737
extend type Mutation {
@@ -40,10 +40,11 @@ extend type Mutation {
4040
If force is set to true, then the repo will be re-embedded even if there's already an up-to-date embeddings index.
4141
"""
4242
scheduleRepositoriesForEmbedding(repoNames: [String!]!, force: Boolean): EmptyResponse!
43+
@deprecated(reason: "Embeddings are not used")
4344
"""
4445
Experimental: Cancels the embedding job with the given ID. The job must exist and be in either 'processing' or 'queued' state.
4546
"""
46-
cancelRepoEmbeddingJob(job: ID!): EmptyResponse!
47+
cancelRepoEmbeddingJob(job: ID!): EmptyResponse! @deprecated(reason: "Embeddings are not used")
4748
}
4849

4950
"""

gql/schema.graphql

Lines changed: 31 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,7 @@ type Mutation {
102102
Only the user and site admins may perform this mutation.
103103
"""
104104
updateUser(user: ID!, username: String, displayName: String, avatarURL: String): User!
105-
"""
106-
Updates the user's Self-serve Cody plan to Free or Pro.
107105

108-
Only the user may perform this mutation.
109-
"""
110-
changeCodyPlan(user: ID!, pro: Boolean!): User!
111106
"""
112107
Creates an organization. The caller is added as a member of the newly created organization.
113108
@@ -1117,7 +1112,7 @@ enum EventBillingID {
11171112
"""
11181113
A billable Cody embedding/code graph creation or search event.
11191114
"""
1120-
CodyEmbedding
1115+
CodyEmbedding @deprecated(reason: "Embeddings are not used")
11211116
}
11221117

11231118
"""
@@ -1550,11 +1545,11 @@ type Query {
15501545
"""
15511546
Include repositories that have embeddings.
15521547
"""
1553-
embedded: Boolean = true
1548+
embedded: Boolean = true @deprecated(reason: "Embeddings are not used")
15541549
"""
15551550
Include repositories that don't have embeddings.
15561551
"""
1557-
notEmbedded: Boolean = true
1552+
notEmbedded: Boolean = true @deprecated(reason: "Embeddings are not used")
15581553
"""
15591554
Include only repositories that have encountered errors when cloning or fetching
15601555
"""
@@ -3786,7 +3781,7 @@ type Repository implements Node & GenericSearchResultInterface {
37863781
"""
37873782
Returns true if embeddings for the repo are generated.
37883783
"""
3789-
embeddingExists: Boolean!
3784+
embeddingExists: Boolean! @deprecated(reason: "Embeddings are not used")
37903785

37913786
"""
37923787
Returns true if command executed on the repo are recorded.
@@ -6384,57 +6379,6 @@ type NewUsersConnection implements Connection {
63846379
pageInfo: ConnectionPageInfo!
63856380
}
63866381

6387-
"""
6388-
A status for cody subscription.
6389-
"""
6390-
enum CodySubscriptionStatus {
6391-
ACTIVE
6392-
PAST_DUE
6393-
UNPAID
6394-
CANCELED
6395-
TRIALING
6396-
OTHER
6397-
}
6398-
6399-
"""
6400-
A plan for cody subscription.
6401-
"""
6402-
enum CodySubscriptionPlan {
6403-
FREE
6404-
PRO
6405-
}
6406-
6407-
"""
6408-
A subscription for cody.
6409-
"""
6410-
type CodySubscription {
6411-
"""
6412-
The status for cody subscription.
6413-
"""
6414-
status: CodySubscriptionStatus!
6415-
"""
6416-
The plan for cody subscription.
6417-
"""
6418-
plan: CodySubscriptionPlan!
6419-
"""
6420-
Whether pro rate limits are applied for the user.
6421-
"""
6422-
applyProRateLimits: Boolean!
6423-
"""
6424-
The current billing period start time.
6425-
"""
6426-
currentPeriodStartAt: DateTime!
6427-
"""
6428-
The current billing period end time. This may be in the past if the
6429-
subscription is in a canceled state.
6430-
"""
6431-
currentPeriodEndAt: DateTime!
6432-
"""
6433-
Whether the subscription will be canceled at the end of the current billing period. (Or automatically renew, if true.)
6434-
"""
6435-
cancelAtPeriodEnd: Boolean!
6436-
}
6437-
64386382
"""
64396383
A user.
64406384
"""
@@ -6657,31 +6601,7 @@ type User implements Node & SettingsSubject & Namespace {
66576601
Null, if not overwritten.
66586602
"""
66596603
codeCompletionsQuotaOverride: Int
6660-
"""
6661-
The Cody subscription details for the user.
6662-
"""
6663-
codySubscription: CodySubscription
6664-
"""
6665-
DEPRECATED
6666-
Whether the user has enrolled for Cody Pro.
6667-
"""
6668-
codyProEnabled: Boolean!
6669-
"""
6670-
The count of Cody chats in the current billing period.
6671-
"""
6672-
codyCurrentPeriodChatUsage: Int!
6673-
"""
6674-
The count of Cody code completions in the current billing period.
6675-
"""
6676-
codyCurrentPeriodCodeUsage: Int!
6677-
"""
6678-
The limit of Cody chats for the current billing period.
6679-
"""
6680-
codyCurrentPeriodChatLimit: Int!
6681-
"""
6682-
The limit of Cody code completions for the current billing period.
6683-
"""
6684-
codyCurrentPeriodCodeLimit: Int!
6604+
66856605
"""
66866606
Evaluates a feature flag for the user. Returns null if the feature flag does not exist.
66876607
"""
@@ -6884,11 +6804,6 @@ type ExternalAccount implements Node {
68846804
Whether the requesting user can remove the link to the external account.
68856805
"""
68866806
viewerCanRemove: Boolean!
6887-
"""
6888-
TEMPORARY: to debug #inc-284-plg-users-paying-for-and-being-billed-for-pro-without-being-upgrade.
6889-
Cody Subscription associated with the external account.
6890-
"""
6891-
codySubscription: CodySubscription
68926807
}
68936808

68946809
"""
@@ -7460,6 +7375,10 @@ type Site implements SettingsSubject {
74607375
Returns users whose events count within a given range.
74617376
"""
74627377
eventsCount: SiteUsersNumberRangeInput
7378+
"""
7379+
Returns users who have any of the specified roles.
7380+
"""
7381+
roles: [String!]
74637382
): SiteUsers!
74647383

74657384
"""
@@ -7487,11 +7406,6 @@ type Site implements SettingsSubject {
74877406
"""
74887407
perUserCodeCompletionsQuota: Int
74897408

7490-
"""
7491-
Whether users are required to have a verified email in order to access Cody.
7492-
"""
7493-
requiresVerifiedEmailForCody: Boolean!
7494-
74957409
"""
74967410
Whether Cody is enabled for this site.
74977411
"""
@@ -8476,6 +8390,27 @@ type SiteUser {
84768390
Whether this account is a service account.
84778391
"""
84788392
serviceAccount: Boolean!
8393+
"""
8394+
The list of all roles assigned to this user.
8395+
"""
8396+
roles(
8397+
"""
8398+
The limit argument for forward pagination.
8399+
"""
8400+
first: Int
8401+
"""
8402+
The limit argument for backward pagination.
8403+
"""
8404+
last: Int
8405+
"""
8406+
The cursor argument for forward pagination.
8407+
"""
8408+
after: String
8409+
"""
8410+
The cursor argument for backward pagination.
8411+
"""
8412+
before: String
8413+
): RoleConnection!
84798414
}
84808415

84818416
"""
@@ -8892,7 +8827,7 @@ type RepositoryStats {
88928827
"""
88938828
The number of repositories that have embeddings
88948829
"""
8895-
embedded: Int!
8830+
embedded: Int! @deprecated(reason: "Embeddings are not used")
88968831
}
88978832

88988833
"""
@@ -10431,11 +10366,6 @@ enum PermissionNamespace {
1043110366
"""
1043210367
CODY
1043310368

10434-
"""
10435-
❗ Product subscriptions are only available in Sourcegraph.com
10436-
"""
10437-
PRODUCT_SUBSCRIPTIONS
10438-
1043910369
"""
1044010370
Permissions related to workspace repo administration.
1044110371
"""
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
DROP TABLE IF EXISTS deepsearch_questions CASCADE;
2+
3+
DROP FUNCTION IF EXISTS update_deepsearch_questions_updated_at();
4+
5+
DROP TRIGGER IF EXISTS update_deepsearch_questions_updated_at ON deepsearch_questions;
6+
7+
DROP FUNCTION IF EXISTS update_deepsearch_conversation_updated_at_on_question_change();
8+
9+
DROP TRIGGER IF EXISTS update_conversation_on_question_change ON deepsearch_questions;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
name: deepsearch_questions
2+
parents: [1751706889]
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
CREATE TABLE IF NOT EXISTS deepsearch_questions(
2+
id serial PRIMARY KEY,
3+
conversation_id integer NOT NULL REFERENCES deepsearch_conversations(id) ON DELETE CASCADE,
4+
created_at timestamp with time zone DEFAULT now(),
5+
updated_at timestamp with time zone DEFAULT now(),
6+
data jsonb NOT NULL,
7+
tenant_id integer NOT NULL DEFAULT current_setting('app.current_tenant')::integer
8+
);
9+
10+
ALTER TABLE deepsearch_questions ENABLE ROW LEVEL SECURITY;
11+
12+
DROP POLICY IF EXISTS tenant_isolation_policy ON deepsearch_questions;
13+
14+
CREATE POLICY tenant_isolation_policy ON deepsearch_questions AS PERMISSIVE
15+
FOR ALL TO PUBLIC
16+
USING ((tenant_id = (
17+
SELECT
18+
(current_setting('app.current_tenant'::text))::integer AS current_tenant)));
19+
20+
CREATE OR REPLACE FUNCTION update_deepsearch_questions_updated_at()
21+
RETURNS TRIGGER
22+
AS $$
23+
BEGIN
24+
NEW.updated_at = now();
25+
RETURN NEW;
26+
END;
27+
$$
28+
LANGUAGE plpgsql;
29+
30+
CREATE OR REPLACE TRIGGER update_deepsearch_questions_updated_at
31+
BEFORE UPDATE ON deepsearch_questions
32+
FOR EACH ROW
33+
EXECUTE FUNCTION update_deepsearch_questions_updated_at();
34+
35+
-- Create index for conversation_id lookups
36+
CREATE INDEX IF NOT EXISTS deepsearch_questions_conversation_id_idx ON deepsearch_questions (conversation_id);
37+
38+
-- Function to update parent conversation updated_at when questions change
39+
CREATE OR REPLACE FUNCTION update_deepsearch_conversation_updated_at_on_question_change()
40+
RETURNS TRIGGER
41+
AS $$
42+
BEGIN
43+
UPDATE deepsearch_conversations
44+
SET updated_at = now()
45+
WHERE id = COALESCE(NEW.conversation_id, OLD.conversation_id);
46+
RETURN COALESCE(NEW, OLD);
47+
END;
48+
$$
49+
LANGUAGE plpgsql;
50+
51+
-- Trigger to update conversation updated_at when questions are inserted or updated
52+
CREATE OR REPLACE TRIGGER update_conversation_on_question_change
53+
AFTER INSERT OR UPDATE ON deepsearch_questions
54+
FOR EACH ROW
55+
EXECUTE FUNCTION update_deepsearch_conversation_updated_at_on_question_change();
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
-- Reverse migration: remove question data from deepsearch_questions table
2+
-- This removes the migrated data that was created during the up migration
3+
-- The original data in deepsearch_conversations.data->'ui_data'->'questions' remains intact
4+
5+
DELETE FROM deepsearch_questions
6+
WHERE conversation_id IN (
7+
SELECT id FROM deepsearch_conversations
8+
WHERE data->'ui_data'->'questions' IS NOT NULL
9+
AND jsonb_typeof(data->'ui_data'->'questions') = 'array'
10+
AND jsonb_array_length(data->'ui_data'->'questions') > 0
11+
);
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
name: migrate_deepsearch_conversations_to_questions
2+
parents: [1751704581, 1751705000, 1752104642]
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
-- Migrate existing deepsearch_conversations data to deepsearch_questions
2+
-- Each conversation's ui_data contains a Conversation object with questions array
3+
-- We extract each question and create a separate row in deepsearch_questions
4+
INSERT INTO deepsearch_questions(conversation_id, created_at, updated_at, data, tenant_id)
5+
SELECT
6+
dc.id AS conversation_id,
7+
dc.created_at,
8+
dc.updated_at,
9+
question_data.value #- '{id}' AS data,
10+
dc.tenant_id
11+
FROM
12+
deepsearch_conversations dc
13+
CROSS JOIN LATERAL (
14+
SELECT
15+
jsonb_array_elements(dc.data -> 'ui_data' -> 'questions') AS value
16+
WHERE
17+
jsonb_typeof(dc.data -> 'ui_data' -> 'questions') = 'array') question_data
18+
WHERE
19+
dc.data -> 'ui_data' -> 'questions' IS NOT NULL
20+
AND jsonb_typeof(dc.data -> 'ui_data' -> 'questions') = 'array'
21+
AND jsonb_array_length(dc.data -> 'ui_data' -> 'questions') > 0;

0 commit comments

Comments
 (0)