Skip to content

Commit 7b5a834

Browse files
Add artifacts for v6.9.0
1 parent b2f8710 commit 7b5a834

11 files changed

Lines changed: 96 additions & 90 deletions

File tree

TAG

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

gql/batches.graphql

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2286,6 +2286,10 @@ extend type Query {
22862286
Specify the order in which batch changes are returned.
22872287
"""
22882288
sortOrder: BatchChangesSortOrder = NEWEST_FIRST
2289+
"""
2290+
Only return batch changes created by users with these IDs.
2291+
"""
2292+
users: [ID!]
22892293
): BatchChangeConnection!
22902294
"""
22912295
Looks up a batch change by namespace and name.
@@ -3801,6 +3805,10 @@ extend type Org {
38013805
Specify the order in which batch changes are returned.
38023806
"""
38033807
sortOrder: BatchChangesSortOrder = NEWEST_FIRST
3808+
"""
3809+
Only return batch changes created by users with these IDs.
3810+
"""
3811+
users: [ID!]
38043812
): BatchChangeConnection!
38053813
}
38063814

@@ -3837,6 +3845,10 @@ extend type User {
38373845
Specify the order in which batch changes are returned.
38383846
"""
38393847
sortOrder: BatchChangesSortOrder = NEWEST_FIRST
3848+
"""
3849+
Only return batch changes created by users with these IDs.
3850+
"""
3851+
users: [ID!]
38403852
): BatchChangeConnection!
38413853

38423854
"""

gql/schema.graphql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10379,6 +10379,11 @@ enum PermissionNamespace {
1037910379
Permissions related to SCIP index management.
1038010380
"""
1038110381
SCIP
10382+
10383+
"""
10384+
Permissions related to deep search functionality.
10385+
"""
10386+
DEEP_SEARCH
1038210387
}
1038310388

