@nasebanal/cli 0.12.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
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.2
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:
@@ -1945,28 +1429,19 @@ components:
1945
1429
  enabled:
1946
1430
  type: boolean
1947
1431
  default: true
1948
- project_id:
1432
+ spec_id:
1949
1433
  type: string
1950
1434
  nullable: true
1951
- description: Project this monitor belongs to; its uptime then counts toward that project's quality gates. null = not assigned.
1952
- 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:
1953
1437
  type: string
1954
1438
  nullable: true
1955
- maxLength: 32
1956
- pattern: ^[A-Za-z0-9][A-Za-z0-9._-]*$
1957
- 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.
1958
1440
  description:
1959
1441
  type: string
1960
1442
  nullable: true
1961
1443
  maxLength: 500
1962
1444
  description: "Free text about the monitor: what it watches, why it exists. Up to 500 characters; an empty string clears it."
1963
- components:
1964
- type: array
1965
- maxItems: 20
1966
- 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."
1967
- items:
1968
- type: string
1969
- maxLength: 100
1970
1445
  MonitorCreate:
1971
1446
  allOf:
1972
1447
  - $ref: "#/components/schemas/MonitorSettings"
@@ -2042,24 +1517,18 @@ components:
2042
1517
  nullable: true
2043
1518
  description: Owning organization; null for a personal monitor.
2044
1519
  example: null
2045
- project_id:
1520
+ spec_id:
2046
1521
  type: string
2047
1522
  nullable: true
2048
- description: Project this monitor belongs to; its uptime then counts toward that project's quality gates. null = not assigned.
2049
- 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:
2050
1525
  type: string
2051
1526
  nullable: true
2052
- maxLength: 32
2053
- 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.
2054
1528
  description:
2055
1529
  type: string
2056
1530
  nullable: true
2057
1531
  description: Free text; null = none.
2058
- components:
2059
- type: array
2060
- description: The components this monitor is tied to; empty = about the whole project, so it counts in every component's view.
2061
- items:
2062
- $ref: "#/components/schemas/ComponentRef"
2063
1532
  MonitorWithUptime:
2064
1533
  allOf:
2065
1534
  - $ref: "#/components/schemas/Monitor"
@@ -2210,160 +1679,32 @@ components:
2210
1679
  monitor:
2211
1680
  $ref: "#/components/schemas/Monitor"
2212
1681
  incident_count:
2213
- type: integer
2214
- total_downtime_seconds:
2215
- type: integer
2216
- ProjectCreate:
2217
- type: object
2218
- required:
2219
- - name
2220
- properties:
2221
- name:
2222
- type: string
2223
- maxLength: 100
2224
- description: Unique within the namespace, ignoring case. The CLI finds or creates a project by this name.
2225
- repo:
2226
- type: string
2227
- nullable: true
2228
- maxLength: 200
2229
- 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."
2230
- example: nasebanal/nb-target-api
2231
- description:
2232
- type: string
2233
- nullable: true
2234
- maxLength: 500
2235
- description: A short free-text summary of what the project is. Informational; may be omitted.
2236
- spec_id:
2237
- type: string
2238
- nullable: true
2239
- maxLength: 64
2240
- 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."
2241
- spec_environment:
2242
- type: string
2243
- nullable: true
2244
- maxLength: 40
2245
- description: Which environment of that API the project covers (production, staging, development, or any label), up to 40 characters. Needs spec_id. Optional.
2246
- ProjectUpdate:
2247
- type: object
2248
- minProperties: 1
2249
- properties:
2250
- name:
2251
- type: string
2252
- maxLength: 100
2253
- description: Unique within the namespace, ignoring case.
2254
- repo:
2255
- type: string
2256
- nullable: true
2257
- maxLength: 200
2258
- description: "`owner/name` (or `group/subgroup/project`). An empty string clears it."
2259
- example: nasebanal/nb-target-api
2260
- description:
2261
- type: string
2262
- nullable: true
2263
- maxLength: 500
2264
- description: Free-text summary. An empty string clears it.
2265
- spec_id:
2266
- type: string
2267
- nullable: true
2268
- maxLength: 64
2269
- 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.
2270
- spec_environment:
2271
- type: string
2272
- nullable: true
2273
- maxLength: 40
2274
- description: The environment of that API the project covers, up to 40 characters. Needs spec_id. An empty string or null clears it.
2275
- public_badge:
2276
- type: boolean
2277
- 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.
2278
- attachments_enabled:
2279
- type: boolean
2280
- 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.
2281
- api_version_required_kinds:
2282
- type: array
2283
- items:
2284
- type: string
2285
- enum:
2286
- - unit
2287
- - e2e
2288
- - load
2289
- - contract
2290
- - security
2291
- 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."
2292
- report_access:
2293
- type: string
2294
- enum:
2295
- - hidden
2296
- - login
2297
- - public
2298
- 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.
2299
- rotate_public_id:
2300
- type: boolean
2301
- description: "true replaces the public token: every old link stops working."
2302
- Project:
1682
+ type: integer
1683
+ total_downtime_seconds:
1684
+ type: integer
1685
+ SpecResults:
2303
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.
2304
1688
  required:
