@nasebanal/cli 0.11.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
1
  openapi: 3.0.3
2
2
  info:
3
- title: NASEBANAL - Assurance API
4
- description: "Backend of NASEBANAL Assurance (quality assurance for APIs and web apps, under NASEBANAL Evolution). Authenticates users via Auth0 JWT and Personal Access Tokens (PAT) and integrates with the Account API. External monitoring: register URLs to be probed on an interval, then read availability reports. Test results: report the normalised result of each CI/CD job into a named project (typically one per repository), then read its runs and suites. Every response is wrapped as `{ success, data }` (or `{ success: false, error }`)."
5
- version: 1.9.0
3
+ title: NASEBANAL Assurance API
4
+ description: "Backend of NASEBANAL Assurance (quality assurance for APIs and web apps, under NASEBANAL Evolution). Authenticates users via Auth0 JWT and Personal Access Tokens (PAT) and integrates with the Account API. External monitoring: register URLs to be probed on an interval, then read availability reports. Test results: report the normalised result of each CI/CD job into a repository (the id nb-specs-api issues), then read its runs and suites. Assurance is a results store keyed by that id: the repository, and every setting of it (the public badge and report, the token of the public links, attachments, the API-version rule), belongs to nb-specs-api, which Assurance asks when a rule needs a setting. 2.0.0 (unreleased) replaced the project by the repository, moved the settings to nb-specs-api and removed the commercial Contracts feature (contracts, deliverables, documents, SLA clause). Every response is wrapped as `{ success, data }` (or `{ success: false, error }`)."
5
+ version: 2.0.0
6
6
  contact:
7
7
  name: NASEBANAL
8
8
  url: https://www.nasebanal.com
@@ -22,10 +22,8 @@ tags:
22
22
  description: "External monitoring: URLs probed on an interval"
23
23
  - name: Reports
24
24
  description: Availability reports built from daily rollups and incidents
25
- - name: Projects
26
- description: "Test results reported from CI/CD: named projects (typically one per repository), one run per pipeline run, one suite result per job"
27
- - name: Contracts
28
- description: "Outsourcing contracts: deliverables tied to projects, documents and the SLA clause"
25
+ - name: Specs
26
+ description: "Test results reported from CI/CD, per SPEC (the id nb-specs-api issues) and the repository that spec is tied to: one run per pipeline run, one suite result per job. The spec, its repository and the quality settings (public badge and report, attachments, API-version rule) belong to nb-specs-api; Assurance keeps the results, keyed by the spec id and the repository id (both are required: the platform is about APIs, so a spec with no repository cannot take a result or a monitor)."
29
27
  paths:
30
28
  /api/v1/health:
31
29
  get:
@@ -168,6 +166,8 @@ paths:
168
166
  application/json:
169
167
  schema:
170
168
  $ref: "#/components/schemas/Error"
169
+ "422":
170
+ $ref: "#/components/responses/PairRefused"
171
171
  parameters:
172
172
  - $ref: "#/components/parameters/ActiveOrganization"
173
173
  /api/v1/monitors/{id}:
@@ -244,6 +244,8 @@ paths:
244
244
  $ref: "#/components/responses/Forbidden"
245
245
  "404":
246
246
  $ref: "#/components/responses/NotFound"
247
+ "422":
248
+ $ref: "#/components/responses/PairRefused"
247
249
  parameters:
248
250
  - $ref: "#/components/parameters/ActiveOrganization"
249
251
  delete:
@@ -487,25 +489,18 @@ paths:
487
489
  $ref: "#/components/responses/Unauthorized"
488
490
  "403":
489
491
  $ref: "#/components/responses/Forbidden"
490
- /api/v1/projects:
492
+ /api/v1/specs:
491
493
  get:
492
494
  tags:
493
- - Projects
494
- operationId: listProjects
495
- summary: List projects
496
- description: Projects in the caller's namespace (personal, or the active organization), newest first, each with its latest run and that run's suites.
495
+ - Specs
496
+ operationId: listSpecs
497
+ summary: List specs
498
+ description: "The specs this namespace (personal, or the active organization) keeps results for, newest first, each with its latest run and that run's suites. A spec nobody has reported anything for is not here: nb-specs-api lists the specs themselves."
497
499
  parameters:
498
500
  - $ref: "#/components/parameters/ActiveOrganization"
499
- - name: name
500
- in: query
501
- required: false
502
- description: Return only the project with this name (exact match, ignoring case).
503
- schema:
504
- type: string
505
- maxLength: 100
506
501
  responses:
507
502
  "200":
508
- description: Projects
503
+ description: Specs
509
504
  content:
510
505
  application/json:
511
506
  schema:
@@ -527,112 +522,36 @@ paths:
527
522
  data:
528
523
  type: array
529
524
  items:
530
- $ref: "#/components/schemas/ProjectWithLatestRun"
525
+ $ref: "#/components/schemas/SpecWithLatestRun"
531
526
  total:
532
527
  type: integer
533
528
  limit:
534
529
  type: integer
535
- description: Maximum projects per namespace
536
- "400":
537
- $ref: "#/components/responses/ValidationError"
538
- "401":
539
- $ref: "#/components/responses/Unauthorized"
540
- "403":
541
- $ref: "#/components/responses/Forbidden"
542
- post:
543
- tags:
544
- - Projects
545
- operationId: createProject
546
- summary: Create a project
547
- description: One project tracks one repository's CI/CD quality record. `retention_days` is set from the caller's plan.
548
- parameters:
549
- - $ref: "#/components/parameters/ActiveOrganization"
550
- requestBody:
551
- required: true
552
- content:
553
- application/json:
554
- schema:
555
- $ref: "#/components/schemas/ProjectCreate"
556
- responses:
557
- "201":
558
- description: Project created
559
- content:
560
- application/json:
561
- schema:
562
- type: object
563
- required:
564
- - success
565
- - data
566
- properties:
567
- success:
568
- type: boolean
569
- example: true
570
- data:
571
- $ref: "#/components/schemas/Project"
530
+ description: Maximum specs per namespace
572
531
  "400":
573
532
  $ref: "#/components/responses/ValidationError"
574
533
  "401":
575
534
  $ref: "#/components/responses/Unauthorized"
576
535
  "403":
577
536
  $ref: "#/components/responses/Forbidden"
578
- "409":
579
- description: The per-namespace project limit is reached (`LIMIT_REACHED`), or a project with this name already exists in the namespace (`CONFLICT`)
580
- content:
581
- application/json:
582
- schema:
583
- $ref: "#/components/schemas/Error"
584
- /api/v1/projects/{id}:
537
+ /api/v1/specs/{id}:
585
538
  parameters:
586
539
  - name: id
587
540
  in: path
588
541
  required: true
589
- description: Project id
542
+ description: Spec id (issued by nb-specs-api)
590
543
  schema:
591
544
  type: string
592
545
  - $ref: "#/components/parameters/ActiveOrganization"
593
546
  get:
594
547
  tags:
595
- - Projects
596
- operationId: getProject
597
- summary: Get a project
598
- description: One project with its settings, including the retention window.
599
- responses:
600
- "200":
601
- description: Project
602
- content:
603
- application/json:
604
- schema:
605
- type: object
606
- required:
607
- - success
608
- - data
609
- properties:
610
- success:
611
- type: boolean
612
- example: true
613
- data:
614
- $ref: "#/components/schemas/Project"
615
- "401":
616
- $ref: "#/components/responses/Unauthorized"
617
- "403":
618
- $ref: "#/components/responses/Forbidden"
619
- "404":
620
- $ref: "#/components/responses/NotFound"
621
- patch:
622
- tags:
623
- - Projects
624
- operationId: updateProject
625
- summary: Update a project
626
- description: Rename a project and/or change its repository or description. Send only the fields to change; an empty `repo` clears it. `retention_days` follows the plan and is not editable.
627
- requestBody:
628
- required: true
629
- content:
630
- application/json:
631
- schema:
632
- $ref: "#/components/schemas/ProjectUpdate"
548
+ - Specs
549
+ operationId: getSpec
550
+ summary: Get what Assurance holds for a spec
551
+ description: "What Assurance holds for one spec id: the retention window and the timestamps. No setting is here: the public badge and report, attachments and the API-version rule are nb-specs-api's. The row is made by the first result or monitor that names the id."
633
552
  responses:
634
553
  "200":
635
- description: Project
554
+ description: Spec
636
555
  content:
637
556
  application/json:
638
557
  schema:
@@ -645,27 +564,19 @@ paths:
645
564
  type: boolean
646
565
  example: true
647
566
  data:
648
- $ref: "#/components/schemas/Project"
649
- "400":
650
- $ref: "#/components/responses/ValidationError"
567
+ $ref: "#/components/schemas/SpecResults"
651
568
  "401":
652
569
  $ref: "#/components/responses/Unauthorized"
653
570
  "403":
654
571
  $ref: "#/components/responses/Forbidden"
655
572
  "404":
656
573
  $ref: "#/components/responses/NotFound"
657
- "409":
658
- description: A project with this name already exists in the namespace (`CONFLICT`)
659
- content:
660
- application/json:
661
- schema:
662
- $ref: "#/components/schemas/Error"
663
574
  delete:
664
575
  tags:
665
- - Projects
666
- operationId: deleteProject
667
- summary: Delete a project
668
- description: Also deletes its runs and suite results.
576
+ - Specs
577
+ operationId: deleteSpec
578
+ summary: Delete a spec's results
579
+ description: Deletes the results Assurance holds for the spec (its runs and suite results). Monitors that pointed at it are kept, unlinked. The spec itself, and its settings (nb-specs-api), are not touched.
669
580
  responses:
670
581
  "200":
671
582
  description: Deleted
@@ -693,18 +604,18 @@ paths:
693
604
  $ref: "#/components/responses/Forbidden"
694
605
  "404":
695
606
  $ref: "#/components/responses/NotFound"
696
- /api/v1/projects/{id}/results:
607
+ /api/v1/specs/{id}/results:
697
608
  parameters:
698
609
  - name: id
699
610
  in: path
700
611
  required: true