1038410389
"""
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
CREATE TABLE IF NOT EXISTS zoekt_index_jobs (
2+
id BIGSERIAL PRIMARY KEY,
3+
4+
-- Worker fields:
5+
state text not null DEFAULT 'queued',
6+
failure_message text,
7+
queued_at timestamp with time zone not null DEFAULT NOW(),
8+
started_at timestamp with time zone,
9+
finished_at timestamp with time zone,
10+
process_after timestamp with time zone,
11+
num_resets integer not null default 0,
12+
num_failures integer not null default 0,
13+
last_heartbeat_at timestamp with time zone,
14+
execution_logs json[],
15+
worker_hostname text not null default '',
16+
cancel boolean not null default false,
17+
18+
-- Zoekt index job fields:
19+
repository_id integer not null REFERENCES repo(id) ON DELETE CASCADE,
20+
priority integer not null DEFAULT 1,
21+
tenant_id integer not null DEFAULT (current_setting('app.current_tenant'::text))::integer
22+
);
23+
24+
ALTER TABLE zoekt_index_jobs ENABLE ROW LEVEL SECURITY;
25+
DROP POLICY IF EXISTS tenant_isolation_policy ON zoekt_index_jobs;
26+
CREATE POLICY tenant_isolation_policy ON zoekt_index_jobs AS PERMISSIVE FOR ALL TO PUBLIC USING (( SELECT (current_setting('app.current_tenant'::text) = 'workertenant'::text)) OR (tenant_id = ( SELECT (NULLIF(current_setting('app.current_tenant'::text), 'workertenant'::text))::integer AS current_tenant)));
27+
28+
-- Ensure only one pending/running zoekt index job per repo at a time.
29+
CREATE UNIQUE INDEX IF NOT EXISTS zoekt_index_jobs_one_concurrent_per_repo ON zoekt_index_jobs (repository_id, tenant_id) WHERE (state IN('queued', 'processing', 'errored'));
30+
31+
-- Ensure dequeues are fast.
32+
CREATE INDEX IF NOT EXISTS zoekt_index_jobs_dequeue_idx ON zoekt_index_jobs (state, process_after);
33+
CREATE INDEX IF NOT EXISTS zoekt_index_jobs_dequeue_order_idx ON zoekt_index_jobs (priority DESC, coalesce(process_after, queued_at) ASC, id ASC, tenant_id);
34+
35+
-- Speed up lookups by repo ID and foreign key cascades on repository_id.
36+
CREATE INDEX IF NOT EXISTS
37+
idx_zoekt_index_jobs_repository_id
38+
ON zoekt_index_jobs (tenant_id, repository_id);
39+
40+
-- Index added by later migration 1744156395
41+
CREATE INDEX IF NOT EXISTS zoekt_index_jobs_repository_id ON zoekt_index_jobs (repository_id);
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
name: drop_zoekt_index_jobs
2+
parents: [1756143187, 1755894745]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DROP TABLE IF EXISTS zoekt_index_jobs;
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
CREATE TABLE IF NOT EXISTS deepsearch_references(
2+
id serial PRIMARY KEY,
3+
conversation_id integer NOT NULL REFERENCES deepsearch_conversations(id) ON DELETE CASCADE,
4+
tenant_id integer NOT NULL DEFAULT current_setting('app.current_tenant') ::integer,
5+
repo_id integer REFERENCES repo(id) ON DELETE SET NULL,
6+
file_path text NOT NULL DEFAULT '',
7+
created_at timestamp NOT NULL DEFAULT NOW(),
8+
CONSTRAINT deepsearch_references_repo_filepath_unique UNIQUE (conversation_id, repo_id, file_path)
9+
);
10+
11+
COMMENT ON COLUMN deepsearch_references.file_path IS 'File path can be empty because some agent tools only produce repo or commit information but not file content. We use empty string as the sentinel value so that the unique constraint works correctly';
12+
13+
ALTER TABLE deepsearch_references ENABLE ROW LEVEL SECURITY;
14+
15+
DROP POLICY IF EXISTS tenant_isolation_policy ON deepsearch_references;
16+
17+
CREATE POLICY tenant_isolation_policy ON deepsearch_references AS PERMISSIVE
18+
FOR ALL TO PUBLIC
19+
USING ((tenant_id =(
20+
SELECT
21+
(current_setting('app.current_tenant'::text))::integer AS current_tenant)));
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
name: drop deepsearch references table
2+
parents: [1758549687]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DROP TABLE IF EXISTS deepsearch_references;

migrations/frontend/squashed.sql

Lines changed: 0 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -2376,27 +2376,6 @@ CREATE SEQUENCE deepsearch_quota_id_seq
23762376

23772377
ALTER SEQUENCE deepsearch_quota_id_seq OWNED BY deepsearch_quota.id;
23782378

2379-
CREATE TABLE deepsearch_references (
2380-
id integer NOT NULL,
2381-
conversation_id integer NOT NULL,
2382-
tenant_id integer DEFAULT (current_setting('app.current_tenant'::text))::integer NOT NULL,
2383-
repo_id integer,
2384-
file_path text DEFAULT ''::text NOT NULL,
2385-
created_at timestamp without time zone DEFAULT now() NOT NULL
2386-
);
2387-
2388-
COMMENT ON COLUMN deepsearch_references.file_path IS 'File path can be empty because some agent tools only produce repo or commit information but not file content. We use empty string as the sentinel value so that the unique constraint works correctly';
2389-
2390-
CREATE SEQUENCE deepsearch_references_id_seq
2391-
AS integer
2392-
START WITH 1
2393-
INCREMENT BY 1
2394-
NO MINVALUE
2395-
NO MAXVALUE
2396-
CACHE 1;
2397-
2398-
ALTER SEQUENCE deepsearch_references_id_seq OWNED BY deepsearch_references.id;
2399-
24002379
CREATE TABLE entitlement_grants (
24012380
entitlement_id integer NOT NULL,
24022381
user_id integer NOT NULL,
@@ -5944,34 +5923,6 @@ CREATE SEQUENCE webhooks_id_seq
59445923

59455924
ALTER SEQUENCE webhooks_id_seq OWNED BY webhooks.id;
59465925

5947-
CREATE TABLE zoekt_index_jobs (
5948-
id bigint NOT NULL,
5949-
state text DEFAULT 'queued'::text NOT NULL,
5950-
failure_message text,
5951-
queued_at timestamp with time zone DEFAULT now() NOT NULL,
5952-
started_at timestamp with time zone,
5953-
finished_at timestamp with time zone,
5954-
process_after timestamp with time zone,
5955-
num_resets integer DEFAULT 0 NOT NULL,
5956-
num_failures integer DEFAULT 0 NOT NULL,
5957-
last_heartbeat_at timestamp with time zone,
5958-
execution_logs json[],
5959-
worker_hostname text DEFAULT ''::text NOT NULL,
5960-
cancel boolean DEFAULT false NOT NULL,
5961-
repository_id integer NOT NULL,
5962-
priority integer DEFAULT 1 NOT NULL,
5963-
tenant_id integer DEFAULT (current_setting('app.current_tenant'::text))::integer NOT NULL
5964-
);
5965-
5966-
CREATE SEQUENCE zoekt_index_jobs_id_seq
5967-
START WITH 1
5968-
INCREMENT BY 1
5969-
NO MINVALUE
5970-
NO MAXVALUE
5971-
CACHE 1;
5972-
5973-
ALTER SEQUENCE zoekt_index_jobs_id_seq OWNED BY zoekt_index_jobs.id;
5974-
59755926
CREATE TABLE zoekt_repos (
59765927
repo_id integer NOT NULL,
59775928
branches jsonb DEFAULT '[]'::jsonb NOT NULL,
@@ -6074,8 +6025,6 @@ ALTER TABLE ONLY deepsearch_questions ALTER COLUMN id SET DEFAULT nextval('deeps
60746025

60756026
ALTER TABLE ONLY deepsearch_quota ALTER COLUMN id SET DEFAULT nextval('deepsearch_quota_id_seq'::regclass);
60766027

6077-
ALTER TABLE ONLY deepsearch_references ALTER COLUMN id SET DEFAULT nextval('deepsearch_references_id_seq'::regclass);
6078-
60796028
ALTER TABLE ONLY entitlements ALTER COLUMN id SET DEFAULT nextval('entitlements_id_seq'::regclass);
60806029

60816030
ALTER TABLE ONLY event_logs ALTER COLUMN id SET DEFAULT nextval('event_logs_id_seq'::regclass);
@@ -6280,8 +6229,6 @@ ALTER TABLE ONLY webhook_logs ALTER COLUMN id SET DEFAULT nextval('webhook_logs_
62806229

62816230
ALTER TABLE ONLY webhooks ALTER COLUMN id SET DEFAULT nextval('webhooks_id_seq'::regclass);
62826231

6283-
ALTER TABLE ONLY zoekt_index_jobs ALTER COLUMN id SET DEFAULT nextval('zoekt_index_jobs_id_seq'::regclass);
6284-
62856232
ALTER TABLE ONLY access_requests
62866233
ADD CONSTRAINT access_requests_pkey PRIMARY KEY (id);
62876234

@@ -6477,12 +6424,6 @@ ALTER TABLE ONLY deepsearch_quota
64776424
ALTER TABLE ONLY deepsearch_quota
64786425
ADD CONSTRAINT deepsearch_quota_user_id_key UNIQUE (user_id);
64796426

6480-
ALTER TABLE ONLY deepsearch_references
6481-
ADD CONSTRAINT deepsearch_references_pkey PRIMARY KEY (id);
6482-
6483-
ALTER TABLE ONLY deepsearch_references
6484-
ADD CONSTRAINT deepsearch_references_repo_filepath_unique UNIQUE (conversation_id, repo_id, file_path);
6485-
64866427
ALTER TABLE ONLY entitlement_grants
64876428
ADD CONSTRAINT entitlement_grants_pkey PRIMARY KEY (entitlement_id, user_id);
64886429

@@ -6999,9 +6940,6 @@ ALTER TABLE ONLY webhooks
69996940
ALTER TABLE ONLY webhooks
70006941
ADD CONSTRAINT webhooks_uuid_key UNIQUE (uuid);
70016942

7002-
ALTER TABLE ONLY zoekt_index_jobs
7003-
ADD CONSTRAINT zoekt_index_jobs_pkey PRIMARY KEY (id);
7004-
70056943
ALTER TABLE ONLY zoekt_repos
70066944
ADD CONSTRAINT zoekt_repos_pkey PRIMARY KEY (repo_id);
70076945

@@ -7263,8 +7201,6 @@ CREATE INDEX idx_repo_update_jobs_repository_id ON repo_update_jobs USING btree
72637201

72647202
CREATE INDEX idx_user_id_created_at ON cody_audit_log USING btree (user_id, created_at);
72657203

7266-
CREATE INDEX idx_zoekt_index_jobs_repository_id ON zoekt_index_jobs USING btree (tenant_id, repository_id);
7267-
72687204
CREATE INDEX insights_query_runner_jobs_cost_idx ON insights_query_runner_jobs USING btree (cost);
72697205

72707206
CREATE INDEX insights_query_runner_jobs_dependencies_job_id_fk_idx ON insights_query_runner_jobs_dependencies USING btree (job_id);
@@ -7569,14 +7505,6 @@ CREATE INDEX webhook_logs_received_at_idx ON webhook_logs USING btree (received_
75697505

75707506
CREATE INDEX webhook_logs_status_code_idx ON webhook_logs USING btree (status_code);
75717507

7572-
CREATE INDEX zoekt_index_jobs_dequeue_idx ON zoekt_index_jobs USING btree (state, process_after);
7573-
7574-
CREATE INDEX zoekt_index_jobs_dequeue_order_idx ON zoekt_index_jobs USING btree (priority DESC, COALESCE(process_after, queued_at), id, tenant_id);
7575-
7576-
CREATE UNIQUE INDEX zoekt_index_jobs_one_concurrent_per_repo ON zoekt_index_jobs USING btree (repository_id, tenant_id) WHERE (state = ANY (ARRAY['queued'::text, 'processing'::text, 'errored'::text]));
7577-
7578-
CREATE INDEX zoekt_index_jobs_repository_id ON zoekt_index_jobs USING btree (repository_id);
7579-
75807508
CREATE INDEX zoekt_repos_index_status ON zoekt_repos USING btree (index_status);
75817509

75827510
CREATE TRIGGER batch_spec_workspace_execution_last_dequeues_insert AFTER INSERT ON batch_spec_workspace_execution_jobs REFERENCING NEW TABLE AS newtab FOR EACH STATEMENT EXECUTE FUNCTION batch_spec_workspace_execution_last_dequeues_upsert();
@@ -7878,12 +7806,6 @@ ALTER TABLE ONLY deepsearch_questions
78787806
ALTER TABLE ONLY deepsearch_quota
78797807
ADD CONSTRAINT deepsearch_quota_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
78807808

7881-
ALTER TABLE ONLY deepsearch_references
7882-
ADD CONSTRAINT deepsearch_references_conversation_id_fkey FOREIGN KEY (conversation_id) REFERENCES deepsearch_conversations(id) ON DELETE CASCADE;
7883-
7884-
ALTER TABLE ONLY deepsearch_references
7885-
ADD CONSTRAINT deepsearch_references_repo_id_fkey FOREIGN KEY (repo_id) REFERENCES repo(id) ON DELETE SET NULL;
7886-
78877809
ALTER TABLE ONLY entitlement_grants
78887810
ADD CONSTRAINT entitlement_grants_entitlement_id_fkey FOREIGN KEY (entitlement_id) REFERENCES entitlements(id) ON DELETE CASCADE;
78897811

@@ -8277,9 +8199,6 @@ ALTER TABLE ONLY webhooks
82778199
ALTER TABLE ONLY webhooks
82788200
ADD CONSTRAINT webhooks_updated_by_user_id_fkey FOREIGN KEY (updated_by_user_id) REFERENCES users(id) ON DELETE SET NULL;
82798201

8280-
ALTER TABLE ONLY zoekt_index_jobs
8281-
ADD CONSTRAINT zoekt_index_jobs_repository_id_fkey FOREIGN KEY (repository_id) REFERENCES repo(id) ON DELETE CASCADE;
8282-
82838202
ALTER TABLE ONLY zoekt_repos
82848203
ADD CONSTRAINT zoekt_repos_repo_id_fkey FOREIGN KEY (repo_id) REFERENCES repo(id) ON DELETE CASCADE;
82858204

@@ -8385,8 +8304,6 @@ ALTER TABLE deepsearch_questions ENABLE ROW LEVEL SECURITY;
83858304

83868305
ALTER TABLE deepsearch_quota ENABLE ROW LEVEL SECURITY;
83878306

8388-
ALTER TABLE deepsearch_references ENABLE ROW LEVEL SECURITY;
8389-
83908307
ALTER TABLE entitlement_grants ENABLE ROW LEVEL SECURITY;
83918308

83928309
ALTER TABLE entitlements ENABLE ROW LEVEL SECURITY;
@@ -8715,8 +8632,6 @@ CREATE POLICY tenant_isolation_policy ON deepsearch_questions USING ((tenant_id
87158632

87168633
CREATE POLICY tenant_isolation_policy ON deepsearch_quota USING ((tenant_id = ( SELECT (current_setting('app.current_tenant'::text))::integer AS current_tenant)));
87178634

8718-
CREATE POLICY tenant_isolation_policy ON deepsearch_references USING ((tenant_id = ( SELECT (current_setting('app.current_tenant'::text))::integer AS current_tenant)));
8719-
87208635
CREATE POLICY tenant_isolation_policy ON entitlement_grants USING ((tenant_id = ( SELECT (current_setting('app.current_tenant'::text))::integer AS current_tenant)));
87218636

87228637
CREATE POLICY tenant_isolation_policy ON entitlements USING ((tenant_id = ( SELECT (current_setting('app.current_tenant'::text))::integer AS current_tenant)));
@@ -8971,8 +8886,6 @@ CREATE POLICY tenant_isolation_policy ON webhook_logs USING ((tenant_id = ( SELE
89718886

89728887
CREATE POLICY tenant_isolation_policy ON webhooks USING ((tenant_id = ( SELECT (current_setting('app.current_tenant'::text))::integer AS current_tenant)));
89738888

8974-
CREATE POLICY tenant_isolation_policy ON zoekt_index_jobs USING ((( SELECT (current_setting('app.current_tenant'::text) = 'workertenant'::text)) OR (tenant_id = ( SELECT (NULLIF(current_setting('app.current_tenant'::text), 'workertenant'::text))::integer AS current_tenant))));
8975-
89768889
CREATE POLICY tenant_isolation_policy ON zoekt_repos USING ((( SELECT (current_setting('app.current_tenant'::text) = 'zoekttenant'::text)) OR (tenant_id = ( SELECT (NULLIF(current_setting('app.current_tenant'::text), 'zoekttenant'::text))::integer AS current_tenant))));
89778890

89788891
ALTER TABLE tenants ENABLE ROW LEVEL SECURITY;
@@ -9003,8 +8916,6 @@ ALTER TABLE webhook_logs ENABLE ROW LEVEL SECURITY;
90038916

90048917
ALTER TABLE webhooks ENABLE ROW LEVEL SECURITY;
90058918

9006-
ALTER TABLE zoekt_index_jobs ENABLE ROW LEVEL SECURITY;
9007-
90088919
ALTER TABLE zoekt_repos ENABLE ROW LEVEL SECURITY;
90098920

90108921
INSERT INTO lsif_configuration_policies (id, repository_id, name, type, pattern, retention_enabled, retention_duration_hours, retain_intermediate_commits, indexing_enabled, index_commit_max_age_hours, index_intermediate_commits, protected, repository_patterns, last_resolved_at, syntactic_indexing_enabled, tenant_id) VALUES (1, NULL, 'Default tip-of-branch retention policy', 'GIT_TREE', '*', true, 2016, false, false, 0, false, true, NULL, NULL, false, 1);

0 commit comments

Comments
 (0)