2305
- - id
2306
- - name
1689
+ - spec_id
1690
+ - repository_id
2307
1691
  - retention_days
2308
1692
  - created_at
2309
1693
  - updated_at
2310
1694
  properties:
2311
- id:
1695
+ spec_id:
1696
+ type: string
1697
+ description: The spec's id, issued by nb-specs-api (the key of the results kept here)
1698
+ repository_id:
2312
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"
2313
1701
  organization_id:
2314
1702
  type: integer
2315
1703
  nullable: true
2316
1704
  description: Owning organization; null = personal
2317
- name:
2318
- type: string
2319
- repo:
2320
- type: string
2321
- nullable: true
2322
- description:
2323
- type: string
2324
- nullable: true
2325
- description: Free-text summary a person wrote; null = none
2326
- spec_id:
2327
- type: string
2328
- nullable: true
2329
- maxLength: 64
2330
- 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."
2331
- spec_environment:
2332
- type: string
2333
- nullable: true
2334
- maxLength: 40
2335
- 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.
2336
- public_badge:
2337
- type: boolean
2338
- 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.
2339
- attachments_enabled:
2340
- type: boolean
2341
- description: Whether reports may be attached to this project's results. false until someone who can edit the project turns it on.
2342
- api_version_required_kinds:
2343
- type: array
2344
- items:
2345
- type: string
2346
- enum:
2347
- - unit
2348
- - e2e
2349
- - load
2350
- - contract
2351
- - security
2352
- description: The kinds of result that must carry an `api_version` (see the update schema). [] = none.
2353
- report_access:
2354
- type: string
2355
- enum:
2356
- - hidden
2357
- - login
2358
- - public
2359
- 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."
2360
- public_id:
2361
- type: string
2362
- nullable: true
2363
- 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.
2364
1705
  retention_days:
2365
1706
  type: integer
2366
- 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.
2367
1708
  created_at:
2368
1709
  type: string
2369
1710
  format: date-time
@@ -2410,10 +1751,6 @@ components:
2410
1751
  properties:
2411
1752
  name:
2412
1753
  type: string
2413
- environment:
2414
- type: string
2415
- nullable: true
2416
- description: The environment of an API the project covers (production, staging, ...); null = not said
2417
1754
  gates:
2418
1755
  type: array
2419
1756
  items:
@@ -2458,9 +1795,9 @@ components:
2458
1795
  cacheSeconds:
2459
1796
  type: integer
2460
1797
  example: 300
2461
- ProjectWithLatestRun:
1798
+ SpecWithLatestRun:
2462
1799
  allOf:
2463
- - $ref: "#/components/schemas/Project"
1800
+ - $ref: "#/components/schemas/SpecResults"
2464
1801
  - type: object
2465
1802
  properties:
2466
1803
  latest_run:
@@ -2522,81 +1859,10 @@ components:
2522
1859
  nullable: true
2523
1860
  maxLength: 2000
2524
1861
  description: Failure or error message, truncated by the reporter
2525
- ComponentMerge:
2526
- type: object
2527
- required:
2528
- - into
2529
- properties:
2530
- into:
2531
- type: string
2532
- description: Id of the component that receives the results. It must belong to the same project and differ from the one in the path.
2533
- ComponentWrite:
2534
- type: object
2535
- required:
2536
- - name
2537
- properties:
2538
- name:
2539
- type: string
2540
- minLength: 1
2541
- maxLength: 100
2542
- description: The component's name, such as `web`, `api` or `backend-provider`. Unique in the project (case-insensitive).
2543
- ComponentRef:
2544
- type: object
2545
- required:
2546
- - id
2547
- - name
2548
- properties:
2549
- id:
2550
- type: string
2551
- name:
2552
- type: string
2553
- Component:
2554
- type: object
2555
- required:
2556
- - id
2557
- - name
2558
- - results_count
2559
- - exclusive_results_count
2560
- - monitors_count
2561
- properties:
2562
- id:
2563
- type: string
2564
- name:
2565
- type: string
2566
- description: The component's name, such as `web`, `api` or `backend-provider`. Unique in the project (case-insensitive).
2567
- results_count:
2568
- type: integer
2569
- minimum: 0
2570
- description: Number of results that belong to this component (a result of several components counts for each).
2571
- exclusive_results_count:
2572
- type: integer
2573
- minimum: 0
2574
- description: "How many of those belong to no other component: the ones deleted along with it."
2575
- monitors_count:
2576
- type: integer
2577
- minimum: 0
2578
- description: How many monitors are tied to this component (they stay when it is deleted, just no longer tied).
2579
- created_at:
2580
- type: string
2581
- format: date-time
2582
- updated_at:
2583
- type: string
2584
- format: date-time
2585
1862
  SuiteUpdate:
2586
1863
  type: object
2587
1864
  description: Fields of a stored suite result that may be corrected. At least one is required.
2588
1865
  properties:
2589
- name:
2590
- type: string
2591
- maxLength: 100
2592
- description: Move the result to this one component (created when new); shorthand for a `components` of one. An empty string means `default`.
2593
- components:
2594
- type: array
2595
- maxItems: 20
2596
- 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).
2597
- items:
2598
- type: string
2599
- maxLength: 100
2600
1866
  description:
2601
1867
  type: string
2602
1868
  nullable: true
@@ -2606,13 +1872,7 @@ components:
2606
1872
  type: string
2607
1873
  nullable: true
2608
1874
  maxLength: 100
2609
- 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.
2610
- api_version:
2611
- type: string
2612
- nullable: true
2613
- maxLength: 32
2614
- pattern: ^[A-Za-z0-9][A-Za-z0-9._-]*$
2615
- 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.
2616
1876
  status:
2617
1877
  type: string
2618
1878
  enum:
@@ -2678,7 +1938,7 @@ components:
2678
1938
  type: string
2679
1939
  nullable: true
2680
1940
  maxLength: 20
2681
- 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.
2682
1942
  repo_url:
2683
1943
  type: string
2684
1944
  maxLength: 2048
@@ -2740,6 +2000,11 @@ components:
2740
2000
  nullable: true
2741
2001
  maxLength: 50
2742
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."
2743
2008
  report_path:
2744
2009
  type: string
2745
2010
  nullable: true
@@ -2754,15 +2019,6 @@ components:
2754
2019
  type: string
2755
2020
  size_bytes:
2756
2021
  type: integer