701
- description: Project id
612
+ description: Spec id (issued by nb-specs-api)
702
613
  schema:
703
614
  type: string
704
615
  - $ref: "#/components/parameters/ActiveOrganization"
705
616
  post:
706
617
  tags:
707
- - Projects
618
+ - Specs
708
619
  operationId: reportResult
709
620
  summary: Report a test result
710
621
  description: Called once per CI job with the NORMALISED summary of one report (not the raw file). The run is found or created by `run.key`; the suite is upserted by (run, `suite.kind`, `suite.name`), so a retried job replaces its own result and another job of the same pipeline adds a suite to the same run. 201 when the suite is new, 200 when it replaced an earlier report.
@@ -754,19 +665,19 @@ paths:
754
665
  "404":
755
666
  $ref: "#/components/responses/NotFound"
756
667
  "422":
757
- $ref: "#/components/responses/ApiVersionRequired"
758
- /api/v1/projects/{id}/runs:
668
+ $ref: "#/components/responses/UnprocessableResult"
669
+ /api/v1/specs/{id}/runs:
759
670
  parameters:
760
671
  - name: id
761
672
  in: path
762
673
  required: true
763
- description: Project id
674
+ description: Spec id (issued by nb-specs-api)
764
675
  schema:
765
676
  type: string
766
677
  - $ref: "#/components/parameters/ActiveOrganization"
767
678
  get:
768
679
  tags:
769
- - Projects
680
+ - Specs
770
681
  operationId: listRuns
771
682
  summary: List runs
772
683
  description: Newest first, each with its suite results.
@@ -813,12 +724,12 @@ paths:
813
724
  $ref: "#/components/responses/Forbidden"
814
725
  "404":
815
726
  $ref: "#/components/responses/NotFound"
816
- /api/v1/projects/{id}/runs/{runId}:
727
+ /api/v1/specs/{id}/runs/{runId}:
817
728
  parameters:
818
729
  - name: id
819
730
  in: path
820
731
  required: true
821
- description: Project id
732
+ description: Spec id (issued by nb-specs-api)
822
733
  schema:
823
734
  type: string
824
735
  - name: runId
@@ -830,7 +741,7 @@ paths:
830
741
  - $ref: "#/components/parameters/ActiveOrganization"
831
742
  get:
832
743
  tags:
833
- - Projects
744
+ - Specs
834
745
  operationId: getRun
835
746
  summary: Get a run
836
747
  description: One run with all of its suite results.
@@ -856,12 +767,12 @@ paths:
856
767
  $ref: "#/components/responses/Forbidden"
857
768
  "404":
858
769
  $ref: "#/components/responses/NotFound"
859
- /api/v1/projects/{id}/runs/{runId}/suites/{suiteId}/cases:
770
+ /api/v1/specs/{id}/runs/{runId}/suites/{suiteId}/cases:
860
771
  parameters:
861
772
  - name: id
862
773
  in: path
863
774
  required: true
864
- description: Project id
775
+ description: Spec id (issued by nb-specs-api)
865
776
  schema:
866
777
  type: string
867
778
  - name: runId
@@ -879,7 +790,7 @@ paths:
879
790
  - $ref: "#/components/parameters/ActiveOrganization"
880
791
  get:
881
792
  tags:
882
- - Projects
793
+ - Specs
883
794
  operationId: getSuiteCases
884
795
  summary: Get the test cases of a suite
885
796
  description: The per-test cases the reporter sent with the suite result (name, outcome, duration, failure message). 404 when the suite has none.
@@ -905,12 +816,12 @@ paths:
905
816
  $ref: "#/components/responses/Forbidden"
906
817
  "404":
907
818
  $ref: "#/components/responses/NotFound"
908
- /api/v1/projects/{id}/runs/{runId}/suites/{suiteId}/attachment:
819
+ /api/v1/specs/{id}/runs/{runId}/suites/{suiteId}/attachment:
909
820
  parameters:
910
821
  - name: id
911
822
  in: path
912
823
  required: true
913
- description: Project id
824
+ description: Spec id (issued by nb-specs-api)
914
825
  schema:
915
826
  type: string
916
827
  - name: runId
@@ -928,10 +839,10 @@ paths:
928
839
  - $ref: "#/components/parameters/ActiveOrganization"
929
840
  put:
930
841
  tags:
931
- - Projects
842
+ - Specs
932
843
  operationId: putSuiteAttachment
933
844
  summary: Attach the original report to a result
934
- description: "Keeps the tool's own report (a file, or a folder as a zip) with the result: the body is the file as it is, `name` is the file name it is downloaded under. One per result; sending again replaces it (so does reporting the result again). Refused with 403 `ATTACHMENTS_DISABLED` until the project turns `attachments_enabled` on. Up to 20 MiB each and 200 MiB per project. The server only stores it: it is not opened, unzipped or shown."
845
+ description: "Keeps the tool's own report (a file, or a folder as a zip) with the result: the body is the file as it is, `name` is the file name it is downloaded under. One per result; sending again replaces it (so does reporting the result again). Refused with 403 `ATTACHMENTS_DISABLED` until the spec turns `attachments_enabled` on. Up to 20 MiB each and 200 MiB per spec. The server only stores it: it is not opened, unzipped or shown."
935
846
  parameters:
936
847
  - name: name
937
848
  in: query
@@ -977,14 +888,14 @@ paths:
977
888
  "404":
978
889
  $ref: "#/components/responses/NotFound"
979
890
  "409":
980
- description: The project already holds 200 MiB of attached reports
891
+ description: The spec already holds 200 MiB of attached reports
981
892
  "413":
982
893
  description: Larger than 20 MiB
983
894
  "503":
984
895
  description: Report storage is not configured
985
896
  get:
986
897
  tags:
987
- - Projects
898
+ - Specs
988
899
  operationId: getSuiteAttachment
989
900
  summary: Download the original report of a result
990
901
  description: "The bytes that were attached, always as a download (`Content-Disposition: attachment`, `application/octet-stream`, `nosniff`). 404 when nothing is attached."
@@ -1004,7 +915,7 @@ paths:
1004
915
  $ref: "#/components/responses/NotFound"
1005
916
  delete:
1006
917
  tags:
1007
- - Projects
918
+ - Specs
1008
919
  operationId: deleteSuiteAttachment
1009
920
  summary: Remove the attached report of a result
1010
921
  description: Drops the attached report; the result stays. 404 when nothing is attached.
@@ -1036,12 +947,12 @@ paths:
1036
947
  $ref: "#/components/responses/Forbidden"
1037
948
  "404":
1038
949
  $ref: "#/components/responses/NotFound"
1039
- /api/v1/projects/{id}/runs/{runId}/suites/{suiteId}:
950
+ /api/v1/specs/{id}/runs/{runId}/suites/{suiteId}:
1040
951
  parameters:
1041
952
  - name: id
1042
953
  in: path
1043
954
  required: true
1044
- description: Project id
955
+ description: Spec id (issued by nb-specs-api)
1045
956
  schema:
1046
957
  type: string
1047
958
  - name: runId
@@ -1059,10 +970,10 @@ paths:
1059
970
  - $ref: "#/components/parameters/ActiveOrganization"
1060
971
  patch:
1061
972
  tags:
1062
- - Projects
973
+ - Specs
1063
974
  operationId: updateSuite
1064
975
  summary: Correct a stored test result
1065
- description: "Edit what a person may correct by hand: the outcome, the counts, the duration, the coverage, the name, the API version and the run's branch / commit / CI link. Kind and tool identify the result and cannot change; the name and the API version can, as long as the run does not already have a result with the same kind, name and version; metrics, failures and cases come from the report itself. A key that is present replaces the value (`null` clears it); an absent key is left alone. Answers the whole run."
976
+ description: "Edit what a person may correct by hand: the outcome, the counts, the duration, the coverage, the label and the run's branch / commit / CI link. Kind and tool identify the result and cannot change; the label can, as long as the run does not already have a result with the same kind and label; metrics, failures and cases come from the report itself. A key that is present replaces the value (`null` clears it); an absent key is left alone. Answers the whole run."
1066
977
  requestBody:
1067
978
  required: true
1068
979
  content:
@@ -1094,16 +1005,14 @@ paths:
1094
1005
  "404":
1095
1006
  $ref: "#/components/responses/NotFound"
1096
1007
  "409":
1097
- description: Changing the name or the API version would give the result the same kind, name and version as another result of the run (`CONFLICT`)
1008
+ description: Changing the label would give the result the same kind and label as another result of the run (`CONFLICT`)
1098
1009
  content:
1099
1010
  application/json:
1100
1011
  schema:
1101
1012
  $ref: "#/components/schemas/Error"
1102
- "422":
1103
- $ref: "#/components/responses/ApiVersionRequired"
1104
1013
  delete:
1105
1014
  tags:
1106
- - Projects
1015
+ - Specs
1107
1016
  operationId: deleteSuite
1108
1017
  summary: Delete a stored test result
1109
1018
  description: Deletes one suite result and its stored cases. A run left with no suite is deleted too (`run_deleted`).
@@ -1136,21 +1045,21 @@ paths:
1136
1045
  $ref: "#/components/responses/Forbidden"
1137
1046
  "404":
1138
1047
  $ref: "#/components/responses/NotFound"
1139
- /api/v1/projects/{id}/quality:
1048
+ /api/v1/specs/{id}/quality:
1140
1049
  parameters:
1141
1050
  - name: id
1142
1051
  in: path
1143
1052
  required: true
1144
- description: Project id
1053
+ description: Spec id (issued by nb-specs-api)
1145
1054
  schema:
1146
1055
  type: string
1147
1056
  - $ref: "#/components/parameters/ActiveOrganization"
1148
1057
  get:
1149
1058
  tags:
