-
Notifications
You must be signed in to change notification settings - Fork 9
Description
Describe the bug
When creating a new probe via [POST] /v1beta1/assets/{asset_urn}/probes, timestamp field is not required hence we can submit without it.
This causes confusion, especially when fetching the latest probe via [GET] /v1beta1/lineage/{asset_urn}.
{
"data": [
{
"source": "sample-urn",
"target": "sample-urn-2"
}
],
"node_attrs": {
"sample-urn": {
"probes": {
"latest": {
"id": "239c0a6a-821c-4312-bcb5-f0b112435408",
"asset_urn": "sample-urn",
"status": "STARTING",
"status_reason": "Test Reason",
"metadata": {
"is_test": true,
"test_id": 1,
"type": "test"
},
"timestamp": "1970-01-01T00:00:00Z",
"created_at": "2022-10-27T09:56:38.339542Z"
}
}
}
}
}
From the response, we can see that node_attrs["sample_urn"].probes.latest.timestamp is 1970-01-01T00:00:00Z, which is a default value for time in Golang.
Client will not be sure which timestamp to use, timestamp or created_at.
If client wants to use created_at if timestamp is not defined, it will have trouble figuring out if timestamp is empty or not because Compass returns default time value instead of null or not all.
To Reproduce
Steps to reproduce the behavior:
- Create an asset
- Create a probe for that asset without timestamp field (
[POST] /v1beta1/assets/{asset_urn}/probes) - Fetch lineage of the asset
- See timestamp is set as default time value
Expected behavior
Ideally Compass should either
- make
timestampas a required field when creating probe, or - set
timestampascreated_atif it not submitted by client