2757
- name:
2758
- type: string
2759
- description: "A label for display: the names of the result's components, joined with `, `."
2760
- components:
2761
- type: array
2762
- minItems: 1
2763
- 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.
2764
- items:
2765
- $ref: "#/components/schemas/ComponentRef"
2766
2022
  status:
2767
2023
  type: string
2768
2024
  enum:
@@ -2802,7 +2058,7 @@ components:
2802
2058
  type: string
2803
2059
  nullable: true
2804
2060
  maxLength: 100
2805
- 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."
2806
2062
  cases_count:
2807
2063
  type: integer
2808
2064
  minimum: 0
@@ -2811,14 +2067,11 @@ components:
2811
2067
  updated_at:
2812
2068
  type: string
2813
2069
  format: date-time
2814
- api_version:
2815
- type: string
2816
- nullable: true
2817
- 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.
2818
2070
  Run:
2819
2071
  type: object
2820
2072
  required:
2821
2073
  - id
2074
+ - repository_id
2822
2075
  - key
2823
2076
  - status
2824
2077
  - suites
@@ -2826,6 +2079,10 @@ components:
2826
2079
  properties:
2827
2080
  id:
2828
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)
2829
2086
  key:
2830
2087
  type: string
2831
2088
  description: The caller's identity for the pipeline run
@@ -2842,7 +2099,7 @@ components:
2842
2099
  type: string
2843
2100
  nullable: true
2844
2101
  maxLength: 20
2845
- 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.
2846
2103
  repo_url:
2847
2104
  type: string
2848
2105
  maxLength: 2048
@@ -2869,9 +2126,13 @@ components:
2869
2126
  ResultReport:
2870
2127
  type: object
2871
2128
  required:
2129
+ - repository_id
2872
2130
  - run
2873
2131
  - suite
2874
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)."
2875
2136
  run:
2876
2137
  type: object
2877
2138
  required:
@@ -2898,7 +2159,7 @@ components:
2898
2159
  - github
2899
2160
  - gitlab
2900
2161
  - other
2901
- 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.
2902
2163
  repo_url:
2903
2164
  type: string
2904
2165
  maxLength: 2048
@@ -2927,23 +2188,6 @@ components:
2927
2188
  pattern: ^[a-z0-9][a-z0-9._-]{0,49}$
2928
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."
2929
2190
  example: playwright