1150
- - Projects
1151
- operationId: getProjectQuality
1152
- summary: Get a project's quality summary
1153
- description: "The quality summary of one of your projects, computed now, whether or not it is public: one verdict per perspective (unit, E2E, contract, security, performance, availability) and the numbers behind them. There is no weighted total. This is what the report page shows its owner."
1059
+ - Specs
1060
+ operationId: getSpecQuality
1061
+ summary: Get a spec's quality summary
1062
+ description: "The quality summary of one of your specs, computed now, whether or not it is public: one verdict per perspective (unit, E2E, contract, security, performance, availability) and the numbers behind them. There is no weighted total. This is what the report page shows its owner."
1154
1063
  responses:
1155
1064
  "200":
1156
1065
  description: Quality summary
@@ -1176,20 +1085,20 @@ paths:
1176
1085
  $ref: "#/components/responses/Unauthorized"
1177
1086
  "404":
1178
1087
  $ref: "#/components/responses/NotFound"
1179
- /api/v1/public/projects/{publicId}/summary:
1088
+ /api/v1/public/specs/{publicId}/summary:
1180
1089
  parameters:
1181
1090
  - name: publicId
1182
1091
  in: path
1183
1092
  required: true
1184
- description: The public token of a project (the `public_id` it got when its owner made it public)
1093
+ description: The public token of a spec (the `quality_public_id` it got when its owner made it public)
1185
1094
  schema:
1186
1095
  type: string
1187
1096
  get:
1188
1097
  tags:
1189
- - Projects
1098
+ - Specs
1190
1099
  operationId: getPublicQualitySummary
1191
1100
  summary: Public quality summary
1192
- description: "The quality summary of a project whose report is PUBLIC (`report_access: public`), readable without authentication (Kong Dev Portal and other pages build their own display from it). Aggregate verdicts and numbers only: never a test name, a failure message or a commit. Any other project and a token nobody has both answer 404, so a private project cannot be told from no project. Cached for 5 minutes."
1101
+ description: "The quality summary of a spec whose report is PUBLIC (`report_access: public`), readable without authentication (Kong Dev Portal and other pages build their own display from it). Aggregate verdicts and numbers only: never a test name, a failure message or a commit. Any other spec and a token nobody has both answer 404, so a private spec cannot be told from no spec. Cached for 5 minutes."
1193
1102
  security: []
1194
1103
  responses:
1195
1104
  "200":
@@ -1214,17 +1123,19 @@ paths:
1214
1123
  $ref: "#/components/schemas/QualityView"
1215
1124
  "404":
1216
1125
  $ref: "#/components/responses/NotFound"
1217
- /api/v1/shared/projects/{publicId}/summary:
1126
+ "503":
1127
+ $ref: "#/components/responses/ServiceUnavailable"
1128
+ /api/v1/shared/specs/{publicId}/summary:
1218
1129
  parameters:
1219
1130
  - name: publicId
1220
1131
  in: path
1221
1132
  required: true
1222
- description: The public token of a project (public_id)
1133
+ description: The public token of a spec (quality_public_id)
1223
1134
  schema:
1224
1135
  type: string
1225
1136
  get:
1226
1137
  tags:
1227
- - Projects
1138
+ - Specs
1228
1139
  operationId: getSharedQualitySummary
1229
1140
  summary: Report summary for a signed-in visitor
1230
1141
  description: "The quality summary for a visitor who is SIGNED IN: any NASEBANAL account with the link may read it when the report is `login` or `public`. `hidden` and an unknown token answer 404 whoever asks (the report page uses this after a login; without credentials it is a 401)."
@@ -1248,17 +1159,19 @@ paths:
1248
1159
  $ref: "#/components/responses/Unauthorized"
1249
1160
  "404":
1250
1161
  $ref: "#/components/responses/NotFound"
1251
- /api/v1/public/projects/{publicId}/badge:
1162
+ "503":
1163
+ $ref: "#/components/responses/ServiceUnavailable"
1164
+ /api/v1/public/specs/{publicId}/badge:
1252
1165
  parameters:
1253
1166
  - name: publicId
1254
1167
  in: path
1255
1168
  required: true
1256
- description: The public token of a project (the `public_id` it got when its owner made it public)
1169
+ description: The public token of a spec (the `quality_public_id` it got when its owner made it public)
1257
1170
  schema:
1258
1171
  type: string
1259
1172
  get:
1260
1173
  tags:
1261
- - Projects
1174
+ - Specs
1262
1175
  operationId: getPublicQualityBadge
1263
1176
  summary: Public quality badge (shields.io endpoint JSON)
1264
1177
  description: "The JSON a shields.io endpoint badge reads (`https://img.shields.io/endpoint?url=...`), for READMEs on GitHub and GitLab. The message is how many perspectives pass out of all of them (`5/6`); the colour is red when one fails, green when all pass, yellow when some are not measured yet, light grey when nothing is. 404 when the badge is not public (`public_badge`) or the token is unknown (the two are not told apart): through shields.io that shows shields.io's own error badge, so use the SVG endpoint where nothing at all should show. `?label=` sets the left text (30 characters at most)."
@@ -1283,17 +1196,19 @@ paths:
1283
1196
  application/json:
1284
1197
  schema:
1285
1198
  $ref: "#/components/schemas/ShieldsBadge"
1286
- /api/v1/public/projects/{publicId}/badge.svg:
1199
+ "503":
1200
+ $ref: "#/components/responses/ServiceUnavailable"
1201
+ /api/v1/public/specs/{publicId}/badge.svg:
1287
1202
  parameters:
1288
1203
  - name: publicId
1289
1204
  in: path
1290
1205
  required: true
1291
- description: The public token of a project (the `public_id` it got when its owner made it public)
1206
+ description: The public token of a spec (the `quality_public_id` it got when its owner made it public)
1292
1207
  schema:
1293
1208
  type: string
1294
1209
  get:
1295
1210
  tags:
1296
- - Projects
1211
+ - Specs
1297
1212
  operationId: getPublicQualityBadgeSvg
1298
1213
  summary: Public quality badge (SVG)
1299
1214
  description: The badge itself, in shields.io flat style, to use as an image in a README, a page or Kong Dev Portal without going through shields.io. Same content and colours as the JSON badge. When the badge is not public (or the token is unknown) it answers 200 with an empty image of zero size, so a README shows no badge and no broken-image icon.
@@ -1317,60 +1232,25 @@ paths:
1317
1232
  image/svg+xml:
1318
1233
  schema:
1319
1234
  type: string
1320
- /api/v1/projects/{id}/components:
1235
+ "503":
1236
+ $ref: "#/components/responses/ServiceUnavailable"
1237
+ /api/v1/public/specs/{publicId}/report:
1321
1238
  parameters:
1322
- - name: id
1239
+ - name: publicId
1323
1240
  in: path
1324
1241
  required: true
1325
- description: Project id
1326
1242
  schema:
1327
1243
  type: string
1328
- - $ref: "#/components/parameters/ActiveOrganization"
1244
+ description: The public token of a spec (quality_public_id)
1329
1245
  get:
1330
1246
  tags:
1331
- - Projects
1332
- operationId: listComponents
1333
- summary: List components
1334
- description: "The components of a project: what its results are reported under (the front end, the back end, a service of a monorepo), each with the number of results it holds. A component exists before it has a result."
1247
+ - Specs
1248
+ operationId: getPublicQualityReport
1249
+ summary: Dashboard report of a public spec
1250
+ description: "The dashboard data of a spec whose report is PUBLIC (`report_access: public`), readable without authentication: the same runs and monitoring the owner's Charts screen draws, with everything that identifies something removed (no commit, branch, CI URL, test name, failure text or monitored URL). Any other spec and an unknown token answer 404. Cached for 10 minutes."
1335
1251
  responses:
1336
1252
  "200":
1337
- description: Components
1338
- content:
1339
- application/json:
1340
- schema:
1341
- type: object
1342
- required:
1343
- - success
1344
- - data
1345
- properties:
1346
- success:
1347
- type: boolean
1348
- example: true
1349
- data:
1350
- type: array
1351
- items:
1352
- $ref: "#/components/schemas/Component"
1353
- "401":
1354
- $ref: "#/components/responses/Unauthorized"
1355
- "403":
1356
- $ref: "#/components/responses/Forbidden"
1357
- "404":
1358
- $ref: "#/components/responses/NotFound"
1359
- post:
1360
- tags:
1361
- - Projects
1362
- operationId: createComponent
1363
- summary: Add a component
1364
- description: Registers a component of a project ahead of its first result. Reporting a result under a new name creates the component by itself, so this is only needed to prepare one. The name is unique in the project (case-insensitive).
1365
- requestBody:
1366
- required: true
1367
- content:
1368
- application/json:
1369
- schema:
1370
- $ref: "#/components/schemas/ComponentWrite"
1371
- responses:
1372
- "201":
1373
- description: Created
1253
+ description: Dashboard report
1374
1254
  content:
1375
1255
  application/json:
1376
1256
  schema:
@@ -1383,87 +1263,28 @@ paths:
1383
1263
  type: boolean
1384
1264
  example: true
1385
1265
  data:
1386
- $ref: "#/components/schemas/Component"
1387
- "400":
1388
- $ref: "#/components/responses/ValidationError"
1389
- "401":
1390
- $ref: "#/components/responses/Unauthorized"
1391
- "403":
1392
- $ref: "#/components/responses/Forbidden"
1266
+ $ref: "#/components/schemas/QualityReport"
1393
1267
  "404":
1394
1268
  $ref: "#/components/responses/NotFound"
1395
- "409":
1396
- description: A component with this name already exists in the project (`CONFLICT`)
1397
- content:
1398
- application/json:
1399
- schema:
1400
- $ref: "#/components/schemas/Error"
1401
- /api/v1/projects/{id}/components/{componentId}:
1269
+ "503":
1270
+ $ref: "#/components/responses/ServiceUnavailable"
1271
+ /api/v1/shared/specs/{publicId}/report:
1402
1272
  parameters:
1403
- - name: id
1404
- in: path
1405
- required: true
1406
- description: Project id
1407
- schema:
1408
- type: string
1409
- - $ref: "#/components/parameters/ActiveOrganization"
1410
- - name: componentId
1273
+ - name: publicId
1411
1274
  in: path
1412
1275
  required: true
1413
- description: Component id
1414
1276
  schema:
1415
1277
  type: string
