Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Comment on lines +10 to +13
Copy link

@coderabbitai coderabbitai bot Mar 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# List the repository structure to understand layout
echo "=== Repository structure ==="
git ls-files | head -30

# Find proto, swagger, or API definition files
echo -e "\n=== Searching for contract files ==="
fd -e proto -e swagger.json -e swagger.yaml -e openapi.json -o --type f

# Find CHANGELOG and related files
echo -e "\n=== Changelog and release files ==="
fd -i changelog -o --type f | head -20

Repository: scanoss/papi

Length of output: 1273


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Search for ComponentStatus and VersionStatus definitions
echo "=== ComponentStatus and VersionStatus in proto files ==="
rg -n 'message (ComponentStatus|VersionStatus)' --type-list | head -5
rg -n 'message (ComponentStatus|VersionStatus)' -A 20

# Search for check_date and status_change_date occurrences
echo -e "\n=== Occurrences of check_date and status_change_date ==="
rg -n 'check_date|status_change_date'

# Look for backward compatibility hints (deprecated, json_name, reserved)
echo -e "\n=== Backward compatibility markers ==="
rg -n 'deprecated|json_name|reserved' -B 2 -A 2 | grep -E '(check_date|status_change_date|ComponentStatus|VersionStatus)' -B 5 -A 5

Repository: scanoss/papi

Length of output: 519


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Find all .proto source files
echo "=== Proto source files ==="
find . -name "*.proto" -type f

# Check for a proto directory
echo -e "\n=== Directory structure of api/ ==="
ls -la api/ 2>/dev/null | head -20

Repository: scanoss/papi

Length of output: 1616


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Search for ComponentStatus and VersionStatus in proto compiled files
echo "=== ComponentStatus definition ==="
rg -n 'type ComponentStatus' api/

# Search for check_date and status_change_date
echo -e "\n=== check_date and status_change_date occurrences ==="
rg -n 'check_date\|status_change_date'

# Look at full CHANGELOG to understand link structure
echo -e "\n=== CHANGELOG.md content (check for [0.31.1] reference) ==="
cat CHANGELOG.md

Repository: scanoss/papi

Length of output: 427


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Examine the proto source for ComponentStatus and VersionStatus
echo "=== scanoss-components.proto - ComponentStatus and VersionStatus ==="
rg -n 'message ComponentStatus|message VersionStatus' -A 15 ./protobuf/scanoss/api/components/v2/scanoss-components.proto

# Look for any field called check_date or status_change_date in proto
echo -e "\n=== Fields in ComponentStatus/VersionStatus ==="
rg -n 'check_date|status_change_date|reserved|json_name' ./protobuf/scanoss/api/components/v2/scanoss-components.proto

Repository: scanoss/papi

Length of output: 5267


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Read the CHANGELOG.md to check link references and context
echo "=== Full CHANGELOG.md ==="
cat CHANGELOG.md

Repository: scanoss/papi

Length of output: 13344


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Double-check: search in all files including pb.go for check_date
echo "=== Comprehensive search for 'check_date' in entire repository ==="
rg 'check_date' . || echo "No results found for check_date"

# Verify the missing [0.31.1] link at bottom of CHANGELOG
echo -e "\n=== End of CHANGELOG.md (last 20 lines) ==="
tail -20 CHANGELOG.md

Repository: scanoss/papi

Length of output: 1594


Add missing [0.31.1] version reference link to CHANGELOG.

The version [0.31.1] is referenced in the header but not defined in the reference links section at the end of the file. Add:

[0.31.1]: https://github.com/scanoss/papi/compare/v0.31.0...v0.31.1

Additionally, the changelog entry states "Renamed check_date to status_change_date," but this field rename does not appear to exist in the codebase. The proto definitions already contain status_change_date fields with no trace of a check_date field. Verify and correct the changelog description to accurately reflect the actual changes made in this version.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@CHANGELOG.md` around lines 9 - 12, The CHANGELOG entry for [0.31.1] is
missing its reference link and contains an incorrect claim about renaming
check_date to status_change_date; add the missing reference line "[0.31.1]:
https://github.com/scanoss/papi/compare/v0.31.0...v0.31.1" to the references
section, and update the release notes for ComponentStatus and VersionStatus to
accurately reflect the real change (e.g., remove the "Renamed `check_date` to
`status_change_date`" sentence or replace it with a correct description such as
"ensured `status_change_date` exists" or "no-op—field already named
`status_change_date`" after verifying the proto definitions) so the text matches
the codebase.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@scanoss-qg shoul we add this suggestion?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That text is already there! there was a typo on protobuff


## [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
Expand Down Expand Up @@ -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
Expand Down
124 changes: 70 additions & 54 deletions api/componentsv2/scanoss-components.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 16 additions & 14 deletions protobuf/scanoss/api/components/v2/scanoss-components.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"];
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Verify proto declaration
echo "=== Proto declaration ==="
rg -n 'status_change_date|status_change_indexed_date' protobuf/scanoss/api/components/v2/scanoss-components.proto

# Verify generated Go protobuf tags
echo ""
echo "=== Generated Go protobuf tags ==="
rg -n 'StatusChangeDate|status_change_indexed_date|status_change_date' api/componentsv2/scanoss-components.pb.go

# Verify swagger/public schema field names
echo ""
echo "=== Swagger schema ==="
rg -n 'status_change_date|status_change_indexed_date' protobuf/scanoss/api/components/v2/scanoss-components.swagger.json

Repository: scanoss/papi

Length of output: 3093


Fix protobuf tag mismatch in generated Go code for ComponentStatus.

At line 793 of api/componentsv2/scanoss-components.pb.go, the StatusChangeDate field has a conflicting protobuf tag: json=status_change_indexed_date in the protobuf directive, but the JSON struct tag declares json:"status_change_date". The proto file correctly declares json_name = "status_change_date" (line 220), but the generated Go code for ComponentStatus does not match. Meanwhile, the VersionStatus struct at line 694 is correct. Regenerate the protobuf artifacts to align all generated outputs.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@protobuf/scanoss/api/components/v2/scanoss-components.proto` at line 220, The
generated Go proto for ComponentStatus has a mismatched JSON tag for
StatusChangeDate; regenerate the protobuf artifacts from
scanoss-components.proto (which correctly declares optional string
status_change_date = 5 [json_name = "status_change_date"]) so the
ComponentStatus struct's StatusChangeDate field JSON tag matches
"status_change_date" like VersionStatus does; run the protoc command (with the
same plugins/options you used originally) to recompile scanoss-components.proto
and replace the stale api/componentsv2/scanoss-components.pb.go output, then run
tests/formatting checks to ensure the JSON tags for StatusChangeDate in
ComponentStatus now match the proto definition.

// 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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down