Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate features #736

Merged
merged 45 commits into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
f6542d4
check vendor present in index
LDannijs Jan 11, 2024
38d5d23
validate single vendor
LDannijs Jan 11, 2024
170a1a3
add vendorprofileid check
LDannijs Jan 11, 2024
dfe546a
update PULL_REQUEST_TEMPLATE
LDannijs Jan 11, 2024
1514143
remove some vendorprofileID checks
LDannijs Jan 12, 2024
453edd8
clearer error and prettier
LDannijs Jan 12, 2024
1a4ac1a
update all profileVendorID to be unique per vendor
LDannijs Jan 12, 2024
e49eeb4
improve vendorProfileID explanation further
LDannijs Jan 12, 2024
192e31b
validate specific vendor README update
LDannijs Jan 12, 2024
ecd801e
Add pre-commit hook for validation
LDannijs Jan 29, 2024
192f421
run validate and fmt
LDannijs Jan 29, 2024
03356bd
Merge branch 'TheThingsNetwork:master' into validate-features
LDannijs Jan 29, 2024
0d73eef
update nexelec vendorprofileid
LDannijs Jan 29, 2024
5e7d343
install pre-commit hooks with make deps
LDannijs Feb 7, 2024
2ff120a
add feedback
LDannijs Feb 7, 2024
64a7da4
Revert update all profileVendorID to be unique per vendor
LDannijs Feb 7, 2024
bfb1c0c
Revert update nexelec vendorprofileid
LDannijs Feb 7, 2024
3f865d8
update all vendorProfileID
LDannijs Feb 7, 2024
0662d56
Merge remote-tracking branch 'upstream/master' into validate-features
LDannijs Feb 7, 2024
695ca99
update vendor-id to VENDOR_ID
LDannijs Feb 12, 2024
a378aaf
fix vendor_id again
LDannijs Feb 14, 2024
0ae4f5a
remove duplicate index check
LDannijs Feb 28, 2024
78355b9
remove vendorProfileID and add profileIDs
LDannijs Feb 28, 2024
214f025
Merge branch 'master' into validate-features
LDannijs Feb 29, 2024
8a599b1
validate
LDannijs Feb 29, 2024
dd161cf
add all hardwareVersion & update schema
LDannijs Feb 29, 2024
5deead7
delete temp script
LDannijs Feb 29, 2024
c971618
Merge branch 'master' into validate-features
LDannijs Mar 1, 2024
153537c
fixes and update
LDannijs Mar 1, 2024
3eace04
Merge branch 'TheThingsNetwork:master' into validate-features
LDannijs Mar 1, 2024
f76ce76
update ks-technologies
LDannijs Mar 1, 2024
c585ab8
update README & example
LDannijs Mar 1, 2024
e5e9c20
Merge branch 'master' into validate-features
LDannijs Mar 6, 2024
6ca9f09
Add vendorProfileID deprecation message
LDannijs Mar 6, 2024
479c9fb
Merge branch 'master' into validate-features
LDannijs Mar 13, 2024
cd0e2e2
fix profileIDs
LDannijs Mar 13, 2024
929d25d
update profileID
LDannijs Mar 20, 2024
91c3187
Merge branch 'master' into validate-features
LDannijs Mar 20, 2024
7a83a9d
fix vendor in index
LDannijs Mar 25, 2024
58e2dc2
Merge branch 'master' into validate-features
LDannijs Mar 25, 2024
71e0caa
Merge branch 'master' into validate-features
johanstokking Mar 26, 2024
2c2d18b
Merge branch 'master' into validate-features
LDannijs Apr 3, 2024
e8f8de3
Merge branch 'master' into validate-features
Jaime-Trinidad Apr 5, 2024
e03a07f
Merge branch 'TheThingsNetwork:master' into validate-features
LDannijs Apr 9, 2024
dac4dec
Merge branch 'master' into validate-features
Jaime-Trinidad Apr 11, 2024
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
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ GO = go
GOBIN = $(PWD)/bin
export GOBIN

vendor-id=
VENDOR_ID=

.PHONY: default
default: validate
Expand All @@ -37,7 +37,7 @@ deps.update:

.PHONY: validate
validate:
@if [ -z "${vendor-id}" ]; then $(NPM) run validate; else $(NPM) run validate -- --vendor-id $(vendor-id); fi
@if [ -z "${VENDOR_ID}" ]; then $(NPM) run validate; else $(NPM) run validate -- --VENDOR_ID $(VENDOR_ID); fi
johanstokking marked this conversation as resolved.
Show resolved Hide resolved

.PHONY: fmt
fmt:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ $ make validate
The validation also supports validating a single vendor's files:

```bash
$ make validate vendor-id=<id-of-vendor>
$ make validate VENDOR_ID=<id-of-vendor>
```

[Visual Studio Code](https://code.visualstudio.com/) is a great editor for editing the Device Repository. You can validate your data automatically using the [YAML plugin](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml).
Expand Down
6 changes: 3 additions & 3 deletions bin/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ const imageType = require('image-type');
const ajv = new Ajv({ schemas: [require('../lib/payload.json'), require('../schema.json')] });

const options = yargs
.usage('Usage: --vendor <file> [--vendor-id <id>]')
.usage('Usage: --vendor <file> [--VENDOR_ID <id>]')
.option('v', {
alias: 'vendor',
describe: 'Path to vendor index file',
type: 'string',
demandOption: true,
default: './vendor/index.yaml',
})
.option('vendor-id', {
.option('VENDOR_ID', {
describe: 'Specific vendor ID to validate',
type: 'string',
}).argv;
Expand Down Expand Up @@ -255,7 +255,7 @@ console.log(`vendor index: valid`);

const vendorProfiles = {};

const vendorIDToValidate = options['vendor-id'];
const vendorIDToValidate = options['VENDOR_ID'];

if (vendorIDToValidate && !vendors.vendors.some((v) => v.id === vendorIDToValidate)) {
console.error(`Specified vendor ID '${vendorIDToValidate}' does not exist in the repository.`);
Expand Down
Loading