1416
- patch:
1417
- tags:
1418
- - Projects
1419
- operationId: updateComponent
1420
- summary: Rename a component
1421
- description: Renames a component; its results follow, since they refer to it by id. A name another component of the project already has is refused (409).
1422
- requestBody:
1423
- required: true
1424
- content:
1425
- application/json:
1426
- schema:
1427
- $ref: "#/components/schemas/ComponentWrite"
1428
- responses:
1429
- "200":
1430
- description: Component
1431
- content:
1432
- application/json:
1433
- schema:
1434
- type: object
1435
- required:
1436
- - success
1437
- - data
1438
- properties:
1439
- success:
1440
- type: boolean
1441
- example: true
1442
- data:
1443
- $ref: "#/components/schemas/Component"
1444
- "400":
1445
- $ref: "#/components/responses/ValidationError"
1446
- "401":
1447
- $ref: "#/components/responses/Unauthorized"
1448
- "403":
1449
- $ref: "#/components/responses/Forbidden"
1450
- "404":
1451
- $ref: "#/components/responses/NotFound"
1452
- "409":
1453
- description: Another component of the project already has this name (`CONFLICT`)
1454
- content:
1455
- application/json:
1456
- schema:
1457
- $ref: "#/components/schemas/Error"
1458
- delete:
1278
+ description: The public token of a spec (quality_public_id)
1279
+ get:
1459
1280
  tags:
1460
- - Projects
1461
- operationId: deleteComponent
1462
- summary: Delete a component
1463
- description: "Removes the component from every result it belongs to. A result that belongs to no other component is **deleted** (with its stored cases) and so is a run left empty; a result that also belongs to other components stays. Refused (409, nothing deleted) when taking the component off would make a result identical to another one of the same run, kind and version. This cannot be undone; ask the person first. Monitors tied to the component are never deleted: they stay, no longer tied to it."
1281
+ - Specs
1282
+ operationId: getSharedQualityReport
1283
+ summary: Dashboard report for a signed-in visitor
1284
+ description: The same dashboard data for a SIGNED-IN visitor when `report_access` is `login` or `public`. `hidden` and an unknown token answer 404; without credentials it is a 401.
1464
1285
  responses:
1465
1286
  "200":
1466
- description: Deleted
1287
+ description: Dashboard report
1467
1288
  content:
1468
1289
  application/json:
1469
1290
  schema:
@@ -1476,366 +1297,29 @@ paths:
1476
1297
  type: boolean
1477
1298
  example: true
1478
1299
  data:
1479
- type: object
1480
- properties:
1481
- id:
1482
- type: string
1483
- deleted:
1484
- type: boolean
1485
- results_deleted:
1486
- type: integer
1487
- results_detached:
1488
- type: integer
1489
- description: Results that also belong to other components, which stay (only this component is taken off them)
1490
- monitors_detached:
1491
- type: integer
1492
- description: Monitors that were tied to it. They stay, untied.
1493
- runs_deleted:
1494
- type: integer
1300
+ $ref: "#/components/schemas/QualityReport"
1495
1301
  "401":
1496
1302
  $ref: "#/components/responses/Unauthorized"
1497
- "403":
1498
- $ref: "#/components/responses/Forbidden"
1499
1303
  "404":
1500
1304
  $ref: "#/components/responses/NotFound"
1501
- "409":
1502
- description: Taking the component off a result would make it identical to another result of the run (`CONFLICT`)
1503
- content:
1504
- application/json:
1505
- schema:
1506
- $ref: "#/components/schemas/Error"
1507
- /api/v1/projects/{id}/components/{componentId}/merge:
1508
- parameters:
1509
- - name: id
1510
- in: path
1511
- required: true
1512
- description: Project id
1513
- schema:
1305
+ "503":
1306
+ $ref: "#/components/responses/ServiceUnavailable"
1307
+ components:
1308
+ securitySchemes:
1309
+ BearerAuth:
1310
+ type: http
1311
+ scheme: bearer
1312
+ bearerFormat: JWT or PAT
1313
+ description: Use either an Auth0 JWT token or a Personal Access Token (PAT) starting with `nbpat_`.
1314
+ schemas:
1315
+ User:
1316
+ type: object
1317
+ properties:
1318
+ id:
1319
+ type: integer
1320
+ auth0_sub:
1514
1321
  type: string
1515
- - name: componentId
1516
- in: path
1517
- required: true
1518
- description: Id of the component that is merged away
1519
- schema:
1520
- type: string
1521
- - $ref: "#/components/parameters/ActiveOrganization"
1522
- post:
1523
- tags:
1524
- - Projects
1525
- operationId: mergeComponent
1526
- summary: Merge a component into another
1527
- description: Replaces the component by another one of the same project in every result it belongs to, then deletes it. Refused (409, nothing moved) when a result would then be identical to another one of the same run, kind and version. This cannot be undone; ask the person first. Monitors tied to the component are tied to the other one instead.
1528
- requestBody:
1529
- required: true
1530
- content:
1531
- application/json:
1532
- schema:
1533
- $ref: "#/components/schemas/ComponentMerge"
1534
- responses:
1535
- "200":
1536
- description: Merged
1537
- content:
1538
- application/json:
1539
- schema:
1540
- type: object
1541
- required:
1542
- - success
1543
- - data
1544
- properties:
1545
- success:
1546
- type: boolean
1547
- example: true
1548
- data:
1549
- type: object
1550
- properties:
1551
- id:
1552
- type: string
1553
- description: The receiving component
1554
- merged_id:
1555
- type: string
1556
- description: The component that was merged away and deleted
1557
- results_moved:
1558
- type: integer
1559
- "400":
1560
- $ref: "#/components/responses/ValidationError"
1561
- "401":
1562
- $ref: "#/components/responses/Unauthorized"
1563
- "403":
1564
- $ref: "#/components/responses/Forbidden"
1565
- "404":
1566
- $ref: "#/components/responses/NotFound"
1567
- "409":
1568
- description: A result would become identical to another one of the same run, kind and API version (`CONFLICT`)
1569
- content:
1570
- application/json:
1571
- schema:
1572
- $ref: "#/components/schemas/Error"
1573
- /api/v1/contracts:
1574
- parameters:
1575
- - $ref: "#/components/parameters/ActiveOrganization"
1576
- get:
1577
- tags:
1578
- - Contracts
1579
- operationId: listContracts
1580
- summary: List contracts
1581
- description: The outsourcing contracts of the active namespace, each with its deliverables, documents and SLA clause.
1582
- responses:
1583
- "200":
1584
- description: Contracts
1585
- content:
1586
- application/json:
1587
- schema:
1588
- type: object
1589
- required:
1590
- - success
1591
- - data
1592
- properties:
1593
- success:
1594
- type: boolean
1595
- example: true
1596
- data:
1597
- type: object
1598
- properties:
1599
- data:
1600
- type: array
1601
- items:
1602
- $ref: "#/components/schemas/Contract"
1603
- total:
1604
- type: integer
1605
- "401":
1606
- $ref: "#/components/responses/Unauthorized"
1607
- "403":
1608
- $ref: "#/components/responses/Forbidden"
1609
- post:
1610
- tags:
1611
- - Contracts
1612
- operationId: createContract
1613
- summary: Create a contract
1614
- description: Create a contract with its deliverables, documents and optional SLA clause in the active namespace. Projects and the related contract must belong to the same namespace.
1615
- requestBody:
1616
- required: true
1617
- content:
1618
- application/json:
1619
- schema:
1620
- $ref: "#/components/schemas/ContractInput"
1621
- responses:
1622
- "201":
1623
- description: Contract created
1624
- content:
1625
- application/json:
1626
- schema:
1627
- type: object
1628
- required:
1629
- - success
1630
- - data
1631
- properties:
1632
- success:
1633
- type: boolean
1634
- example: true
1635
- data:
1636
- $ref: "#/components/schemas/Contract"
1637
- "400":
1638
- $ref: "#/components/responses/ValidationError"
1639
- "401":
1640
- $ref: "#/components/responses/Unauthorized"
1641
- "403":
1642
- $ref: "#/components/responses/Forbidden"
1643
- "404":
1644
- $ref: "#/components/responses/NotFound"
1645
- "409":
1646
- description: The per-namespace contract limit is reached (`LIMIT_REACHED`)
1647
- content:
1648
- application/json:
1649
- schema:
1650
- $ref: "#/components/schemas/Error"
1651
- /api/v1/contracts/{id}:
1652
- parameters:
1653
- - name: id
1654
- in: path
1655
- required: true
1656
- description: Contract id
1657
- schema:
1658
- type: string
1659
- - $ref: "#/components/parameters/ActiveOrganization"
1660
- get:
1661
- tags:
1662
- - Contracts
1663
- operationId: getContract
1664
- summary: Get a contract
1665
- description: One contract. A contract outside the active namespace is reported as not found.
1666
- responses:
1667
- "200":
1668
- description: Contract
1669
- content:
1670
- application/json:
1671
- schema:
1672
- type: object
1673
- required:
1674
- - success
1675
- - data
1676
- properties:
1677
- success:
1678
- type: boolean
1679
- example: true
1680
- data:
1681
- $ref: "#/components/schemas/Contract"
1682
- "401":
1683
- $ref: "#/components/responses/Unauthorized"
1684
- "403":
1685
- $ref: "#/components/responses/Forbidden"
1686
- "404":
1687
- $ref: "#/components/responses/NotFound"
1688
- put:
1689
- tags:
1690
- - Contracts
1691
- operationId: updateContract
1692
- summary: Replace a contract
1693
- description: Replaces the whole contract, deliverables and documents included (the body is the full document, not a patch). A deliverable keeps its id, and so its record, only when its `id` from an earlier read is sent back; any other id is ignored and a new one issued.
1694
- requestBody:
1695
- required: true
1696
- content:
1697
- application/json:
1698
- schema:
1699
- $ref: "#/components/schemas/ContractInput"
1700
- responses:
1701
- "200":
1702
- description: Contract
1703
- content:
1704
- application/json:
1705
- schema:
1706
- type: object
1707
- required:
1708
- - success
1709
- - data
1710
- properties:
1711
- success:
1712
- type: boolean
1713
- example: true
1714
- data:
1715
- $ref: "#/components/schemas/Contract"
1716
- "400":
1717
- $ref: "#/components/responses/ValidationError"
1718
- "401":
1719
- $ref: "#/components/responses/Unauthorized"
1720
- "403":
1721
- $ref: "#/components/responses/Forbidden"
1722
- "404":
1723
- $ref: "#/components/responses/NotFound"
1724
- delete:
1725
- tags:
1726
- - Contracts
1727
- operationId: deleteContract
1728
- summary: Delete a contract
1729
- description: Also deletes its deliverables and documents. Contracts that pointed at it keep existing, unlinked.
1730
- responses:
1731
- "200":
1732
- description: Deleted
1733
- content:
1734
- application/json:
1735
- schema:
1736
- type: object
1737
- required:
1738
- - success
1739
- - data
1740
- properties:
1741
- success:
1742
- type: boolean
1743
- example: true
1744
- data:
1745
- type: object
1746
- properties:
1747
- id:
1748
- type: string
1749
- deleted:
1750
- type: boolean
1751
- "401":
1752
- $ref: "#/components/responses/Unauthorized"
1753
- "403":
1754
- $ref: "#/components/responses/Forbidden"
1755
- "404":
1756
- $ref: "#/components/responses/NotFound"
1757
- /api/v1/public/projects/{publicId}/report:
1758
- parameters:
1759
- - name: publicId
1760
- in: path
1761
- required: true
1762
- schema:
1763
- type: string
1764
- description: The public token of a project (public_id)
1765
- get:
1766
- tags:
1767
- - Projects
1768
- operationId: getPublicQualityReport
1769
- summary: Dashboard report of a public project
1770
- description: "The dashboard data of a project whose report is PUBLIC (`report_access: public`), readable without authentication: the same runs and monitoring the owner's Charts screen draws, with everything that identifies something removed (no commit, branch, CI URL, test name, failure text or monitored URL). Any other project and an unknown token answer 404. Cached for 10 minutes."
1771
- responses:
1772
- "200":
1773
- description: Dashboard report
1774
- content:
1775
- application/json:
1776
- schema:
1777
- type: object
1778
- required:
1779
- - success
1780
- - data
1781
- properties:
1782
- success:
1783
- type: boolean
1784
- example: true
1785
- data:
1786
- $ref: "#/components/schemas/QualityReport"
1787
- "404":
1788
- $ref: "#/components/responses/NotFound"
1789
- /api/v1/shared/projects/{publicId}/report:
1790
- parameters:
1791
- - name: publicId
1792
- in: path
1793
- required: true
1794
- schema:
1795
- type: string
1796
- description: The public token of a project (public_id)
1797
- get:
1798
- tags:
1799
- - Projects
1800
- operationId: getSharedQualityReport
1801
- summary: Dashboard report for a signed-in visitor
1802
- description: The same dashboard data for a SIGNED-IN visitor when `report_access` is `login` or `public`. `hidden` and an unknown token answer 404; without credentials it is a 401.
1803
- responses:
1804
- "200":
1805
- description: Dashboard report
1806
- content:
1807
- application/json:
1808
- schema:
1809
- type: object
1810
- required:
1811
- - success
1812
- - data
1813
- properties:
1814
- success:
1815
- type: boolean
1816
- example: true
1817
- data:
1818
- $ref: "#/components/schemas/QualityReport"
1819
- "401":
1820
- $ref: "#/components/responses/Unauthorized"
1821
- "404":
1822
- $ref: "#/components/responses/NotFound"
1823
- components:
1824
- securitySchemes:
1825
- BearerAuth:
1826
- type: http
1827
- scheme: bearer
1828
- bearerFormat: JWT or PAT
1829
- description: Use either an Auth0 JWT token or a Personal Access Token (PAT) starting with `nbpat_`.
1830
- schemas:
1831
- User:
1832
- type: object
1833
- properties:
1834
- id:
1835
- type: integer
1836
- auth0_sub:
1837
- type: string
1838
- email:
1322
+ email:
1839
1323
  type: string
1840
1324
  format: email
1841
1325
  name:
@@ -1872,9 +1356,19 @@ components:
1872
1356
  $ref: "#/components/schemas/User"
1873
1357
  Error:
1874
1358
  type: object
1359
+ required:
1360
+ - success
1361
+ - error
1875
1362
  properties:
1363
+ success:
1364
+ type: boolean
1365
+ enum:
1366
+ - false
1876
1367
  error:
1877
1368
  type: object
1369
+ required:
1370
+ - code
1371
+ - message
1878
1372
  properties:
1879
1373
  code:
1880
1374
  type: string
@@ -1935,28 +1429,19 @@ components:
1935
1429
  enabled:
1936
1430
  type: boolean
1937
1431
  default: true
1938
- project_id:
1432
+ spec_id:
1939
1433
  type: string
1940
1434
  nullable: true
1941
- description: Project this monitor belongs to; its uptime then counts toward that project's quality gates. null = not assigned.
1942
- api_version:
1435
+ description: "The API spec this monitor is about (required when creating one: a monitor needs a spec that is tied to a repository). null only on a monitor made before specs were the key, which is not assigned until it is edited."
1436
+ repository_id:
1943
1437
  type: string
1944
1438
  nullable: true
1945
- maxLength: 32
1946
- pattern: ^[A-Za-z0-9][A-Za-z0-9._-]*$
1947
- description: API version this monitor checks (e.g. `v1`, `v2`), when the project serves several versions from one repository. null = not tied to a version (it counts for every version).
1439
+ description: The repository the spec is tied to (required when creating one, together with spec_id; nb-specs-api says which one the spec is tied to). Its uptime counts toward that spec's quality gates.
1948
1440
  description:
1949
1441
  type: string
1950
1442
  nullable: true
1951
1443
  maxLength: 500
1952
1444
  description: "Free text about the monitor: what it watches, why it exists. Up to 500 characters; an empty string clears it."
1953
- components:
1954
- type: array
1955
- maxItems: 20
1956
- description: "Names of the components of the project this monitor is about (the front end, the back end, a gateway in front of both). New names are created in the project. Needs `project_id`. Send `[]` for none: the monitor is then about the whole project and counts in every component's view. Changing `project_id` without sending this drops the old project's components. Up to 20."
1957
- items:
1958
- type: string
1959
- maxLength: 100
1960
1445
  MonitorCreate:
1961
1446
  allOf:
1962
1447
  - $ref: "#/components/schemas/MonitorSettings"
@@ -2032,24 +1517,18 @@ components:
2032
1517
  nullable: true
2033
1518
  description: Owning organization; null for a personal monitor.
2034
1519
  example: null
2035
- project_id:
1520
+ spec_id:
2036
1521
  type: string
2037
1522
  nullable: true
2038
- description: Project this monitor belongs to; its uptime then counts toward that project's quality gates. null = not assigned.
2039
- api_version:
1523
+ description: "The API spec this monitor is about (required when creating one: a monitor needs a spec that is tied to a repository). null only on a monitor made before specs were the key, which is not assigned until it is edited."
1524
+ repository_id:
2040
1525
  type: string
2041
1526
  nullable: true
2042
- maxLength: 32
2043
- description: API version this monitor checks (e.g. `v1`, `v2`), when the project serves several versions from one repository. null = not tied to a version (it counts for every version).
1527
+ description: The repository the spec is tied to (required when creating one, together with spec_id; nb-specs-api says which one the spec is tied to). Its uptime counts toward that spec's quality gates.
2044
1528
  description:
2045
1529
  type: string
2046
1530
  nullable: true
2047
1531
  description: Free text; null = none.
2048
- components:
2049
- type: array
2050
- description: The components this monitor is tied to; empty = about the whole project, so it counts in every component's view.
2051
- items:
2052
- $ref: "#/components/schemas/ComponentRef"
2053
1532
  MonitorWithUptime:
2054
1533
  allOf:
2055
1534
  - $ref: "#/components/schemas/Monitor"
@@ -2201,159 +1680,31 @@ components:
2201
1680
  $ref: "#/components/schemas/Monitor"
2202
1681
  incident_count:
2203
1682
  type: integer