2930
- api_version:
2931
- type: string
2932
- nullable: true
2933
- maxLength: 32
2934
- pattern: ^[A-Za-z0-9][A-Za-z0-9._-]*$
2935
- 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.
2936
- name:
2937
- type: string
2938
- maxLength: 100
2939
- 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`.
2940
- components:
2941
- type: array
2942
- maxItems: 20
2943
- 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."
2944
- items:
2945
- type: string
2946
- maxLength: 100
2947
2191
  description:
2948
2192
  type: string
2949
2193
  maxLength: 500
@@ -2951,11 +2195,15 @@ components:
2951
2195
  label:
2952
2196
  type: string
2953
2197
  maxLength: 100
2954
- 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.
2955
2199
  tool_version:
2956
2200
  type: string
2957
2201
  maxLength: 50
2958
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."
2959
2207
  report_path:
2960
2208
  type: string
2961
2209
  maxLength: 512
@@ -3030,312 +2278,22 @@ components:
3030
2278
  type: string
3031
2279
  replaced:
3032
2280
  type: boolean
3033
- ContractCreditTier:
3034
- type: object
3035
- required:
3036
- - below_pct
3037
- - credit_pct
3038
- properties:
3039
- below_pct:
3040
- type: number
3041
- description: Below this uptime percentage the credit applies
3042
- credit_pct:
3043
- type: number
3044
- description: Share of the monthly fee credited back
3045
- ContractSla:
3046
- type: object
3047
- required:
3048
- - uptime_target_pct
3049
- - monthly_fee
3050
- - credit_tiers
3051
- properties:
3052
- uptime_target_pct:
3053
- type: number
3054
- monthly_fee:
3055
- type: integer
3056
- credit_tiers:
3057
- type: array
3058
- items:
3059
- $ref: "#/components/schemas/ContractCreditTier"
3060
- ContractDeliverable:
3061
- type: object
3062
- required:
3063
- - id
3064
- - name
3065
- - project_id
3066
- - version
3067
- - due
3068
- - amount
3069
- - paid
3070
- properties:
3071
- id:
3072
- type: string
3073
- name:
3074
- type: string
3075
- project_id:
3076
- type: string
3077
- nullable: true
3078
- description: The project this deliverable is a version of; null once that project is deleted
3079
- version:
3080
- type: string
3081
- nullable: true
3082
- description: The delivered version, if it has been delivered
3083
- due:
3084
- type: string
3085
- format: date
3086
- amount:
3087
- type: integer
3088
- description: Released on acceptance
3089
- paid:
3090
- type: boolean
3091
- ContractDocument:
3092
- type: object
3093
- required:
3094
- - name
3095
- - kind
3096
- - date
3097
- properties:
3098
- name:
3099
- type: string
3100
- kind:
3101
- type: string
3102
- enum:
3103
- - contract
3104
- - spec
3105
- - sla
3106
- - acceptance
3107
- date:
3108
- type: string
3109
- format: date
3110
- ContractDeliverableInput:
3111
- type: object
3112
- required:
3113
- - name
3114
- - due
3115
- - amount
3116
- properties:
3117
- id:
3118
- type: string
3119
- description: Send back an existing id to keep that deliverable; omitted or unknown ids get a new one
3120
- name:
3121
- type: string
3122
- maxLength: 120
3123
- project_id:
3124
- type: string
3125
- nullable: true
3126
- version:
3127
- type: string
3128
- nullable: true
3129
- maxLength: 32
3130
- pattern: ^[A-Za-z0-9._-]+$
3131
- due:
3132
- type: string
3133
- format: date
3134
- amount:
3135
- type: integer
3136
- minimum: 0
3137
- maximum: 1000000000
3138
- paid:
3139
- type: boolean
3140
- default: false
3141
- ContractInput:
3142
- type: object
3143
- required:
3144
- - title
3145
- - kind
3146
- - status
3147
- - orderer
3148
- - vendor
3149
- - start
3150
- - end
3151
- - amount
3152
- properties:
3153
- title:
3154
- type: string
3155
- maxLength: 160
3156
- description: Bilingual, "ja / en"
3157
- kind:
3158
- type: string
3159
- enum:
3160
- - development
3161
- - maintenance
3162
- status:
3163
- type: string
3164
- enum:
3165
- - draft
3166
- - active
3167
- - completed
3168
- orderer:
3169
- type: string
3170
- maxLength: 100
3171
- vendor:
3172
- type: string
3173
- maxLength: 100
3174
- start:
3175
- type: string
3176
- format: date
3177
- end:
3178
- type: string
3179
- format: date
3180
- description: ">= start"
3181
- amount:
3182
- type: integer
3183
- minimum: 0
3184
- maximum: 100000000000
3185
- oas_url:
3186
- type: string
3187
- format: uri
3188
- nullable: true
3189
- description: http(s) URL of the OpenAPI document
3190
- sla_project_id:
3191
- type: string
3192
- nullable: true
3193
- sla:
3194
- allOf:
3195
- - $ref: "#/components/schemas/ContractSla"
3196
- nullable: true
3197
- description: Operations contracts only. Omit or null for none.
3198
- related:
3199
- type: object
3200
- nullable: true
3201
- description: Link to another contract of the same namespace
3202
- required:
3203
- - id
3204
- - relation
3205
- properties:
3206
- id:
3207
- type: string
3208
- relation:
3209
- type: string
3210
- enum:
3211
- - follows
3212
- - change_order
3213
- deliverables:
3214
- type: array
3215
- maxItems: 20
3216
- items:
3217
- $ref: "#/components/schemas/ContractDeliverableInput"
3218
- documents:
3219
- type: array
3220
- maxItems: 20
3221
- items:
3222
- $ref: "#/components/schemas/ContractDocument"
3223
- Contract:
3224
- type: object
3225
- required:
3226
- - id
3227
- - title
3228
- - kind
3229
- - status
3230
- - orderer
3231
- - vendor
3232
- - start
3233
- - end
3234
- - amount
3235
- - oas_url
3236
- - sla_project_id
3237
- - sla
3238
- - related
3239
- - deliverables
3240
- - documents
3241
- - created_at
3242
- - updated_at
3243
- properties:
3244
- id:
3245
- type: string
3246
- title:
3247
- type: string
3248
- description: Bilingual, "ja / en"
3249
- kind:
3250
- type: string
3251
- enum:
3252
- - development
3253
- - maintenance
3254
- status:
3255
- type: string
3256
- enum:
3257
- - draft
3258
- - active
3259
- - completed
3260
- orderer:
3261
- type: string
3262
- vendor:
3263
- type: string
3264
- start:
3265
- type: string
3266
- format: date
3267
- end:
3268
- type: string
3269
- format: date
3270
- amount:
3271
- type: integer
3272
- oas_url:
3273
- type: string
3274
- format: uri
3275
- nullable: true
3276
- description: The OpenAPI document this contract refers to, as a plain URL
3277
- sla_project_id:
3278
- type: string
3279
- nullable: true
3280
- description: "Operations contracts: the project whose uptime the SLA clause covers"
3281
- sla:
3282
- allOf:
3283
- - $ref: "#/components/schemas/ContractSla"
3284
- nullable: true
3285
- related:
3286
- type: object
3287
- nullable: true
3288
- description: "How this contract relates to another one: it follows a development contract, or is a change order on top of a running one"
3289
- properties:
3290
- id:
3291
- type: string
3292
- relation:
3293
- type: string
3294
- enum:
3295
- - follows
3296
- - change_order
3297
- deliverables:
3298
- type: array
3299
- items:
3300
- $ref: "#/components/schemas/ContractDeliverable"
3301
- documents:
3302
- type: array
3303
- items:
3304
- $ref: "#/components/schemas/ContractDocument"
3305
- created_at:
3306
- type: string
3307
- format: date-time
3308
- updated_at:
3309
- type: string
3310
- format: date-time
3311
2281
  QualityReport:
3312
2282
  type: object
3313
- 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, ...)."
3314
2284
  required:
3315
- - project
2285
+ - spec
3316
2286
  - monitoring
3317
2287
  - built_at
3318
2288
  properties:
3319
- project:
2289
+ spec:
3320
2290
  type: object
3321
2291
  required:
3322
2292
  - name
3323
- - environment
3324
- - components
3325
2293
  - runs
3326
2294
  properties:
3327
2295
  name:
3328
2296
  type: string
3329
- environment:
3330
- type: string
3331
- nullable: true
3332
- components:
3333
- type: array
3334
- items:
3335
- type: object
3336
- properties:
3337
- name:
3338
- type: string
3339
2297
  runs:
3340
2298
  type: array
3341
2299
  items:
@@ -3390,8 +2348,8 @@ components:
3390
2348
  error:
3391
2349
  code: NOT_FOUND
3392
2350
  message: Monitor not found
3393
- ApiVersionRequired:
3394
- 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\""
3395
2353
  content:
3396
2354
  application/json:
3397
2355
  schema:
@@ -3399,8 +2357,64 @@ components:
3399
2357
  example:
3400
2358
  success: false
3401
2359
  error:
3402
- code: API_VERSION_REQUIRED
3403
- 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
3404
2418
  Forbidden:
3405
2419
  description: The caller does not belong to the active organization (`FORBIDDEN`)
3406
2420
  content: