diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a7ea11..84d70a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.31.1] - 2026-03-05 +### Fixed +- Marked as optional information several keys for `ComponentStatus and VersionStatus` +- Renamed `check_date` to `status_change_date` on `ComponentStatus and VersionStatus` + ## [0.31.0] - 2026-02-24 ### Added - Added gRPC `GetComponentStatus` and REST endpoint GET `/v2/components/status/component` for retrieving lifecycle status of a single component @@ -237,7 +242,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Dependencies - Vulnerabilities - Added REST endpoint support for each service also - +[0.31.1]: https://github.com/scanoss/papi/compare/v0.31.0...v0.31.1 [0.31.0]: https://github.com/scanoss/papi/compare/v0.30.0...v0.31.0 [0.30.0]: https://github.com/scanoss/papi/compare/v0.29.0...v0.30.0 [0.29.0]: https://github.com/scanoss/papi/compare/v0.28.0...v0.29.0 diff --git a/api/componentsv2/scanoss-components.pb.go b/api/componentsv2/scanoss-components.pb.go index 38b2667..157a54f 100644 --- a/api/componentsv2/scanoss-components.pb.go +++ b/api/componentsv2/scanoss-components.pb.go @@ -685,13 +685,13 @@ type ComponentStatusResponse_VersionStatus struct { // Specific version name Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` // Development status of the requested version of this component classified automatically - Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` + Status *string `protobuf:"bytes,2,opt,name=status,proto3,oneof" json:"status,omitempty"` // Raw status reported by the registry for this version - RepositoryStatus string `protobuf:"bytes,3,opt,name=repository_status,proto3" json:"repository_status,omitempty"` + RepositoryStatus *string `protobuf:"bytes,3,opt,name=repository_status,proto3,oneof" json:"repository_status,omitempty"` // Date that the component was indexed - IndexedDate string `protobuf:"bytes,4,opt,name=indexed_date,proto3" json:"indexed_date,omitempty"` - // Date that the status was checked - CheckDate string `protobuf:"bytes,5,opt,name=check_date,proto3" json:"check_date,omitempty"` + IndexedDate *string `protobuf:"bytes,4,opt,name=indexed_date,proto3,oneof" json:"indexed_date,omitempty"` + // Date that the status changed or change was detected + StatusChangeDate *string `protobuf:"bytes,5,opt,name=status_change_date,proto3,oneof" json:"status_change_date,omitempty"` // States if something went wrong while searching for the version of this component version in the DB ErrorMessage *string `protobuf:"bytes,6,opt,name=error_message,proto3,oneof" json:"error_message,omitempty"` ErrorCode *commonv2.ErrorCode `protobuf:"varint,7,opt,name=error_code,proto3,enum=scanoss.api.common.v2.ErrorCode,oneof" json:"error_code,omitempty"` @@ -737,29 +737,29 @@ func (x *ComponentStatusResponse_VersionStatus) GetVersion() string { } func (x *ComponentStatusResponse_VersionStatus) GetStatus() string { - if x != nil { - return x.Status + if x != nil && x.Status != nil { + return *x.Status } return "" } func (x *ComponentStatusResponse_VersionStatus) GetRepositoryStatus() string { - if x != nil { - return x.RepositoryStatus + if x != nil && x.RepositoryStatus != nil { + return *x.RepositoryStatus } return "" } func (x *ComponentStatusResponse_VersionStatus) GetIndexedDate() string { - if x != nil { - return x.IndexedDate + if x != nil && x.IndexedDate != nil { + return *x.IndexedDate } return "" } -func (x *ComponentStatusResponse_VersionStatus) GetCheckDate() string { - if x != nil { - return x.CheckDate +func (x *ComponentStatusResponse_VersionStatus) GetStatusChangeDate() string { + if x != nil && x.StatusChangeDate != nil { + return *x.StatusChangeDate } return "" } @@ -782,16 +782,18 @@ func (x *ComponentStatusResponse_VersionStatus) GetErrorCode() commonv2.ErrorCod type ComponentStatusResponse_ComponentStatus struct { state protoimpl.MessageState `protogen:"open.v1"` // Development status of the requested component classified automatically - Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + Status *string `protobuf:"bytes,1,opt,name=status,proto3,oneof" json:"status,omitempty"` // Raw status reported by the registry for this component - RepositoryStatus string `protobuf:"bytes,2,opt,name=repository_status,proto3" json:"repository_status,omitempty"` + RepositoryStatus *string `protobuf:"bytes,2,opt,name=repository_status,proto3,oneof" json:"repository_status,omitempty"` // Date of the first time component was indexed - FirstIndexedDate string `protobuf:"bytes,3,opt,name=first_indexed_date,proto3" json:"first_indexed_date,omitempty"` + FirstIndexedDate *string `protobuf:"bytes,3,opt,name=first_indexed_date,proto3,oneof" json:"first_indexed_date,omitempty"` // Date of the last time component was indexed - LastIndexedDate string `protobuf:"bytes,4,opt,name=last_indexed_date,proto3" json:"last_indexed_date,omitempty"` + LastIndexedDate *string `protobuf:"bytes,4,opt,name=last_indexed_date,proto3,oneof" json:"last_indexed_date,omitempty"` + // Date of the last detected change + StatusChangeDate *string `protobuf:"bytes,5,opt,name=status_change_date,json=status_change_indexed_date,proto3,oneof" json:"status_change_date,omitempty"` // States if something went wrong while searching for the version of this component in the DB - ErrorMessage *string `protobuf:"bytes,5,opt,name=error_message,proto3,oneof" json:"error_message,omitempty"` - ErrorCode *commonv2.ErrorCode `protobuf:"varint,6,opt,name=error_code,proto3,enum=scanoss.api.common.v2.ErrorCode,oneof" json:"error_code,omitempty"` + ErrorMessage *string `protobuf:"bytes,6,opt,name=error_message,proto3,oneof" json:"error_message,omitempty"` + ErrorCode *commonv2.ErrorCode `protobuf:"varint,7,opt,name=error_code,proto3,enum=scanoss.api.common.v2.ErrorCode,oneof" json:"error_code,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -827,29 +829,36 @@ func (*ComponentStatusResponse_ComponentStatus) Descriptor() ([]byte, []int) { } func (x *ComponentStatusResponse_ComponentStatus) GetStatus() string { - if x != nil { - return x.Status + if x != nil && x.Status != nil { + return *x.Status } return "" } func (x *ComponentStatusResponse_ComponentStatus) GetRepositoryStatus() string { - if x != nil { - return x.RepositoryStatus + if x != nil && x.RepositoryStatus != nil { + return *x.RepositoryStatus } return "" } func (x *ComponentStatusResponse_ComponentStatus) GetFirstIndexedDate() string { - if x != nil { - return x.FirstIndexedDate + if x != nil && x.FirstIndexedDate != nil { + return *x.FirstIndexedDate } return "" } func (x *ComponentStatusResponse_ComponentStatus) GetLastIndexedDate() string { - if x != nil { - return x.LastIndexedDate + if x != nil && x.LastIndexedDate != nil { + return *x.LastIndexedDate + } + return "" +} + +func (x *ComponentStatusResponse_ComponentStatus) GetStatusChangeDate() string { + if x != nil && x.StatusChangeDate != nil { + return *x.StatusChangeDate } return "" } @@ -1179,46 +1188,53 @@ const file_scanoss_api_components_v2_scanoss_components_proto_rawDesc = "" + "\n" + "statistics\x18\x03 \x01(\v2(.scanoss.api.components.v2.CompStatisticR\n" + "statistics:\xea\x02\x92A\xe6\x02\n" + - "\xe3\x02J\xe0\x02{\"component_statistics\": [{\"purl\": \"pkg:github/scanoss/engine@5.0.0\", \"version\": \"5.0.0\", \"statistics\": {\"total_source_files\": 156, \"total_lines\": 25430, \"total_blank_lines\": 3420, \"languages\": [{\"name\": \"C\", \"files\": 89}, {\"name\": \"C Header\", \"files\": 45}]}}], \"status\": {\"status\": \"SUCCESS\", \"message\": \"Component statistics successfully retrieved\"}}\"\xab\n" + - "\n" + + "\xe3\x02J\xe0\x02{\"component_statistics\": [{\"purl\": \"pkg:github/scanoss/engine@5.0.0\", \"version\": \"5.0.0\", \"statistics\": {\"total_source_files\": 156, \"total_lines\": 25430, \"total_blank_lines\": 3420, \"languages\": [{\"name\": \"C\", \"files\": 89}, {\"name\": \"C Header\", \"files\": 45}]}}], \"status\": {\"status\": \"SUCCESS\", \"message\": \"Component statistics successfully retrieved\"}}\"\xd6\f\n" + "\x17ComponentStatusResponse\x12\x12\n" + "\x04purl\x18\x01 \x01(\tR\x04purl\x12\x12\n" + "\x04name\x18\x02 \x01(\tR\x04name\x12 \n" + "\vrequirement\x18\x03 \x01(\tR\vrequirement\x12h\n" + "\x0eversion_status\x18\x04 \x01(\v2@.scanoss.api.components.v2.ComponentStatusResponse.VersionStatusR\x0eversion_status\x12n\n" + - "\x10component_status\x18\x05 \x01(\v2B.scanoss.api.components.v2.ComponentStatusResponse.ComponentStatusR\x10component_status\x1a\xc6\x02\n" + + "\x10component_status\x18\x05 \x01(\v2B.scanoss.api.components.v2.ComponentStatusResponse.ComponentStatusR\x10component_status\x1a\xb3\x03\n" + "\rVersionStatus\x12\x18\n" + - "\aversion\x18\x01 \x01(\tR\aversion\x12\x16\n" + - "\x06status\x18\x02 \x01(\tR\x06status\x12,\n" + - "\x11repository_status\x18\x03 \x01(\tR\x11repository_status\x12\"\n" + - "\findexed_date\x18\x04 \x01(\tR\findexed_date\x12\x1e\n" + - "\n" + - "check_date\x18\x05 \x01(\tR\n" + - "check_date\x12)\n" + - "\rerror_message\x18\x06 \x01(\tH\x00R\rerror_message\x88\x01\x01\x12E\n" + + "\aversion\x18\x01 \x01(\tR\aversion\x12\x1b\n" + + "\x06status\x18\x02 \x01(\tH\x00R\x06status\x88\x01\x01\x121\n" + + "\x11repository_status\x18\x03 \x01(\tH\x01R\x11repository_status\x88\x01\x01\x12'\n" + + "\findexed_date\x18\x04 \x01(\tH\x02R\findexed_date\x88\x01\x01\x123\n" + + "\x12status_change_date\x18\x05 \x01(\tH\x03R\x12status_change_date\x88\x01\x01\x12)\n" + + "\rerror_message\x18\x06 \x01(\tH\x04R\rerror_message\x88\x01\x01\x12E\n" + "\n" + - "error_code\x18\a \x01(\x0e2 .scanoss.api.common.v2.ErrorCodeH\x01R\n" + - "error_code\x88\x01\x01B\x10\n" + + "error_code\x18\a \x01(\x0e2 .scanoss.api.common.v2.ErrorCodeH\x05R\n" + + "error_code\x88\x01\x01B\t\n" + + "\a_statusB\x14\n" + + "\x12_repository_statusB\x0f\n" + + "\r_indexed_dateB\x15\n" + + "\x13_status_change_dateB\x10\n" + "\x0e_error_messageB\r\n" + - "\v_error_code\x1a\xc8\x02\n" + - "\x0fComponentStatus\x12\x16\n" + - "\x06status\x18\x01 \x01(\tR\x06status\x12,\n" + - "\x11repository_status\x18\x02 \x01(\tR\x11repository_status\x12.\n" + - "\x12first_indexed_date\x18\x03 \x01(\tR\x12first_indexed_date\x12,\n" + - "\x11last_indexed_date\x18\x04 \x01(\tR\x11last_indexed_date\x12)\n" + - "\rerror_message\x18\x05 \x01(\tH\x00R\rerror_message\x88\x01\x01\x12E\n" + + "\v_error_code\x1a\xfe\x03\n" + + "\x0fComponentStatus\x12\x1b\n" + + "\x06status\x18\x01 \x01(\tH\x00R\x06status\x88\x01\x01\x121\n" + + "\x11repository_status\x18\x02 \x01(\tH\x01R\x11repository_status\x88\x01\x01\x123\n" + + "\x12first_indexed_date\x18\x03 \x01(\tH\x02R\x12first_indexed_date\x88\x01\x01\x121\n" + + "\x11last_indexed_date\x18\x04 \x01(\tH\x03R\x11last_indexed_date\x88\x01\x01\x12;\n" + + "\x12status_change_date\x18\x05 \x01(\tH\x04R\x1astatus_change_indexed_date\x88\x01\x01\x12)\n" + + "\rerror_message\x18\x06 \x01(\tH\x05R\rerror_message\x88\x01\x01\x12E\n" + "\n" + - "error_code\x18\x06 \x01(\x0e2 .scanoss.api.common.v2.ErrorCodeH\x01R\n" + - "error_code\x88\x01\x01B\x10\n" + + "error_code\x18\a \x01(\x0e2 .scanoss.api.common.v2.ErrorCodeH\x06R\n" + + "error_code\x88\x01\x01B\t\n" + + "\a_statusB\x14\n" + + "\x12_repository_statusB\x15\n" + + "\x13_first_indexed_dateB\x14\n" + + "\x12_last_indexed_dateB\x15\n" + + "\x13_status_change_dateB\x10\n" + "\x0e_error_messageB\r\n" + - "\v_error_code:\xd7\x02\x92A\xd3\x02\n" + - "\xd0\x02J\xcd\x02{\"purl\": \"pkg:npm/strive-molu-axios\",\"name\": \"strive-molu-axios\", \"requirement\": \"^0.0.1\", \"version_status\": {\"version\": \"0.0.1-beta.1\", \"status\": \"deleted\", \"indexed_date\": \"2024-06-21\", \"check_date\": \"2026-02-01\" }, \"component_status\": { \"status\": \"active\", \"first_indexed_date\": \"2022-03-01\", \"last_indexed_date\": \"2026-02-15\" } }\"\x9b\x04\n" + + "\v_error_code:\xdf\x02\x92A\xdb\x02\n" + + "\xd8\x02J\xd5\x02{\"purl\": \"pkg:npm/strive-molu-axios\",\"name\": \"strive-molu-axios\", \"requirement\": \"^0.0.1\", \"version_status\": {\"version\": \"0.0.1-beta.1\", \"status\": \"deleted\", \"indexed_date\": \"2024-06-21\", \"status_change_date\": \"2026-02-01\" }, \"component_status\": { \"status\": \"active\", \"first_indexed_date\": \"2022-03-01\", \"last_indexed_date\": \"2026-02-15\" } }\"\xa3\x04\n" + "\x18ComponentsStatusResponse\x12R\n" + "\n" + "components\x18\x01 \x03(\v22.scanoss.api.components.v2.ComponentStatusResponseR\n" + "components\x12=\n" + - "\x06status\x18\x02 \x01(\v2%.scanoss.api.common.v2.StatusResponseR\x06status:\xeb\x02\x92A\xe7\x02\n" + - "\xe4\x02J\xe1\x02{\"components\": [{\"purl\": \"pkg:npm/strive-molu-axios\",\"name\": \"strive-molu-axios\", \"requirement\": \"^0.0.1\", \"version_status\": {\"version\": \"0.0.1-beta.1\", \"status\": \"deleted\", \"indexed_date\": \"2024-06-21\", \"check_date\": \"2026-02-01\" }, \"component_status\": { \"status\": \"active\", \"first_indexed_date\": \"2022-03-01\", \"last_indexed_date\": \"2026-02-15\" } } ] }\"\x8b\x05\n" + + "\x06status\x18\x02 \x01(\v2%.scanoss.api.common.v2.StatusResponseR\x06status:\xf3\x02\x92A\xef\x02\n" + + "\xec\x02J\xe9\x02{\"components\": [{\"purl\": \"pkg:npm/strive-molu-axios\",\"name\": \"strive-molu-axios\", \"requirement\": \"^0.0.1\", \"version_status\": {\"version\": \"0.0.1-beta.1\", \"status\": \"deleted\", \"indexed_date\": \"2024-06-21\", \"status_change_date\": \"2026-02-01\" }, \"component_status\": { \"status\": \"active\", \"first_indexed_date\": \"2022-03-01\", \"last_indexed_date\": \"2026-02-15\" } } ] }\"\x8b\x05\n" + "\x12CompSearchResponse\x12W\n" + "\n" + "components\x18\x01 \x03(\v27.scanoss.api.components.v2.CompSearchResponse.ComponentR\n" + diff --git a/protobuf/scanoss/api/components/v2/scanoss-components.proto b/protobuf/scanoss/api/components/v2/scanoss-components.proto index 5063560..0637602 100644 --- a/protobuf/scanoss/api/components/v2/scanoss-components.proto +++ b/protobuf/scanoss/api/components/v2/scanoss-components.proto @@ -180,7 +180,7 @@ message ComponentsStatisticResponse { message ComponentStatusResponse { option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { json_schema: { - example: "{\"purl\": \"pkg:npm/strive-molu-axios\",\"name\": \"strive-molu-axios\", \"requirement\": \"^0.0.1\", \"version_status\": {\"version\": \"0.0.1-beta.1\", \"status\": \"deleted\", \"indexed_date\": \"2024-06-21\", \"check_date\": \"2026-02-01\" }, \"component_status\": { \"status\": \"active\", \"first_indexed_date\": \"2022-03-01\", \"last_indexed_date\": \"2026-02-15\" } }" ; + example: "{\"purl\": \"pkg:npm/strive-molu-axios\",\"name\": \"strive-molu-axios\", \"requirement\": \"^0.0.1\", \"version_status\": {\"version\": \"0.0.1-beta.1\", \"status\": \"deleted\", \"indexed_date\": \"2024-06-21\", \"status_change_date\": \"2026-02-01\" }, \"component_status\": { \"status\": \"active\", \"first_indexed_date\": \"2022-03-01\", \"last_indexed_date\": \"2026-02-15\" } }" ; } }; // Purl requested @@ -195,30 +195,32 @@ message ComponentStatusResponse { // Specific version name string version = 1; // Development status of the requested version of this component classified automatically - string status = 2; + optional string status = 2; // Raw status reported by the registry for this version - string repository_status = 3[json_name = "repository_status"]; + optional string repository_status = 3[json_name = "repository_status"]; // Date that the component was indexed - string indexed_date = 4 [json_name = "indexed_date"]; - // Date that the status was checked - string check_date = 5 [json_name = "check_date"]; + optional string indexed_date = 4 [json_name = "indexed_date"]; + // Date that the status changed or change was detected + optional string status_change_date = 5 [json_name = "status_change_date"]; // States if something went wrong while searching for the version of this component version in the DB - optional string error_message = 6[json_name = "error_message"]; + optional string error_message = 6 [json_name = "error_message"]; optional common.v2.ErrorCode error_code = 7 [json_name = "error_code"]; } // Component status details (ignoring version) message ComponentStatus { // Development status of the requested component classified automatically - string status = 1; + optional string status = 1; // Raw status reported by the registry for this component - string repository_status = 2 [json_name = "repository_status"]; + optional string repository_status = 2 [json_name = "repository_status"]; // Date of the first time component was indexed - string first_indexed_date = 3 [json_name = "first_indexed_date"]; + optional string first_indexed_date = 3 [json_name = "first_indexed_date"]; // Date of the last time component was indexed - string last_indexed_date = 4 [json_name = "last_indexed_date"]; + optional string last_indexed_date = 4 [json_name = "last_indexed_date"]; + // Date of the last detected change + optional string status_change_date = 5 [json_name = "status_change_date"]; // States if something went wrong while searching for the version of this component in the DB - optional string error_message = 5 [json_name = "error_message"]; - optional common.v2.ErrorCode error_code = 6 [json_name = "error_code"]; + optional string error_message = 6 [json_name = "error_message"]; + optional common.v2.ErrorCode error_code = 7 [json_name = "error_code"]; } // Information about the requested version. If no requirement is described, the latest version of the component is responded @@ -233,7 +235,7 @@ message ComponentStatusResponse { message ComponentsStatusResponse { option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { json_schema: { - example: "{\"components\": [{\"purl\": \"pkg:npm/strive-molu-axios\",\"name\": \"strive-molu-axios\", \"requirement\": \"^0.0.1\", \"version_status\": {\"version\": \"0.0.1-beta.1\", \"status\": \"deleted\", \"indexed_date\": \"2024-06-21\", \"check_date\": \"2026-02-01\" }, \"component_status\": { \"status\": \"active\", \"first_indexed_date\": \"2022-03-01\", \"last_indexed_date\": \"2026-02-15\" } } ] }" ; + example: "{\"components\": [{\"purl\": \"pkg:npm/strive-molu-axios\",\"name\": \"strive-molu-axios\", \"requirement\": \"^0.0.1\", \"version_status\": {\"version\": \"0.0.1-beta.1\", \"status\": \"deleted\", \"indexed_date\": \"2024-06-21\", \"status_change_date\": \"2026-02-01\" }, \"component_status\": { \"status\": \"active\", \"first_indexed_date\": \"2022-03-01\", \"last_indexed_date\": \"2026-02-15\" } } ] }" ; } }; // Component status diff --git a/protobuf/scanoss/api/components/v2/scanoss-components.swagger.json b/protobuf/scanoss/api/components/v2/scanoss-components.swagger.json index 343b8d1..737e0b5 100644 --- a/protobuf/scanoss/api/components/v2/scanoss-components.swagger.json +++ b/protobuf/scanoss/api/components/v2/scanoss-components.swagger.json @@ -372,6 +372,10 @@ "type": "string", "title": "Date of the last time component was indexed" }, + "status_change_date": { + "type": "string", + "title": "Date of the last detected change" + }, "error_message": { "type": "string", "title": "States if something went wrong while searching for the version of this component in the DB" @@ -401,9 +405,9 @@ "type": "string", "title": "Date that the component was indexed" }, - "check_date": { + "status_change_date": { "type": "string", - "title": "Date that the status was checked" + "title": "Date that the status changed or change was detected" }, "error_message": { "type": "string", @@ -676,7 +680,7 @@ "version": "0.0.1-beta.1", "status": "deleted", "indexed_date": "2024-06-21", - "check_date": "2026-02-01" + "status_change_date": "2026-02-01" }, "component_status": { "status": "active", @@ -792,7 +796,7 @@ "version": "0.0.1-beta.1", "status": "deleted", "indexed_date": "2024-06-21", - "check_date": "2026-02-01" + "status_change_date": "2026-02-01" }, "component_status": { "status": "active",