Skip to content

Commit 1c2d211

Browse files
authored
[WPB-21259] Finalize API Version V12 (#4817)
1 parent 0118f70 commit 1c2d211

File tree

10 files changed

+37093
-22
lines changed

10 files changed

+37093
-22
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Finalize API Version V12, start new develop version V13.

docs/src/developer/developer/api-versioning.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,13 @@ non-overlapping version ranges.
106106
### Version bump checklist
107107

108108
When making the client API version bump, i.e., when finalising a version, there
109-
are several steps to make apart from deciding what endpoint changes are part of
109+
are several steps to take apart from deciding what endpoint changes are part of
110110
the version. In these example we assume that version `V6` should be finalized and `V7` should be created:
111111

112112
- Run wire-server and download the `swagger.json` of the current development version, e.g. with the following command: `curl localhost:8080/v6/api/swagger.json | jq > swagger-v6.json` and copy the file to `services/brig/docs/swagger-v6.json`.
113113
- In `wire-api` extend the `Version` type with a new version by appending the
114114
new version to the end.
115-
- In the same `Version` module update the `developmentVersions` value to list
116-
only the new version.
115+
- In the same `Version` module update the `isDevelopmentVersion` to your taste.
117116
- In `services/brig/src/Brig/API/Public.hs`
118117
- update `versionedSwaggerDocsAPI` so that the finalized version points to the pregenerated swagger, and the dynamically generated swagger spits out swagger for the new `V7`.
119118
- Set the version for `gDefaultAPIVersion` in `integration/test/Testlib/Env.hs` to 7.

integration/test/Test/Swagger.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import Testlib.Prelude
1313
import UnliftIO.Temporary
1414

1515
existingVersions :: Set Int
16-
existingVersions = Set.fromList [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
16+
existingVersions = Set.fromList [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
1717

1818
internalApis :: Set String
1919
internalApis = Set.fromList ["brig", "cannon", "cargohold", "cannon", "spar"]

integration/test/Testlib/Env.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ mkGlobalEnv cfgFile = do
116116
gFederationV1Domain = intConfig.federationV1.originDomain,
117117
gFederationV2Domain = intConfig.federationV2.originDomain,
118118
gDynamicDomains = (.domain) <$> Map.elems intConfig.dynamicBackends,
119-
gDefaultAPIVersion = 12,
119+
gDefaultAPIVersion = 13,
120120
gManager = manager,
121121
gServicesCwdBase = devEnvProjectRoot <&> (</> "services"),
122122
gBackendResourcePool = resourcePool,

libs/wire-api/src/Wire/API/Routes/Public/Brig.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ type UserGroupAPI =
413413
:<|> Named
414414
"update-user-group-members"
415415
( Summary "[STUB] Update user group members. Replaces the users with the given list."
416-
:> From 'V12
416+
:> From 'V13
417417
:> ZLocalUser
418418
:> "user-groups"
419419
:> Capture "gid" UserGroupId
@@ -424,7 +424,7 @@ type UserGroupAPI =
424424
:<|> Named
425425
"update-user-group-channels"
426426
( Summary "Replaces the channels with the given list."
427-
:> From 'V12
427+
:> From 'V13
428428
:> CanThrow 'UserGroupNotFound
429429
:> CanThrow 'UserGroupNotATeamAdmin
430430
:> ZLocalUser
@@ -438,7 +438,7 @@ type UserGroupAPI =
438438
:<|> Named
439439
"check-user-group-name-available"
440440
( Summary "[STUB] Check if a user group name is available"
441-
:> From 'V12
441+
:> From 'V13
442442
:> ZLocalUser
443443
:> "user-groups"
444444
:> "check-name"

libs/wire-api/src/Wire/API/Routes/Public/Galley/Conversation.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1413,7 +1413,7 @@ type ConversationAPI =
14131413
:<|> Named
14141414
"search-channels"
14151415
( Summary "[STUB] Search channels"
1416-
:> From 'V12
1416+
:> From 'V13
14171417
:> ZLocalUser
14181418
:> "search"
14191419
:> "channels"

libs/wire-api/src/Wire/API/Routes/Version.hs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ import Wire.Arbitrary (Arbitrary, GenericUniform (GenericUniform))
8181
-- and 'developmentVersions' stay in sync; everything else here should keep working without
8282
-- change. See also documentation in the *docs* directory.
8383
-- https://docs.wire.com/developer/developer/api-versioning.html#version-bump-checklist
84-
data Version = V0 | V1 | V2 | V3 | V4 | V5 | V6 | V7 | V8 | V9 | V10 | V11 | V12
84+
data Version = V0 | V1 | V2 | V3 | V4 | V5 | V6 | V7 | V8 | V9 | V10 | V11 | V12 | V13
8585
deriving stock (Eq, Ord, Bounded, Enum, Show, Generic)
8686
deriving (FromJSON, ToJSON) via (Schema Version)
8787
deriving (Arbitrary) via (GenericUniform Version)
@@ -110,6 +110,8 @@ instance RenderableSymbol V11 where renderSymbol = "V11"
110110

111111
instance RenderableSymbol V12 where renderSymbol = "V12"
112112

113+
instance RenderableSymbol V13 where renderSymbol = "V13"
114+
113115
-- | Manual enumeration of version integrals (the `<n>` in the constructor `V<n>`).
114116
--
115117
-- This is not the same as 'fromEnum': we will remove unsupported versions in the future,
@@ -130,6 +132,7 @@ versionInt V9 = 9
130132
versionInt V10 = 10
131133
versionInt V11 = 11
132134
versionInt V12 = 12
135+
versionInt V13 = 13
133136

134137
supportedVersions :: [Version]
135138
supportedVersions = [minBound .. maxBound]
@@ -249,7 +252,8 @@ isDevelopmentVersion V8 = False
249252
isDevelopmentVersion V9 = False
250253
isDevelopmentVersion V10 = False
251254
isDevelopmentVersion V11 = False
252-
isDevelopmentVersion V12 = True
255+
isDevelopmentVersion V12 = False
256+
isDevelopmentVersion V13 = True
253257

254258
developmentVersions :: [Version]
255259
developmentVersions = filter isDevelopmentVersion supportedVersions

postgres-schema.sql

Lines changed: 215 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
-- PostgreSQL database dump
88
--
99

10+
\restrict Hl9XxATRAdecxBiFt8PPZgKxbcBTtxdglRrKHEan0Af69hORYkknDeYWBzNNCd6
11+
1012
-- Dumped from database version 17.6
1113
-- Dumped by pg_dump version 17.6
1214

@@ -68,6 +70,106 @@ CREATE TABLE public.collaborators (
6870

6971
ALTER TABLE public.collaborators OWNER TO "wire-server";
7072

73+
--
74+
-- Name: conversation; Type: TABLE; Schema: public; Owner: wire-server
75+
--
76+
77+
CREATE TABLE public.conversation (
78+
id uuid NOT NULL,
79+
access integer[],
80+
access_roles_v2 integer[],
81+
cells_state integer,
82+
channel_add_permission integer,
83+
cipher_suite integer,
84+
creator uuid,
85+
epoch bigint,
86+
epoch_timestamp timestamp with time zone,
87+
group_conv_type integer,
88+
group_id bytea,
89+
message_timer bigint,
90+
name text,
91+
protocol integer,
92+
public_group_state bytea,
93+
receipt_mode integer,
94+
team uuid,
95+
type integer NOT NULL,
96+
parent_conv uuid
97+
);
98+
99+
100+
ALTER TABLE public.conversation OWNER TO "wire-server";
101+
102+
--
103+
-- Name: conversation_member; Type: TABLE; Schema: public; Owner: wire-server
104+
--
105+
106+
CREATE TABLE public.conversation_member (
107+
conv uuid NOT NULL,
108+
"user" uuid NOT NULL,
109+
conversation_role text,
110+
hidden boolean,
111+
hidden_ref text,
112+
otr_archived boolean,
113+
otr_archived_ref text,
114+
otr_muted boolean,
115+
otr_muted_ref text,
116+
otr_muted_status integer,
117+
provider uuid,
118+
service uuid
119+
);
120+
121+
122+
ALTER TABLE public.conversation_member OWNER TO "wire-server";
123+
124+
--
125+
-- Name: local_conversation_remote_member; Type: TABLE; Schema: public; Owner: wire-server
126+
--
127+
128+
CREATE TABLE public.local_conversation_remote_member (
129+
conv uuid NOT NULL,
130+
user_remote_domain text NOT NULL,
131+
user_remote_id uuid NOT NULL,
132+
conversation_role text
133+
);
134+
135+
136+
ALTER TABLE public.local_conversation_remote_member OWNER TO "wire-server";
137+
138+
--
139+
-- Name: mls_group_member_client; Type: TABLE; Schema: public; Owner: wire-server
140+
--
141+
142+
CREATE TABLE public.mls_group_member_client (
143+
group_id bytea NOT NULL,
144+
user_domain text NOT NULL,
145+
"user" uuid NOT NULL,
146+
client text NOT NULL,
147+
leaf_node_index integer NOT NULL,
148+
removal_pending boolean NOT NULL
149+
);
150+
151+
152+
ALTER TABLE public.mls_group_member_client OWNER TO "wire-server";
153+
154+
--
155+
-- Name: remote_conversation_local_member; Type: TABLE; Schema: public; Owner: wire-server
156+
--
157+
158+
CREATE TABLE public.remote_conversation_local_member (
159+
"user" uuid NOT NULL,
160+
conv_remote_domain text NOT NULL,
161+
conv_remote_id uuid NOT NULL,
162+
hidden boolean,
163+
hidden_ref text,
164+
otr_archived boolean,
165+
otr_archived_ref text,
166+
otr_muted_ref text,
167+
otr_muted_status integer
168+
);
169+
170+
171+
ALTER TABLE public.remote_conversation_local_member OWNER TO "wire-server";
172+
71173
--
72174
-- Name: schema_migrations; Type: TABLE; Schema: public; Owner: wire-server
73175
--
@@ -81,6 +183,23 @@ CREATE TABLE public.schema_migrations (
81183

82184
ALTER TABLE public.schema_migrations OWNER TO "wire-server";
83185

186+
--
187+
-- Name: subconversation; Type: TABLE; Schema: public; Owner: wire-server
188+
--
189+
190+
CREATE TABLE public.subconversation (
191+
conv_id uuid NOT NULL,
192+
subconv_id text NOT NULL,
193+
cipher_suite integer,
194+
epoch bigint NOT NULL,
195+
epoch_timestamp timestamp with time zone NOT NULL,
196+
group_id bytea NOT NULL,
197+
public_group_state bytea
198+
);
199+
200+
201+
ALTER TABLE public.subconversation OWNER TO "wire-server";
202+
84203
--
85204
-- Name: user_group; Type: TABLE; Schema: public; Owner: wire-server
86205
--
@@ -136,6 +255,54 @@ ALTER TABLE ONLY public.collaborators
136255
ADD CONSTRAINT collaborators_pkey PRIMARY KEY (user_id, team_id);
137256

138257

258+
--
259+
-- Name: conversation_member conversation_member_pkey; Type: CONSTRAINT; Schema: public; Owner: wire-server
260+
--
261+
262+
ALTER TABLE ONLY public.conversation_member
263+
ADD CONSTRAINT conversation_member_pkey PRIMARY KEY (conv, "user");
264+
265+
266+
--
267+
-- Name: conversation conversation_pkey; Type: CONSTRAINT; Schema: public; Owner: wire-server
268+
--
269+
270+
ALTER TABLE ONLY public.conversation
271+
ADD CONSTRAINT conversation_pkey PRIMARY KEY (id);
272+
273+
274+
--
275+
-- Name: local_conversation_remote_member local_conversation_remote_member_pkey; Type: CONSTRAINT; Schema: public; Owner: wire-server
276+
--
277+
278+
ALTER TABLE ONLY public.local_conversation_remote_member
279+
ADD CONSTRAINT local_conversation_remote_member_pkey PRIMARY KEY (conv, user_remote_domain, user_remote_id);
280+
281+
282+
--
283+
-- Name: mls_group_member_client mls_group_member_client_pkey; Type: CONSTRAINT; Schema: public; Owner: wire-server
284+
--
285+
286+
ALTER TABLE ONLY public.mls_group_member_client
287+
ADD CONSTRAINT mls_group_member_client_pkey PRIMARY KEY (group_id, user_domain, "user", client);
288+
289+
290+
--
291+
-- Name: remote_conversation_local_member remote_conversation_local_member_pkey; Type: CONSTRAINT; Schema: public; Owner: wire-server
292+
--
293+
294+
ALTER TABLE ONLY public.remote_conversation_local_member
295+
ADD CONSTRAINT remote_conversation_local_member_pkey PRIMARY KEY ("user", conv_remote_domain, conv_remote_id);
296+
297+
298+
--
299+
-- Name: subconversation subconversation_pkey; Type: CONSTRAINT; Schema: public; Owner: wire-server
300+
--
301+
302+
ALTER TABLE ONLY public.subconversation
303+
ADD CONSTRAINT subconversation_pkey PRIMARY KEY (conv_id, subconv_id);
304+
305+
139306
--
140307
-- Name: user_group_channel user_group_channel_pkey; Type: CONSTRAINT; Schema: public; Owner: wire-server
141308
--
@@ -182,13 +349,43 @@ CREATE INDEX collaborators_team_id_idx ON public.collaborators USING btree (team
182349
CREATE INDEX collaborators_user_id_idx ON public.collaborators USING btree (user_id);
183350

184351

352+
--
353+
-- Name: conversation_member_user_idx; Type: INDEX; Schema: public; Owner: wire-server
354+
--
355+
356+
CREATE INDEX conversation_member_user_idx ON public.conversation_member USING btree ("user");
357+
358+
359+
--
360+
-- Name: conversation_team_idx; Type: INDEX; Schema: public; Owner: wire-server
361+
--
362+
363+
CREATE INDEX conversation_team_idx ON public.conversation USING btree (team);
364+
365+
185366
--
186367
-- Name: user_group_member_user_id_idx; Type: INDEX; Schema: public; Owner: wire-server
187368
--
188369

189370
CREATE INDEX user_group_member_user_id_idx ON public.user_group_member USING btree (user_id);
190371

191372

373+
--
374+
-- Name: conversation_member conversation_member_conv_fkey; Type: FK CONSTRAINT; Schema: public; Owner: wire-server
375+
--
376+
377+
ALTER TABLE ONLY public.conversation_member
378+
ADD CONSTRAINT conversation_member_conv_fkey FOREIGN KEY (conv) REFERENCES public.conversation(id) ON DELETE CASCADE;
379+
380+
381+
--
382+
-- Name: conversation conversation_parent_conv_fkey; Type: FK CONSTRAINT; Schema: public; Owner: wire-server
383+
--
384+
385+
ALTER TABLE ONLY public.conversation
386+
ADD CONSTRAINT conversation_parent_conv_fkey FOREIGN KEY (parent_conv) REFERENCES public.conversation(id) ON DELETE CASCADE;
387+
388+
192389
--
193390
-- Name: user_group_member fk_user_group; Type: FK CONSTRAINT; Schema: public; Owner: wire-server
194391
--
@@ -205,6 +402,22 @@ ALTER TABLE ONLY public.user_group_channel
205402
ADD CONSTRAINT fk_user_group_channel FOREIGN KEY (user_group_id) REFERENCES public.user_group(id) ON DELETE CASCADE;
206403

207404

405+
--
406+
-- Name: local_conversation_remote_member local_conversation_remote_member_conv_fkey; Type: FK CONSTRAINT; Schema: public; Owner: wire-server
407+
--
408+
409+
ALTER TABLE ONLY public.local_conversation_remote_member
410+
ADD CONSTRAINT local_conversation_remote_member_conv_fkey FOREIGN KEY (conv) REFERENCES public.conversation(id) ON DELETE CASCADE;
411+
412+
413+
--
414+
-- Name: subconversation subconversation_conv_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: wire-server
415+
--
416+
417+
ALTER TABLE ONLY public.subconversation
418+
ADD CONSTRAINT subconversation_conv_id_fkey FOREIGN KEY (conv_id) REFERENCES public.conversation(id) ON DELETE CASCADE;
419+
420+
208421
--
209422
-- Name: SCHEMA public; Type: ACL; Schema: -; Owner: wire-server
210423
--
@@ -215,3 +428,5 @@ REVOKE USAGE ON SCHEMA public FROM PUBLIC;
215428
--
216429
-- PostgreSQL database dump complete
217430
--
431+
432+
\unrestrict Hl9XxATRAdecxBiFt8PPZgKxbcBTtxdglRrKHEan0Af69hORYkknDeYWBzNNCd6

0 commit comments

Comments
 (0)