Commit ef87d5d
authored
upstream(graphql): deduplicate configs and clap args, add flag to skip db compatibility (#9261)
# Description of change
Original descriptions:
> Avoid duplicating fields for configs that are accepted as flags from
the command-line and can also be read from TOML file. Use the same
struct for both purposes but deocrate it with both clap and serde (or
GraphQLConfig) annotations so that it can serve both purposes.
> Add a flag to optionally skip database migration compatibility checks.
This is helpful when trying to connect a local build up to a production
database to test a specific change, even if you are aware that other
queries may not be compatible.
To accommodate this change, the compatibility check was also moved into
`ServerBuilder` where the config is readily available. This also
slightly simplifies the `Server` itself, which no longer needs to hold
onto its own instance of the `Db`.
## Links to any relevant issues
fixes #9217
## How the change has been tested
Comparing `cargo run --bin iota-graphql-rpc -- start-server --help`
before and after the change.
- [x] Basic tests (linting, compilation, formatting, unit/integration
tests)
- [ ] Patch-specific tests (correctness, functionality coverage)
### Infrastructure QA (only required for crates that are maintained by
@iotaledger/infrastructure)
- [ ] Synchronization of the indexer from genesis for a network
including migration objects.
- [ ] Restart of indexer synchronization locally without resetting the
database.
- [ ] Restart of indexer synchronization on a production-like database.
- [x] Deployment of services using Docker. - Tested if graphql starts up
successfully with `pg-services-local`
- [ ] Verification of API backward compatibility.File tree
6 files changed
+67
-83
lines changed- crates
- iota-cluster-test/src
- iota-graphql-rpc/src
- server
- iota/src
6 files changed
+67
-83
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
| 278 | + | |
278 | 279 | | |
279 | 280 | | |
280 | 281 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| |||
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
45 | 31 | | |
46 | 32 | | |
47 | 33 | | |
48 | 34 | | |
49 | 35 | | |
50 | | - | |
51 | | - | |
52 | | - | |
| 36 | + | |
| 37 | + | |
53 | 38 | | |
54 | 39 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
| 38 | + | |
38 | 39 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
44 | 58 | | |
45 | 59 | | |
46 | 60 | | |
| |||
162 | 176 | | |
163 | 177 | | |
164 | 178 | | |
| 179 | + | |
165 | 180 | | |
| 181 | + | |
| 182 | + | |
166 | 183 | | |
167 | 184 | | |
168 | 185 | | |
| |||
189 | 206 | | |
190 | 207 | | |
191 | 208 | | |
192 | | - | |
| 209 | + | |
193 | 210 | | |
| 211 | + | |
| 212 | + | |
194 | 213 | | |
195 | 214 | | |
196 | 215 | | |
| |||
339 | 358 | | |
340 | 359 | | |
341 | 360 | | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | 361 | | |
349 | 362 | | |
350 | 363 | | |
351 | 364 | | |
352 | 365 | | |
353 | 366 | | |
354 | | - | |
| 367 | + | |
355 | 368 | | |
| 369 | + | |
356 | 370 | | |
357 | 371 | | |
358 | 372 | | |
359 | 373 | | |
360 | 374 | | |
361 | 375 | | |
362 | 376 | | |
363 | | - | |
| 377 | + | |
364 | 378 | | |
| 379 | + | |
| 380 | + | |
365 | 381 | | |
366 | 382 | | |
367 | 383 | | |
| |||
431 | 447 | | |
432 | 448 | | |
433 | 449 | | |
434 | | - | |
435 | | - | |
436 | | - | |
437 | | - | |
438 | | - | |
439 | | - | |
440 | | - | |
441 | | - | |
442 | 450 | | |
443 | 451 | | |
444 | 452 | | |
| |||
474 | 482 | | |
475 | 483 | | |
476 | 484 | | |
477 | | - | |
| 485 | + | |
478 | 486 | | |
| 487 | + | |
479 | 488 | | |
480 | 489 | | |
481 | 490 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
| 54 | + | |
| 55 | + | |
59 | 56 | | |
60 | | - | |
61 | | - | |
62 | | - | |
| 57 | + | |
63 | 58 | | |
64 | | - | |
65 | | - | |
66 | 59 | | |
67 | 60 | | |
68 | 61 | | |
| |||
74 | 67 | | |
75 | 68 | | |
76 | 69 | | |
77 | | - | |
78 | | - | |
| 70 | + | |
| 71 | + | |
79 | 72 | | |
80 | 73 | | |
81 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
98 | 97 | | |
99 | 98 | | |
100 | 99 | | |
| |||
104 | 103 | | |
105 | 104 | | |
106 | 105 | | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | 106 | | |
116 | 107 | | |
117 | 108 | | |
| |||
364 | 355 | | |
365 | 356 | | |
366 | 357 | | |
367 | | - | |
| 358 | + | |
368 | 359 | | |
369 | 360 | | |
370 | 361 | | |
| |||
391 | 382 | | |
392 | 383 | | |
393 | 384 | | |
394 | | - | |
395 | 385 | | |
396 | 386 | | |
397 | 387 | | |
| |||
405 | 395 | | |
406 | 396 | | |
407 | 397 | | |
408 | | - | |
| 398 | + | |
409 | 399 | | |
410 | 400 | | |
411 | 401 | | |
412 | 402 | | |
413 | 403 | | |
414 | | - | |
| 404 | + | |
415 | 405 | | |
416 | 406 | | |
417 | 407 | | |
| |||
450 | 440 | | |
451 | 441 | | |
452 | 442 | | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
453 | 451 | | |
454 | 452 | | |
455 | 453 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
906 | 906 | | |
907 | 907 | | |
908 | 908 | | |
909 | | - | |
910 | | - | |
911 | | - | |
912 | | - | |
913 | | - | |
914 | | - | |
915 | | - | |
916 | | - | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
917 | 915 | | |
918 | 916 | | |
919 | 917 | | |
| |||
0 commit comments