GoogleChrome / GoogleChrome/webstatus.dev

Guard against future web feature schema changes

Open
#510 1 comment 0 reactions 0 assignees View on GitHub
go good first issue hacktoberfest
Dominant language
Go
Stars
254
Forks
62
Avg merge
1d 10h
Merged PRs (30d)
64

Description

# Background

From @past on this [PR](https://github.com/GoogleChrome/webstatus.dev/pull/509)
> Can you guard against future schema changes via assertions or similar? It's better to not display any information if the schema has changed than to silently ingest unexpected data.

The data could lead to use returning things like this from the features API:

```json
...
{
"feature_id": "features",
"name": ""
},
{
"feature_id": "groups",
"name": ""
},
{
"feature_id": "snapshots",
"name": ""
}
...
```

# Definition of done
- [ ] Add a validate helper that is called inside the Parse method for the web feature data.json https://github.com/GoogleChrome/webstatus.dev/blob/6f069fcbd4af4034d7802e724cd225f9a54b2b5f/workflows/steps/services/web_feature_consumer/pkg/data/parser.go#L34-L44
- That validate method should do some additional checks to make sure the data is as expected. If not, return a new error.
- At a minimum, it should check that the names for each feature is not empty.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.