2204
- total_downtime_seconds:
2205
- type: integer
2206
- ProjectCreate:
2207
- type: object
2208
- required:
2209
- - name
2210
- properties:
2211
- name:
2212
- type: string
2213
- maxLength: 100
2214
- description: Unique within the namespace, ignoring case. The CLI finds or creates a project by this name.
2215
- repo:
2216
- type: string
2217
- nullable: true
2218
- maxLength: 200
2219
- description: "Where the code lives, as `owner/name` (or `group/subgroup/project`, optionally prefixed by a host). Informational: several projects may share one repository, and it may be omitted."
2220
- example: nasebanal/nb-target-api
2221
- description:
2222
- type: string
2223
- nullable: true
2224
- maxLength: 500
2225
- description: A short free-text summary of what the project is. Informational; may be omitted.
2226
- spec_id:
2227
- type: string
2228
- nullable: true
2229
- maxLength: 64
2230
- description: "The API this project assesses: the id of a spec in the API catalog (nb-specs-api). Stored as an id only; whether it exists is not checked. Optional."
2231
- spec_environment:
2232
- type: string
2233
- nullable: true
2234
- maxLength: 40
2235
- description: Which environment of that API the project covers (production, staging, development, or any label), up to 40 characters. Needs spec_id. Optional.
2236
- ProjectUpdate:
2237
- type: object
2238
- minProperties: 1
2239
- properties:
2240
- name:
2241
- type: string
2242
- maxLength: 100
2243
- description: Unique within the namespace, ignoring case.
2244
- repo:
2245
- type: string
2246
- nullable: true
2247
- maxLength: 200
2248
- description: "`owner/name` (or `group/subgroup/project`). An empty string clears it."
2249
- example: nasebanal/nb-target-api
2250
- description:
2251
- type: string
2252
- nullable: true
2253
- maxLength: 500
2254
- description: Free-text summary. An empty string clears it.
2255
- spec_id:
2256
- type: string
2257
- nullable: true
2258
- maxLength: 64
2259
- description: The API this project assesses (a spec id of the API catalog). An empty string or null clears it, and spec_environment with it.
2260
- spec_environment:
2261
- type: string
2262
- nullable: true
2263
- maxLength: 40
2264
- description: The environment of that API the project covers, up to 40 characters. Needs spec_id. An empty string or null clears it.
2265
- public_badge:
2266
- type: boolean
2267
- description: true makes the badge readable without authentication (issues the public token the first time); false makes the badge show nothing at all. The token is kept, and this does not change report_access.
2268
- attachments_enabled:
2269
- type: boolean
2270
- description: true lets reports be attached to this project's results (`PUT .../attachment`); false (the default) refuses them with 403 `ATTACHMENTS_DISABLED`. Off by default because a report can hold secrets and every member of the project's namespace can download it. Turning it off stops new attachments; what is already stored stays until it is removed.
2271
- api_version_required_kinds:
2272
- type: array
2273
- items:
2274
- type: string
2275
- enum:
2276
- - unit
2277
- - e2e
2278
- - load
2279
- - contract
2280
- - security
2281
- description: "The kinds of result (`unit`, `e2e`, `load`, `contract`, `security`) that must carry an `api_version`. A result of such a kind without one is refused with 422 `API_VERSION_REQUIRED`, and so is an edit that clears its version. Use it for a project whose versions are kept apart (a branch each, or /v1 and /v2 side by side), where a forgotten label would put one version's result in every version's view. An empty list (the default) requires none. It governs only what arrives or is edited from now on: stored results are untouched."
2282
- report_access:
2283
- type: string
2284
- enum:
2285
- - hidden
2286
- - login
2287
- - public
2288
- description: hidden, login or public (see the Project schema). Setting it away from hidden issues the public token the first time. Does not change public_badge.
2289
- rotate_public_id:
2290
- type: boolean
2291
- description: "true replaces the public token: every old link stops working."
2292
- Project:
1683
+ total_downtime_seconds:
1684
+ type: integer
1685
+ SpecResults:
2293
1686
  type: object
1687
+ description: What Assurance holds for a spec id (and the repository the spec was tied to). The spec, its repository and every quality setting belong to nb-specs-api.
2294
1688
  required:
2295
- - id
2296
- - name
1689
+ - spec_id
1690
+ - repository_id
2297
1691
  - retention_days
2298
1692
  - created_at
2299
1693
  - updated_at
2300
1694
  properties:
2301
- id:
1695
+ spec_id:
2302
1696
  type: string
1697
+ description: The spec's id, issued by nb-specs-api (the key of the results kept here)
1698
+ repository_id:
1699
+ type: string
1700
+ description: "The id of the repository the spec was tied to when it last reported: it tells which files the results are about"
2303
1701
  organization_id:
2304
1702
  type: integer
2305
1703
  nullable: true
2306
1704
  description: Owning organization; null = personal
2307
- name:
2308
- type: string
2309
- repo:
2310
- type: string
2311
- nullable: true
2312
- description:
2313
- type: string
2314
- nullable: true
2315
- description: Free-text summary a person wrote; null = none
2316
- spec_id:
2317
- type: string
2318
- nullable: true
2319
- maxLength: 64
2320
- description: "The API this project assesses: the id of a spec in the API catalog (nb-specs-api), kept as an id only (whether it exists is not checked). null = none. Clearing it clears spec_environment too."
2321
- spec_environment:
2322
- type: string
2323
- nullable: true
2324
- maxLength: 40
2325
- description: Which environment of that API the project covers (production, staging, development, or any label), up to 40 characters. Needs spec_id. null = not said.
2326
- public_badge:
2327
- type: boolean
2328
- description: true = the badge ("5/6" and a colour) is readable without authentication by public_id; false = it shows nothing at all. Independent of report_access.
2329
- attachments_enabled:
2330
- type: boolean
2331
- description: Whether reports may be attached to this project's results. false until someone who can edit the project turns it on.
2332
- api_version_required_kinds:
2333
- type: array
2334
- items:
2335
- type: string
2336
- enum:
2337
- - unit
2338
- - e2e
2339
- - load
2340
- - contract
2341
- - security
2342
- description: The kinds of result that must carry an `api_version` (see the update schema). [] = none.
2343
- report_access:
2344
- type: string
2345
- enum:
2346
- - hidden
2347
- - login
2348
- - public
2349
- description: "Who may read the quality report (the summary, the report page and its embed): hidden = nobody (404 whoever asks), login = anyone signed in to NASEBANAL who has the link, public = anyone with the link, no login. Independent of public_badge."
2350
- public_id:
2351
- type: string
2352
- nullable: true
2353
- description: The unguessable token of the public URLs; issued when the project is first made public and kept when it is turned off. null = never made public.
2354
1705
  retention_days:
2355
1706
  type: integer
2356
- description: Runs older than this are deleted daily. Follows the reporter's plan, refreshed on every report.
1707
+ description: Runs older than this are deleted daily. Follows the reporter's plan, refreshed on every report; not a setting anyone edits.
2357
1708
  created_at:
2358
1709
  type: string
2359
1710
  format: date-time
@@ -2400,10 +1751,6 @@ components:
2400
1751
  properties:
2401
1752
  name:
2402
1753
  type: string
2403
- environment:
2404
- type: string
2405
- nullable: true
2406
- description: The environment of an API the project covers (production, staging, ...); null = not said
2407
1754
  gates:
2408
1755
  type: array
2409
1756
  items:
@@ -2448,9 +1795,9 @@ components:
2448
1795
  cacheSeconds:
2449
1796
  type: integer
2450
1797
  example: 300
2451
- ProjectWithLatestRun:
1798
+ SpecWithLatestRun:
2452
1799
  allOf:
2453
- - $ref: "#/components/schemas/Project"
1800
+ - $ref: "#/components/schemas/SpecResults"
2454
1801
  - type: object
2455
1802
  properties:
2456
1803
  latest_run:
@@ -2512,81 +1859,10 @@ components:
2512
1859
  nullable: true
2513
1860
  maxLength: 2000
2514
1861
  description: Failure or error message, truncated by the reporter
2515
- ComponentMerge:
2516
- type: object
2517
- required:
2518
- - into
2519
- properties:
2520
- into:
2521
- type: string
2522
- description: Id of the component that receives the results. It must belong to the same project and differ from the one in the path.
2523
- ComponentWrite:
2524
- type: object
2525
- required:
2526
- - name
2527
- properties:
2528
- name:
2529
- type: string
2530
- minLength: 1
2531
- maxLength: 100
2532
- description: The component's name, such as `web`, `api` or `backend-provider`. Unique in the project (case-insensitive).
2533
- ComponentRef:
2534
- type: object
2535
- required:
2536
- - id
2537
- - name
2538
- properties:
2539
- id:
2540
- type: string
2541
- name:
2542
- type: string
2543
- Component:
2544
- type: object
2545
- required:
2546
- - id
2547
- - name
2548
- - results_count
2549
- - exclusive_results_count
2550
- - monitors_count
2551
- properties:
2552
- id:
2553
- type: string
2554
- name:
2555
- type: string
2556
- description: The component's name, such as `web`, `api` or `backend-provider`. Unique in the project (case-insensitive).
2557
- results_count:
2558
- type: integer
2559
- minimum: 0
2560
- description: Number of results that belong to this component (a result of several components counts for each).
2561
- exclusive_results_count:
2562
- type: integer
2563
- minimum: 0
2564
- description: "How many of those belong to no other component: the ones deleted along with it."
2565
- monitors_count:
2566
- type: integer
2567
- minimum: 0
2568
- description: How many monitors are tied to this component (they stay when it is deleted, just no longer tied).
2569
- created_at:
2570
- type: string
2571
- format: date-time
2572
- updated_at:
2573
- type: string
2574
- format: date-time
2575
1862
  SuiteUpdate:
2576
1863
  type: object
2577
1864
  description: Fields of a stored suite result that may be corrected. At least one is required.
2578
1865
  properties:
2579
- name:
2580
- type: string
2581
- maxLength: 100
2582
- description: Move the result to this one component (created when new); shorthand for a `components` of one. An empty string means `default`.
2583
- components:
2584
- type: array
2585
- maxItems: 20
2586
- description: Replace the components the result belongs to (created when new; an empty list means `default`). A result of the run that already has the same kind, set of components and version makes it a conflict (409).
2587
- items:
2588
- type: string
2589
- maxLength: 100
2590
1866
  description:
2591
1867
  type: string
2592
1868
  nullable: true
@@ -2596,13 +1872,7 @@ components:
2596
1872
  type: string
2597
1873
  nullable: true
2598
1874
  maxLength: 100
2599
- description: Correct the label (see `Suite.label`). `null` or an empty string clears it. Refused (409) when the run already has a result with the same kind, components, API version and label.
2600
- api_version:
2601
- type: string
2602
- nullable: true
2603
- maxLength: 32
2604
- pattern: ^[A-Za-z0-9][A-Za-z0-9._-]*$
2605
- description: Correct the API version of this result. `null` clears it (the result then applies to every version).
1875
+ description: Correct the label (see `Suite.label`). `null` or an empty string clears it. Refused (409) when the run already has a result with the same kind and label.
2606
1876
  status:
2607
1877
  type: string
2608
1878
  enum:
@@ -2668,7 +1938,7 @@ components:
2668
1938
  type: string
2669
1939
  nullable: true
2670
1940
  maxLength: 20
2671
- description: The CI provider the run came from (`github` or `gitlab`; `other` for anything else), when the sender knew it. With the project's repository and the commit it lets a page link to a file in the repository.
1941
+ description: The CI provider the run came from (`github` or `gitlab`; `other` for anything else), when the sender knew it. With the repository and the commit it lets a page link to a file in the repository.
2672
1942
  repo_url:
2673
1943
  type: string
2674
1944
  maxLength: 2048
@@ -2730,6 +2000,11 @@ components:
2730
2000
  nullable: true
