Commit 9ec26ee
authored
Provide a way to view raw JSON content (line#1218)
Motivation:
Exposing raw content has two benefits:
- It makes it easier to compare the user's original data with the data
stored in Central Dogma.
- It simplifies supporting JSON5. When a JSON content is normalized via
`JsonNode` before, we lose information present only in the original,
such as JSON5 comments, which makes JSON5 support challenging.
In this PR, the content pushed by the user or mirrored by a scheduler is
stored in the Central Dogma repository in its original form and a new
feature is added to return the raw content when `viewRaw` option is
specified on files read or watch operations.
Modifications:
- Push side)
- Added the `rawContent()` method to `Change`.
- It stores the original value and is now part of the serialized output.
- Refactored `Change` implementations to handle `rawContent()` easily.
- Implemented a new serializer and deserializer for `Change` to
correctly handle the new `rawContent` field.
- If `rawContent` exits, `content` is excluded from the serialized
output.
- Migrated duplicate serializers and deserializers to use the new
implementations.
- `Command.push()` now returns `PushAsIsCommand` since normalization is
no longer necessary.
- `ExecutionContext` is added to provide additional information when
executing `Command`.
- Currently, it only indicates whether the `Command` is executed by a
replay.
- Refactor internal Git repository implementations to store the original
content.
- Read side)
- Added the `rawContent()` method to `Entry`.
- It stores the original content retrieved from Central Dogma Git
repository.
- Added `viewRaw` parameter to the `getFiles` REST API.
- When `viewRaw` is true, `EntryDto` includes the original content.
- `viewRaw` option is disabled by default in the client API for backward
compatibility.
- `viewRaw` option is always enabled in the web application so that
users can easily compare the content with the upstream data.
- Fixed front-end Typescript code to render the raw content in the
viewer and store the edited data as-is.
Result:
Central Dogma now support storing and retrieving the original JSON
content.1 parent 5c4287a commit 9ec26ee
69 files changed
Lines changed: 1882 additions & 638 deletions
File tree
- client
- java-armeria-legacy/src/main/java/com/linecorp/centraldogma/client/armeria/legacy
- java-armeria/src/main/java/com/linecorp/centraldogma/internal/client/armeria
- java/src
- main/java/com/linecorp/centraldogma
- client
- internal/client
- test/java/com/linecorp/centraldogma/internal/client
- common/src
- main/java/com/linecorp/centraldogma
- common
- internal/api/v1
- test/java/com/linecorp/centraldogma/common
- server-mirror-git/src
- main/java/com/linecorp/centraldogma/server/internal/mirror
- test/java/com/linecorp/centraldogma/server/internal/mirror
- server/src
- main/java/com/linecorp/centraldogma/server
- command
- internal
- api
- converter
- command
- replication
- storage/repository
- git
- thrift
- metadata
- storage/repository
- test/java/com/linecorp/centraldogma/server
- command
- internal
- api/sysadmin
- command
- replication
- storage/repository/git
- metadata
- webapp/src
- dogma
- common/components
- editor
- features
- api
- file
- pages/app/projects/[projectName]/repos/[repoName]/files/[revision]/[[...path]]
- xds/src/main/java/com/linecorp/centraldogma/xds
- internal
- k8s/v1
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 8 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
225 | | - | |
| 225 | + | |
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
| 229 | + | |
229 | 230 | | |
230 | 231 | | |
231 | 232 | | |
| |||
279 | 280 | | |
280 | 281 | | |
281 | 282 | | |
282 | | - | |
| 283 | + | |
| 284 | + | |
283 | 285 | | |
284 | 286 | | |
285 | 287 | | |
286 | 288 | | |
| 289 | + | |
287 | 290 | | |
288 | 291 | | |
289 | 292 | | |
| |||
484 | 487 | | |
485 | 488 | | |
486 | 489 | | |
487 | | - | |
| 490 | + | |
| 491 | + | |
488 | 492 | | |
489 | 493 | | |
490 | 494 | | |
491 | 495 | | |
492 | 496 | | |
| 497 | + | |
493 | 498 | | |
494 | 499 | | |
495 | 500 | | |
| |||
Lines changed: 77 additions & 52 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
47 | 50 | | |
48 | 51 | | |
| 52 | + | |
49 | 53 | | |
50 | 54 | | |
51 | 55 | | |
| |||
82 | 86 | | |
83 | 87 | | |
84 | 88 | | |
85 | | - | |
86 | 89 | | |
87 | 90 | | |
88 | 91 | | |
| |||
120 | 123 | | |
121 | 124 | | |
122 | 125 | | |
| 126 | + | |
| 127 | + | |
123 | 128 | | |
124 | 129 | | |
125 | 130 | | |
| |||
462 | 467 | | |
463 | 468 | | |
464 | 469 | | |
465 | | - | |
| 470 | + | |
466 | 471 | | |
467 | 472 | | |
468 | 473 | | |
| |||
472 | 477 | | |
473 | 478 | | |
474 | 479 | | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
475 | 483 | | |
476 | 484 | | |
477 | 485 | | |
478 | 486 | | |
479 | | - | |
| 487 | + | |
480 | 488 | | |
481 | 489 | | |
482 | 490 | | |
483 | 491 | | |
484 | 492 | | |
485 | 493 | | |
486 | | - | |
| 494 | + | |
| 495 | + | |
487 | 496 | | |
488 | 497 | | |
489 | | - | |
| 498 | + | |
490 | 499 | | |
491 | 500 | | |
492 | 501 | | |
493 | 502 | | |
494 | 503 | | |
495 | 504 | | |
496 | 505 | | |
497 | | - | |
| 506 | + | |
| 507 | + | |
498 | 508 | | |
499 | 509 | | |
500 | 510 | | |
| |||
506 | 516 | | |
507 | 517 | | |
508 | 518 | | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
509 | 522 | | |
510 | 523 | | |
511 | 524 | | |
512 | | - | |
| 525 | + | |
513 | 526 | | |
514 | 527 | | |
515 | 528 | | |
516 | 529 | | |
517 | 530 | | |
518 | 531 | | |
519 | | - | |
| 532 | + | |
| 533 | + | |
520 | 534 | | |
521 | 535 | | |
522 | 536 | | |
523 | 537 | | |
524 | 538 | | |
525 | | - | |
| 539 | + | |
526 | 540 | | |
527 | 541 | | |
528 | 542 | | |
529 | | - | |
| 543 | + | |
530 | 544 | | |
531 | 545 | | |
532 | 546 | | |
| |||
852 | 866 | | |
853 | 867 | | |
854 | 868 | | |
855 | | - | |
| 869 | + | |
| 870 | + | |
856 | 871 | | |
857 | 872 | | |
858 | 873 | | |
859 | 874 | | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
860 | 880 | | |
861 | 881 | | |
862 | 882 | | |
| |||
869 | 889 | | |
870 | 890 | | |
871 | 891 | | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
872 | 896 | | |
873 | 897 | | |
874 | | - | |
| 898 | + | |
875 | 899 | | |
876 | 900 | | |
877 | 901 | | |
878 | 902 | | |
879 | 903 | | |
880 | 904 | | |
881 | | - | |
| 905 | + | |
882 | 906 | | |
883 | 907 | | |
884 | 908 | | |
885 | 909 | | |
886 | | - | |
| 910 | + | |
887 | 911 | | |
888 | 912 | | |
889 | 913 | | |
| |||
1000 | 1024 | | |
1001 | 1025 | | |
1002 | 1026 | | |
1003 | | - | |
1004 | | - | |
1005 | | - | |
1006 | | - | |
1007 | | - | |
1008 | | - | |
1009 | | - | |
1010 | | - | |
1011 | | - | |
1012 | | - | |
1013 | | - | |
1014 | | - | |
1015 | | - | |
1016 | | - | |
| 1027 | + | |
1017 | 1028 | | |
1018 | 1029 | | |
1019 | 1030 | | |
| |||
1048 | 1059 | | |
1049 | 1060 | | |
1050 | 1061 | | |
1051 | | - | |
| 1062 | + | |
| 1063 | + | |
1052 | 1064 | | |
1053 | 1065 | | |
1054 | 1066 | | |
1055 | 1067 | | |
1056 | | - | |
| 1068 | + | |
1057 | 1069 | | |
1058 | 1070 | | |
1059 | 1071 | | |
1060 | 1072 | | |
1061 | 1073 | | |
1062 | 1074 | | |
1063 | | - | |
| 1075 | + | |
1064 | 1076 | | |
1065 | 1077 | | |
1066 | 1078 | | |
1067 | | - | |
| 1079 | + | |
1068 | 1080 | | |
1069 | | - | |
| 1081 | + | |
1070 | 1082 | | |
1071 | 1083 | | |
1072 | 1084 | | |
1073 | 1085 | | |
1074 | 1086 | | |
1075 | 1087 | | |
1076 | 1088 | | |
1077 | | - | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
1078 | 1100 | | |
1079 | 1101 | | |
1080 | 1102 | | |
| |||
1085 | 1107 | | |
1086 | 1108 | | |
1087 | 1109 | | |
1088 | | - | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
1089 | 1126 | | |
1090 | 1127 | | |
1091 | 1128 | | |
| |||
1104 | 1141 | | |
1105 | 1142 | | |
1106 | 1143 | | |
1107 | | - | |
1108 | | - | |
1109 | | - | |
1110 | | - | |
1111 | | - | |
1112 | | - | |
1113 | | - | |
1114 | | - | |
1115 | | - | |
1116 | | - | |
1117 | | - | |
1118 | | - | |
1119 | | - | |
1120 | | - | |
1121 | | - | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
1122 | 1149 | | |
1123 | | - | |
1124 | | - | |
1125 | 1150 | | |
1126 | 1151 | | |
1127 | 1152 | | |
| |||
Lines changed: 47 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
0 commit comments