Skip to content

Commit 0fc2d0a

Browse files
authored
fix: submodules and doc (#1280)
Remove references to old protos, update `/schemas` submodule. The old protos were still being used to generate the doc. I've updated them. Also, the `schemas` submodule was set to some very old version, I couldn't even run the live docs for that reason. I've updated it to the latest release of that module. --------- Signed-off-by: Todd Baert <[email protected]>
1 parent 219789f commit 0fc2d0a

File tree

4 files changed

+69
-60
lines changed

4 files changed

+69
-60
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ pull-schemas-submodule:
117117

118118
.PHONY: generate-proto-docs
119119
generate-proto-docs: pull-schemas-submodule
120-
docker run --rm -v ${PWD}/$(DOCS_DIR)/reference/specifications:/out -v ${PWD}/schemas/protobuf:/protos pseudomuto/protoc-gen-doc --doc_opt=markdown,protos-with-toc.md schema/v1/schema.proto sync/v1/sync_service.proto \
120+
docker run --rm -v ${PWD}/$(DOCS_DIR)/reference/specifications:/out -v ${PWD}/schemas/protobuf:/protos pseudomuto/protoc-gen-doc --doc_opt=markdown,protos-with-toc.md flagd/evaluation/v1/evaluation.proto flagd/sync/v1/sync.proto \
121121
&& echo '<!-- WARNING: THIS DOC IS AUTO-GENERATED. DO NOT EDIT! -->' > ${PWD}/$(DOCS_DIR)/reference/specifications/protos.md \
122122
&& sed '/^## Table of Contents/,/#top/d' ${PWD}/$(DOCS_DIR)/reference/specifications/protos-with-toc.md >> ${PWD}/$(DOCS_DIR)/reference/specifications/protos.md \
123123
&& rm -f ${PWD}/$(DOCS_DIR)/reference/specifications/protos-with-toc.md

docs/concepts/syncs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ See [sync source](../reference/sync-configuration.md#source-configuration) confi
3939
### gRPC sync
4040

4141
The gRPC sync provider streams flag definitions from a gRPC sync provider implementation.
42-
This stream connection is defined by the [sync service protobuf definition](https://github.com/open-feature/schemas/blob/main/protobuf/sync/v1/sync_service.proto).
42+
This stream connection is defined by the [sync service protobuf definition](https://github.com/open-feature/flagd-schemas/blob/main/protobuf/flagd/sync/v1/sync.proto).
4343

4444
```shell
4545
flagd start --uri grpc://grpc-sync-source

docs/reference/specifications/protos.md

Lines changed: 66 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
<a name="top"></a>
44

55

6-
## schema/v1/schema.proto
6+
## flagd/evaluation/v1/evaluation.proto
77
Flag evaluation API
88

99
This proto forms the basis of a flag-evaluation API.
1010
It supports single and bulk evaluation RPCs, and flags of various types, as well as establishing a stream for getting notifications about changes in a flag definition.
1111
It supports the inclusion of a &#34;context&#34; with each evaluation, which may contain arbitrary attributes relevant to flag evaluation.
1212

1313

14-
<a name="schema-v1-AnyFlag"></a>
14+
<a name="flagd-evaluation-v1-AnyFlag"></a>
1515

1616
### AnyFlag
1717
A variant type flag response.
@@ -31,7 +31,7 @@ A variant type flag response.
3131

3232

3333

34-
<a name="schema-v1-EventStreamRequest"></a>
34+
<a name="flagd-evaluation-v1-EventStreamRequest"></a>
3535

3636
### EventStreamRequest
3737
Empty stream request body
@@ -41,7 +41,7 @@ Empty stream request body
4141

4242

4343

44-
<a name="schema-v1-EventStreamResponse"></a>
44+
<a name="flagd-evaluation-v1-EventStreamResponse"></a>
4545

4646
### EventStreamResponse
4747
Response body for the EventStream stream response
@@ -57,7 +57,7 @@ Response body for the EventStream stream response
5757

5858

5959

60-
<a name="schema-v1-ResolveAllRequest"></a>
60+
<a name="flagd-evaluation-v1-ResolveAllRequest"></a>
6161

6262
### ResolveAllRequest
6363
Request body for bulk flag evaluation, used by the ResolveAll rpc.
@@ -72,22 +72,22 @@ Request body for bulk flag evaluation, used by the ResolveAll rpc.
7272

7373

7474

75-
<a name="schema-v1-ResolveAllResponse"></a>
75+
<a name="flagd-evaluation-v1-ResolveAllResponse"></a>
7676

7777
### ResolveAllResponse
7878
Response body for bulk flag evaluation, used by the ResolveAll rpc.
7979

8080

8181
| Field | Type | Label | Description |
8282
| ----- | ---- | ----- | ----------- |
83-
| flags | [ResolveAllResponse.FlagsEntry](#schema-v1-ResolveAllResponse-FlagsEntry) | repeated | Object structure describing the evaluated flags for the provided context. |
83+
| flags | [ResolveAllResponse.FlagsEntry](#flagd-evaluation-v1-ResolveAllResponse-FlagsEntry) | repeated | Object structure describing the evaluated flags for the provided context. |
8484

8585

8686

8787

8888

8989

90-
<a name="schema-v1-ResolveAllResponse-FlagsEntry"></a>
90+
<a name="flagd-evaluation-v1-ResolveAllResponse-FlagsEntry"></a>
9191

9292
### ResolveAllResponse.FlagsEntry
9393

@@ -96,14 +96,14 @@ Response body for bulk flag evaluation, used by the ResolveAll rpc.
9696
| Field | Type | Label | Description |
9797
| ----- | ---- | ----- | ----------- |
9898
| key | [string](#string) | | |
99-
| value | [AnyFlag](#schema-v1-AnyFlag) | | |
99+
| value | [AnyFlag](#flagd-evaluation-v1-AnyFlag) | | |
100100

101101

102102

103103

104104

105105

106-
<a name="schema-v1-ResolveBooleanRequest"></a>
106+
<a name="flagd-evaluation-v1-ResolveBooleanRequest"></a>
107107

108108
### ResolveBooleanRequest
109109
Request body for boolean flag evaluation, used by the ResolveBoolean rpc.
@@ -119,7 +119,7 @@ Request body for boolean flag evaluation, used by the ResolveBoolean rpc.
119119

120120

121121

122-
<a name="schema-v1-ResolveBooleanResponse"></a>
122+
<a name="flagd-evaluation-v1-ResolveBooleanResponse"></a>
123123

124124
### ResolveBooleanResponse
125125
Response body for boolean flag evaluation. used by the ResolveBoolean rpc.
@@ -137,7 +137,7 @@ Response body for boolean flag evaluation. used by the ResolveBoolean rpc.
137137

138138

139139

140-
<a name="schema-v1-ResolveFloatRequest"></a>
140+
<a name="flagd-evaluation-v1-ResolveFloatRequest"></a>
141141

142142
### ResolveFloatRequest
143143
Request body for float flag evaluation, used by the ResolveFloat rpc.
@@ -153,7 +153,7 @@ Request body for float flag evaluation, used by the ResolveFloat rpc.
153153

154154

155155

156-
<a name="schema-v1-ResolveFloatResponse"></a>
156+
<a name="flagd-evaluation-v1-ResolveFloatResponse"></a>
157157

158158
### ResolveFloatResponse
159159
Response body for float flag evaluation. used by the ResolveFloat rpc.
@@ -171,7 +171,7 @@ Response body for float flag evaluation. used by the ResolveFloat rpc.
171171

172172

173173

174-
<a name="schema-v1-ResolveIntRequest"></a>
174+
<a name="flagd-evaluation-v1-ResolveIntRequest"></a>
175175

176176
### ResolveIntRequest
177177
Request body for int flag evaluation, used by the ResolveInt rpc.
@@ -187,7 +187,7 @@ Request body for int flag evaluation, used by the ResolveInt rpc.
187187

188188

189189

190-
<a name="schema-v1-ResolveIntResponse"></a>
190+
<a name="flagd-evaluation-v1-ResolveIntResponse"></a>
191191

192192
### ResolveIntResponse
193193
Response body for int flag evaluation. used by the ResolveInt rpc.
@@ -205,7 +205,7 @@ Response body for int flag evaluation. used by the ResolveInt rpc.
205205

206206

207207

208-
<a name="schema-v1-ResolveObjectRequest"></a>
208+
<a name="flagd-evaluation-v1-ResolveObjectRequest"></a>
209209

210210
### ResolveObjectRequest
211211
Request body for object flag evaluation, used by the ResolveObject rpc.
@@ -221,7 +221,7 @@ Request body for object flag evaluation, used by the ResolveObject rpc.
221221

222222

223223

224-
<a name="schema-v1-ResolveObjectResponse"></a>
224+
<a name="flagd-evaluation-v1-ResolveObjectResponse"></a>
225225

226226
### ResolveObjectResponse
227227
Response body for object flag evaluation. used by the ResolveObject rpc.
@@ -241,7 +241,7 @@ NOTE: This structure will need to be decoded from google/protobuf/struct.proto b
241241

242242

243243

244-
<a name="schema-v1-ResolveStringRequest"></a>
244+
<a name="flagd-evaluation-v1-ResolveStringRequest"></a>
245245

246246
### ResolveStringRequest
247247
Request body for string flag evaluation, used by the ResolveString rpc.
@@ -257,7 +257,7 @@ Request body for string flag evaluation, used by the ResolveString rpc.
257257

258258

259259

260-
<a name="schema-v1-ResolveStringResponse"></a>
260+
<a name="flagd-evaluation-v1-ResolveStringResponse"></a>
261261

262262
### ResolveStringResponse
263263
Response body for string flag evaluation. used by the ResolveString rpc.
@@ -281,52 +281,52 @@ Response body for string flag evaluation. used by the ResolveString rpc.
281281

282282

283283

284-
<a name="schema-v1-Service"></a>
284+
<a name="flagd-evaluation-v1-Service"></a>
285285

286286
### Service
287287
Service defines the exposed rpcs of flagd
288288

289289
| Method Name | Request Type | Response Type | Description |
290290
| ----------- | ------------ | ------------- | ------------|
291-
| ResolveAll | [ResolveAllRequest](#schema-v1-ResolveAllRequest) | [ResolveAllResponse](#schema-v1-ResolveAllResponse) | |
292-
| ResolveBoolean | [ResolveBooleanRequest](#schema-v1-ResolveBooleanRequest) | [ResolveBooleanResponse](#schema-v1-ResolveBooleanResponse) | |
293-
| ResolveString | [ResolveStringRequest](#schema-v1-ResolveStringRequest) | [ResolveStringResponse](#schema-v1-ResolveStringResponse) | |
294-
| ResolveFloat | [ResolveFloatRequest](#schema-v1-ResolveFloatRequest) | [ResolveFloatResponse](#schema-v1-ResolveFloatResponse) | |
295-
| ResolveInt | [ResolveIntRequest](#schema-v1-ResolveIntRequest) | [ResolveIntResponse](#schema-v1-ResolveIntResponse) | |
296-
| ResolveObject | [ResolveObjectRequest](#schema-v1-ResolveObjectRequest) | [ResolveObjectResponse](#schema-v1-ResolveObjectResponse) | |
297-
| EventStream | [EventStreamRequest](#schema-v1-EventStreamRequest) | [EventStreamResponse](#schema-v1-EventStreamResponse) stream | |
291+
| ResolveAll | [ResolveAllRequest](#flagd-evaluation-v1-ResolveAllRequest) | [ResolveAllResponse](#flagd-evaluation-v1-ResolveAllResponse) | |
292+
| ResolveBoolean | [ResolveBooleanRequest](#flagd-evaluation-v1-ResolveBooleanRequest) | [ResolveBooleanResponse](#flagd-evaluation-v1-ResolveBooleanResponse) | |
293+
| ResolveString | [ResolveStringRequest](#flagd-evaluation-v1-ResolveStringRequest) | [ResolveStringResponse](#flagd-evaluation-v1-ResolveStringResponse) | |
294+
| ResolveFloat | [ResolveFloatRequest](#flagd-evaluation-v1-ResolveFloatRequest) | [ResolveFloatResponse](#flagd-evaluation-v1-ResolveFloatResponse) | |
295+
| ResolveInt | [ResolveIntRequest](#flagd-evaluation-v1-ResolveIntRequest) | [ResolveIntResponse](#flagd-evaluation-v1-ResolveIntResponse) | |
296+
| ResolveObject | [ResolveObjectRequest](#flagd-evaluation-v1-ResolveObjectRequest) | [ResolveObjectResponse](#flagd-evaluation-v1-ResolveObjectResponse) | |
297+
| EventStream | [EventStreamRequest](#flagd-evaluation-v1-EventStreamRequest) | [EventStreamResponse](#flagd-evaluation-v1-EventStreamResponse) stream | |
298298

299299

300300

301301

302302

303-
<a name="sync_v1_sync_service-proto"></a>
303+
<a name="flagd_sync_v1_sync-proto"></a>
304304
<p align="right"><a href="#top">Top</a></p>
305305

306-
## sync/v1/sync_service.proto
306+
## flagd/sync/v1/sync.proto
307307
Flag definition sync API
308308

309309
This proto defines a simple API to synchronize a feature flag definition.
310310
It supports establishing a stream for getting notifications about changes in a flag definition.
311311

312312

313-
<a name="sync-v1-FetchAllFlagsRequest"></a>
313+
<a name="flagd-sync-v1-FetchAllFlagsRequest"></a>
314314

315315
### FetchAllFlagsRequest
316-
FetchAllFlagsRequest is the request to fetch all flags. Flagd sends this request as the client in order to resync its internal state
316+
FetchAllFlagsRequest is the request to fetch all flags. Clients send this request as the client in order to resync their internal state
317317

318318

319319
| Field | Type | Label | Description |
320320
| ----- | ---- | ----- | ----------- |
321-
| provider_id | [string](#string) | | Optional: A unique identifier for flagd(grpc client) initiating the request. The server implementations may utilize this identifier to uniquely identify, validate(ex:- enforce authentication/authorization) and filter flag configurations that it can expose to this request. This field is intended to be optional. However server implementations may enforce it. ex:- provider_id: flagd-weatherapp-sidecar |
321+
| provider_id | [string](#string) | | Optional: A unique identifier for clients initiating the request. The server implementations may utilize this identifier to uniquely identify, validate(ex:- enforce authentication/authorization) and filter flag configurations that it can expose to this request. This field is intended to be optional. However server implementations may enforce it. ex:- provider_id: flagd-weatherapp-sidecar |
322322
| selector | [string](#string) | | Optional: A selector for the flag configuration request. The server implementation may utilize this to select flag configurations from a collection, select the source of the flag or combine this to any desired underlying filtering mechanism. ex:- selector: &#39;source=database,app=weatherapp&#39; |
323323

324324

325325

326326

327327

328328

329-
<a name="sync-v1-FetchAllFlagsResponse"></a>
329+
<a name="flagd-sync-v1-FetchAllFlagsResponse"></a>
330330

331331
### FetchAllFlagsResponse
332332
FetchAllFlagsResponse is the server response containing feature flag configurations
@@ -341,10 +341,36 @@ FetchAllFlagsResponse is the server response containing feature flag configurati
341341

342342

343343

344-
<a name="sync-v1-SyncFlagsRequest"></a>
344+
<a name="flagd-sync-v1-GetMetadataRequest"></a>
345+
346+
### GetMetadataRequest
347+
GetMetadataRequest is the request for retrieving metadata from the sync service
348+
349+
350+
351+
352+
353+
354+
<a name="flagd-sync-v1-GetMetadataResponse"></a>
355+
356+
### GetMetadataResponse
357+
GetMetadataResponse contains metadata from the sync service
358+
359+
360+
| Field | Type | Label | Description |
361+
| ----- | ---- | ----- | ----------- |
362+
| metadata | [google.protobuf.Struct](#google-protobuf-Struct) | | |
363+
364+
365+
366+
367+
368+
369+
<a name="flagd-sync-v1-SyncFlagsRequest"></a>
345370

346371
### SyncFlagsRequest
347-
SyncFlagsRequest is the request initiating the sever-streaming rpc. Flagd sends this request, acting as the client
372+
SyncFlagsRequest is the request initiating the server-streaming rpc.
373+
Implementations of Flagd providers and Flagd itself send this request, acting as the client.
348374

349375

350376
| Field | Type | Label | Description |
@@ -357,7 +383,7 @@ SyncFlagsRequest is the request initiating the sever-streaming rpc. Flagd sends
357383

358384

359385

360-
<a name="sync-v1-SyncFlagsResponse"></a>
386+
<a name="flagd-sync-v1-SyncFlagsResponse"></a>
361387

362388
### SyncFlagsResponse
363389
SyncFlagsResponse is the server response containing feature flag configurations and the state
@@ -366,45 +392,28 @@ SyncFlagsResponse is the server response containing feature flag configurations
366392
| Field | Type | Label | Description |
367393
| ----- | ---- | ----- | ----------- |
368394
| flag_configuration | [string](#string) | | flagd feature flag configuration. Must be validated to schema - https://raw.githubusercontent.com/open-feature/schemas/main/json/flagd-definitions.json |
369-
| state | [SyncState](#sync-v1-SyncState) | | State conveying the operation to be performed by flagd. See the descriptions of SyncState for an explanation of supported values |
370395

371396

372397

373398

374399

375400

376401

377-
378-
<a name="sync-v1-SyncState"></a>
379-
380-
### SyncState
381-
SyncState conveys the state of the payload. These states are related to flagd isync.go type definitions but
382-
contains extras to optimize grpc use case. Refer - https://github.com/open-feature/flagd/blob/main/pkg/sync/isync.go
383-
384-
| Name | Number | Description |
385-
| ---- | ------ | ----------- |
386-
| SYNC_STATE_UNSPECIFIED | 0 | Value is ignored by the listening flagd |
387-
| SYNC_STATE_ALL | 1 | All the flags matching the request. This is the default response and other states can be ignored by the implementation. Flagd internally replaces all existing flags for this response state. |
388-
| SYNC_STATE_ADD | 2 | Convey an addition of a flag. Flagd internally handles this by combining new flags with existing ones |
389-
| SYNC_STATE_UPDATE | 3 | Convey an update of a flag. Flagd internally attempts to update if the updated flag already exist OR if it does not, it will get added |
390-
| SYNC_STATE_DELETE | 4 | Convey a deletion of a flag. Flagd internally removes the flag |
391-
| SYNC_STATE_PING | 5 | Optional server ping to check client connectivity. Handling is ignored by flagd and is to merely support live check |
392-
393-
394402

395403

396404

397405

398406

399-
<a name="sync-v1-FlagSyncService"></a>
407+
<a name="flagd-sync-v1-FlagSyncService"></a>
400408

401409
### FlagSyncService
402410
FlagService implements a server streaming to provide realtime flag configurations
403411

404412
| Method Name | Request Type | Response Type | Description |
405413
| ----------- | ------------ | ------------- | ------------|
406-
| SyncFlags | [SyncFlagsRequest](#sync-v1-SyncFlagsRequest) | [SyncFlagsResponse](#sync-v1-SyncFlagsResponse) stream | |
407-
| FetchAllFlags | [FetchAllFlagsRequest](#sync-v1-FetchAllFlagsRequest) | [FetchAllFlagsResponse](#sync-v1-FetchAllFlagsResponse) | |
414+
| SyncFlags | [SyncFlagsRequest](#flagd-sync-v1-SyncFlagsRequest) | [SyncFlagsResponse](#flagd-sync-v1-SyncFlagsResponse) stream | |
415+
| FetchAllFlags | [FetchAllFlagsRequest](#flagd-sync-v1-FetchAllFlagsRequest) | [FetchAllFlagsResponse](#flagd-sync-v1-FetchAllFlagsResponse) | |
416+
| GetMetadata | [GetMetadataRequest](#flagd-sync-v1-GetMetadataRequest) | [GetMetadataResponse](#flagd-sync-v1-GetMetadataResponse) | |
408417

409418

410419

schemas

0 commit comments

Comments
 (0)