2731
2001
  maxLength: 50
2732
2002
  description: "The version of the tool that produced the report (e.g. `9.1.0`), when the sender knew it. Informational: it is not part of the result's identity, and a report sent again replaces it."
2003
+ spec_hash:
2004
+ type: string
2005
+ pattern: ^[0-9a-f]{64}$
2006
+ nullable: true
2007
+ description: "The SHA-256 of the API contract document this result was produced against (64 lowercase hex characters: the `content_hash` of a version of that spec in the API catalog, i.e. the SHA-256 of the contract file's bytes), when the sender knew it. It lets a page tell whether the result was produced with the current contract (verified), an older registered version, or an unknown one. Informational: it is not part of the result's identity, and a report sent again replaces it."
2733
2008
  report_path:
2734
2009
  type: string
2735
2010
  nullable: true
@@ -2744,15 +2019,6 @@ components:
2744
2019
  type: string
2745
2020
  size_bytes:
2746
2021
  type: integer
2747
- name:
2748
- type: string
2749
- description: "A label for display: the names of the result's components, joined with `, `."
2750
- components:
2751
- type: array
2752
- minItems: 1
2753
- description: The components the result belongs to (at least one). A result may be about several, such as an end-to-end test of the front end and the back end together.
2754
- items:
2755
- $ref: "#/components/schemas/ComponentRef"
2756
2022
  status:
2757
2023
  type: string
2758
2024
  enum:
@@ -2792,7 +2058,7 @@ components:
2792
2058
  type: string
2793
2059
  nullable: true
2794
2060
  maxLength: 100
2795
- description: "A name that tells apart results of one run, kind, components and API version, such as two scans of one tool (`baseline`, `full-scan`). null = none. It is part of the result's identity: the same combination with the same label replaces it."
2061
+ description: "A name that tells apart results of one run and kind, such as two scans of one tool (`baseline`, `full-scan`). null = none. It is part of the result's identity (run, kind, label): the same combination with the same label replaces it."
2796
2062
  cases_count:
2797
2063
  type: integer
2798
2064
  minimum: 0
@@ -2801,14 +2067,11 @@ components:
2801
2067
  updated_at:
2802
2068
  type: string
2803
2069
  format: date-time
2804
- api_version:
2805
- type: string
2806
- nullable: true
2807
- description: API version this result is for (e.g. `v1`, `v2`). null or absent = it applies to every version (unit tests usually do). Within one run a suite is identified by `kind`, `name` and `api_version`, so the results for v1 and v2 of the same kind and name sit side by side (one with no version is a third, shared one); reporting the same combination again replaces it.
2808
2070
  Run:
2809
2071
  type: object
2810
2072
  required:
2811
2073
  - id
2074
+ - repository_id
2812
2075
  - key
2813
2076
  - status
2814
2077
  - suites
@@ -2816,6 +2079,10 @@ components:
2816
2079
  properties:
2817
2080
  id:
2818
2081
  type: string
2082
+ repository_id:
2083
+ type: string
2084
+ nullable: true
2085
+ description: The repository the spec was tied to when this run was reported (null in the public report, where the code lives is not published)
2819
2086
  key:
2820
2087
  type: string
2821
2088
  description: The caller's identity for the pipeline run
@@ -2832,7 +2099,7 @@ components:
2832
2099
  type: string
2833
2100
  nullable: true
2834
2101
  maxLength: 20
2835
- description: The CI provider the run came from (`github` or `gitlab`; `other` for anything else), when the sender knew it. With the project's repository and the commit it lets a page link to a file in the repository.
2102
+ description: The CI provider the run came from (`github` or `gitlab`; `other` for anything else), when the sender knew it. With the repository and the commit it lets a page link to a file in the repository.
2836
2103
  repo_url:
2837
2104
  type: string
2838
2105
  maxLength: 2048
@@ -2859,9 +2126,13 @@ components:
2859
2126
  ResultReport:
2860
2127
  type: object
2861
2128
  required:
2129
+ - repository_id
2862
2130
  - run
2863
2131
  - suite
2864
2132
  properties:
2133
+ repository_id:
2134
+ type: string
2135
+ description: "The repository the spec (in the path) is tied to: REQUIRED, together with the spec. nb-specs-api says which one the spec is tied to; a spec with no repository, or another one, is refused (422)."
2865
2136
  run:
2866
2137
  type: object
2867
2138
  required:
@@ -2888,7 +2159,7 @@ components:
2888
2159
  - github
2889
2160
  - gitlab
2890
2161
  - other
2891
- description: The CI provider the run came from (`github` or `gitlab`; `other` for anything else), when the sender knew it. With the project's repository and the commit it lets a page link to a file in the repository.
2162
+ description: The CI provider the run came from (`github` or `gitlab`; `other` for anything else), when the sender knew it. With the repository and the commit it lets a page link to a file in the repository.
2892
2163
  repo_url:
2893
2164
  type: string
2894
2165
  maxLength: 2048
@@ -2917,23 +2188,6 @@ components:
2917
2188
  pattern: ^[a-z0-9][a-z0-9._-]{0,49}$
2918
2189
  description: "The producing tool, as a label (lower-case letters, digits, `.`, `_`, `-`; up to 50), for example vitest, pytest, playwright, specmatic, zap, locust, trivy, k6. It is not a closed list: what a result means is carried by `kind` and by the normalised `metrics`, so a tool can be swapped for another that reports the same things. Converting a tool's own report into that shape is the sender's job (the nb CLI, a script). Matching is case-insensitive."
2919
2190
  example: playwright
2920
- api_version:
2921
- type: string
2922
- nullable: true
2923
- maxLength: 32
2924
- pattern: ^[A-Za-z0-9][A-Za-z0-9._-]*$
2925
- description: API version this result is for (e.g. `v1`, `v2`). null or absent = it applies to every version (unit tests usually do). Within one run a suite is identified by `kind`, `name` and `api_version`, so the results for v1 and v2 of the same kind and name sit side by side (one with no version is a third, shared one); reporting the same combination again replaces it.
2926
- name:
2927
- type: string
2928
- maxLength: 100
2929
- description: One component this result is for. Shorthand for a `components` of one; if both are sent, the result belongs to all of them. Omit both for the component `default`.
2930
- components:
2931
- type: array
2932
- maxItems: 20
2933
- description: "The components this result is for: the front end, the back end, a service. Each is created in the project when new. Up to 20. Omitted or empty (with no `name`) means `default`. A suite in a run is identified by `kind`, the set of components, `api_version` and `label`; reporting the same combination again replaces it."
2934
- items:
2935
- type: string
2936
- maxLength: 100
2937
2191
  description:
2938
2192
  type: string
2939
2193
  maxLength: 500
@@ -2941,11 +2195,15 @@ components:
2941
2195
  label:
2942
2196
  type: string
2943
2197
  maxLength: 100
2944
- description: A name that tells apart results that are otherwise the same (same kind, components and API version), such as two scans of one tool (`baseline`, `full-scan`). Optional; up to 100 characters. Reporting the same combination with the same label again replaces the result.
2198
+ description: A name that tells apart results that are otherwise the same (same kind), such as two scans of one tool (`baseline`, `full-scan`). Optional; up to 100 characters. Reporting the same combination with the same label again replaces the result.
2945
2199
  tool_version:
2946
2200
  type: string
2947
2201
  maxLength: 50
2948
2202
  description: "The version of the tool that produced the report (e.g. `9.1.0`). Optional; up to 50 characters. Informational: it is not part of the result's identity."
2203
+ spec_hash:
2204
+ type: string
2205
+ pattern: ^[0-9a-f]{64}$
2206
+ description: "The SHA-256 of the API contract document this result was produced against (64 lowercase hex characters: the `content_hash` of a version of that spec in the API catalog, i.e. the SHA-256 of the contract file's bytes). Optional. Informational: it is not part of the result's identity, and a report sent again replaces it."
2949
2207
  report_path:
2950
2208
  type: string
2951
2209
  maxLength: 512
@@ -3020,312 +2278,22 @@ components:
3020
2278
  type: string
3021
2279
  replaced:
3022
2280
  type: boolean
3023
- ContractCreditTier:
3024
- type: object
3025
- required:
3026
- - below_pct
3027
- - credit_pct
3028
- properties:
3029
- below_pct:
3030
- type: number
3031
- description: Below this uptime percentage the credit applies
3032
- credit_pct:
3033
- type: number
3034
- description: Share of the monthly fee credited back
3035
- ContractSla:
3036
- type: object
3037
- required:
3038
- - uptime_target_pct
3039
- - monthly_fee
3040
- - credit_tiers
3041
- properties:
3042
- uptime_target_pct:
3043
- type: number
3044
- monthly_fee:
3045
- type: integer
3046
- credit_tiers:
3047
- type: array
3048
- items:
3049
- $ref: "#/components/schemas/ContractCreditTier"
3050
- ContractDeliverable:
3051
- type: object
3052
- required:
3053
- - id
3054
- - name
3055
- - project_id
3056
- - version
3057
- - due
3058
- - amount
3059
- - paid
3060
- properties:
3061
- id:
3062
- type: string
3063
- name:
3064
- type: string
3065
- project_id:
3066
- type: string
3067
- nullable: true
3068
- description: The project this deliverable is a version of; null once that project is deleted
3069
- version:
3070
- type: string
3071
- nullable: true
3072
- description: The delivered version, if it has been delivered
3073
- due:
3074
- type: string
3075
- format: date
3076
- amount:
3077
- type: integer
3078
- description: Released on acceptance
3079
- paid:
3080
- type: boolean
3081
- ContractDocument:
3082
- type: object
3083
- required:
3084
- - name
3085
- - kind
3086
- - date
3087
- properties:
3088
- name:
3089
- type: string
3090
- kind:
3091
- type: string
3092
- enum:
3093
- - contract
3094
- - spec
3095
- - sla
3096
- - acceptance
3097
- date:
3098
- type: string
3099
- format: date
3100
- ContractDeliverableInput:
3101
- type: object
3102
- required:
3103
- - name
3104
- - due
3105
- - amount
3106
- properties:
3107
- id:
3108
- type: string
3109
- description: Send back an existing id to keep that deliverable; omitted or unknown ids get a new one
3110
- name:
3111
- type: string
3112
- maxLength: 120
3113
- project_id:
3114
- type: string
3115
- nullable: true
3116
- version:
3117
- type: string
3118
- nullable: true
3119
- maxLength: 32
3120
- pattern: ^[A-Za-z0-9._-]+$
3121
- due:
3122
- type: string
3123
- format: date
3124
- amount:
3125
- type: integer
3126
- minimum: 0
3127
- maximum: 1000000000
3128
- paid:
3129
- type: boolean
3130
- default: false
3131
- ContractInput:
3132
- type: object
3133
- required:
3134
- - title
3135
- - kind
3136
- - status
3137
- - orderer
3138
- - vendor
3139
- - start
3140
- - end
3141
- - amount
3142
- properties:
3143
- title:
3144
- type: string
3145
- maxLength: 160
3146
- description: Bilingual, "ja / en"
3147
- kind:
3148
- type: string
3149
- enum:
3150
- - development
3151
- - maintenance
3152
- status:
3153
- type: string
3154
- enum:
3155
- - draft
3156
- - active
3157
- - completed
3158
- orderer:
3159
- type: string
3160
- maxLength: 100
3161
- vendor:
3162
- type: string
3163
- maxLength: 100
3164
- start:
3165
- type: string
3166
- format: date
3167
- end:
3168
- type: string
3169
- format: date
3170
- description: ">= start"
3171
- amount:
3172
- type: integer
3173
- minimum: 0
3174
- maximum: 100000000000
3175
- oas_url:
3176
- type: string
3177
- format: uri
3178
- nullable: true
3179
- description: http(s) URL of the OpenAPI document
3180
- sla_project_id:
3181
- type: string
3182
- nullable: true
3183
- sla:
3184
- allOf:
3185
- - $ref: "#/components/schemas/ContractSla"
3186
- nullable: true
3187
- description: Operations contracts only. Omit or null for none.
3188
- related:
3189
- type: object
3190
- nullable: true
3191
- description: Link to another contract of the same namespace
3192
- required:
3193
- - id
3194
- - relation
3195
- properties:
3196
- id:
3197
- type: string
3198
- relation:
3199
- type: string
3200
- enum:
3201
- - follows
3202
- - change_order
3203
- deliverables:
3204
- type: array
3205
- maxItems: 20
3206
- items:
3207
- $ref: "#/components/schemas/ContractDeliverableInput"
3208
- documents:
3209
- type: array
3210
- maxItems: 20
3211
- items:
3212
- $ref: "#/components/schemas/ContractDocument"
3213
- Contract:
3214
- type: object
3215
- required:
3216
- - id
3217
- - title
3218
- - kind
3219
- - status
3220
- - orderer
3221
- - vendor
3222
- - start
3223
- - end
3224
- - amount
3225
- - oas_url
3226
- - sla_project_id
3227
- - sla
3228
- - related
3229
- - deliverables
3230
- - documents
3231
- - created_at
3232
- - updated_at
3233
- properties:
3234
- id:
3235
- type: string
3236
- title:
3237
- type: string
3238
- description: Bilingual, "ja / en"
3239
- kind:
3240
- type: string
3241
- enum:
3242
- - development
3243
- - maintenance
3244
- status:
3245
- type: string
3246
- enum:
3247
- - draft
3248
- - active
3249
- - completed
3250
- orderer:
3251
- type: string
3252
- vendor:
3253
- type: string
3254
- start:
3255
- type: string
3256
- format: date
3257
- end:
3258
- type: string
3259
- format: date
3260
- amount:
3261
- type: integer
3262
- oas_url:
3263
- type: string
3264
- format: uri
3265
- nullable: true
3266
- description: The OpenAPI document this contract refers to, as a plain URL
3267
- sla_project_id:
3268
- type: string
3269
- nullable: true
3270
- description: "Operations contracts: the project whose uptime the SLA clause covers"
3271
- sla:
3272
- allOf:
3273
- - $ref: "#/components/schemas/ContractSla"
3274
- nullable: true
3275
- related:
3276
- type: object
3277
- nullable: true
3278
- description: "How this contract relates to another one: it follows a development contract, or is a change order on top of a running one"
3279
- properties:
3280
- id:
3281
- type: string
3282
- relation:
3283
- type: string
3284
- enum:
3285
- - follows
3286
- - change_order
3287
- deliverables:
3288
- type: array
3289
- items:
3290
- $ref: "#/components/schemas/ContractDeliverable"
3291
- documents:
3292
- type: array
3293
- items:
3294
- $ref: "#/components/schemas/ContractDocument"
3295
- created_at:
3296
- type: string
3297
- format: date-time
3298
- updated_at:
3299
- type: string
3300
- format: date-time
3301
2281
  QualityReport:
3302
2282
  type: object
3303
- description: "The dashboard data of a public report: the project's name, environment, component names and recent runs (verdicts, counts, coverage, metrics only), and its monitors' uptime and daily states (named Monitor 1, 2, ...)."
2283
+ description: "The dashboard data of a public report: the spec's name and recent runs (verdicts, counts, coverage, metrics only), and its monitors' uptime and daily states (named Monitor 1, 2, ...)."
3304
2284
  required:
3305
- - project
2285
+ - spec
3306
2286
  - monitoring
3307
2287
  - built_at
3308
2288
  properties:
3309
- project:
2289
+ spec:
3310
2290
  type: object
3311
2291
  required:
3312
2292
  - name
3313
- - environment
3314
- - components
3315
2293
  - runs
3316
2294
  properties:
3317
2295
  name:
3318
2296
  type: string
3319
- environment:
3320
- type: string
3321
- nullable: true
3322
- components:
3323
- type: array
3324
- items:
3325
- type: object
3326
- properties:
3327
- name:
3328
- type: string
3329
2297
  runs:
3330
2298
  type: array
3331
2299
  items:
@@ -3354,6 +2322,7 @@ components:
3354
2322
  schema:
3355
2323
  $ref: "#/components/schemas/Error"
3356
2324
  example:
2325
+ success: false
3357
2326
  error:
3358
2327
  code: AUTH_ERROR
3359
2328
  message: No authentication token provided
@@ -3379,8 +2348,8 @@ components:
3379
2348
  error:
3380
2349
  code: NOT_FOUND
3381
2350
  message: Monitor not found
3382
- ApiVersionRequired:
3383
- description: The project requires an `api_version` for this kind of result (`API_VERSION_REQUIRED`)
2351
+ ServiceUnavailable:
2352
+ description: "nb-specs-api, which holds the spec's quality settings, could not be asked (`UPSTREAM_UNAVAILABLE`): whether the badge or the report is public is not known, so nothing is shown and nothing is cached for long. Try again shortly. Never a `404`, which would mean \"not public\""
3384
2353
  content:
3385
2354
  application/json:
3386
2355
  schema:
@@ -3388,8 +2357,64 @@ components:
3388
2357
  example:
3389
2358
  success: false
3390
2359
  error:
3391
- code: API_VERSION_REQUIRED
3392
- message: "This project requires an API version for contract results: send api_version (nb: --api-version, or NB_API_VERSION)"
2360
+ code: UPSTREAM_UNAVAILABLE
2361
+ message: The spec service is not available, try again shortly
2362
+ PairRefused:
2363
+ description: "The spec or the repository is missing, or they do not belong together: `SPEC_REQUIRED`, `REPOSITORY_REQUIRED` (a monitor needs BOTH), `SPEC_WITHOUT_REPOSITORY` (the spec is not tied to a repository: tie it to one in nb-specs-api first), `REPOSITORY_MISMATCH` (the spec is tied to another repository)"
2364
+ content:
2365
+ application/json:
2366
+ schema:
2367
+ $ref: "#/components/schemas/Error"
2368
+ examples:
2369
+ spec_required:
2370
+ value:
2371
+ success: false
2372
+ error:
2373
+ code: SPEC_REQUIRED
2374
+ message: "spec_id is required: a monitor is about a spec that is tied to a repository"
2375
+ repository_required:
2376
+ value:
2377
+ success: false
2378
+ error:
2379
+ code: REPOSITORY_REQUIRED
2380
+ message: "repository_id is required: a monitor is about a spec that is tied to a repository"
2381
+ spec_without_repository:
2382
+ value:
2383
+ success: false
2384
+ error:
2385
+ code: SPEC_WITHOUT_REPOSITORY
2386
+ message: "This spec is not tied to a repository: tie it to one (Spec management) before reporting results or adding monitors"
2387
+ repository_mismatch:
2388
+ value:
2389
+ success: false
2390
+ error:
2391
+ code: REPOSITORY_MISMATCH
2392
+ message: repository_id is not the repository this spec is tied to
2393
+ UnprocessableResult:
2394
+ description: "The report cannot be taken: the repository is missing or does not belong to the spec (`REPOSITORY_REQUIRED`, `SPEC_WITHOUT_REPOSITORY`, `REPOSITORY_MISMATCH`)"
2395
+ content:
2396
+ application/json:
2397
+ schema:
2398
+ $ref: "#/components/schemas/Error"
2399
+ examples:
2400
+ repository_required:
2401
+ value:
2402
+ success: false
2403
+ error:
2404
+ code: REPOSITORY_REQUIRED
2405
+ message: "repository_id is required: a result or a monitor is about a spec that is tied to a repository"
2406
+ spec_without_repository:
2407
+ value:
2408
+ success: false
2409
+ error:
2410
+ code: SPEC_WITHOUT_REPOSITORY
2411
+ message: "This spec is not tied to a repository: tie it to one (Spec management) before reporting results or adding monitors"
2412
+ repository_mismatch:
2413
+ value:
2414
+ success: false
2415
+ error:
2416
+ code: REPOSITORY_MISMATCH
2417
+ message: repository_id is not the repository this spec is tied to
3393
2418
  Forbidden:
3394
2419
  description: The caller does not belong to the active organization (`FORBIDDEN`)
3395
2420
  content: