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

Added validation for all types of cfbs.json files and all fields #167

Merged
merged 64 commits into from
Dec 13, 2023

Conversation

olehermanse
Copy link
Member

@olehermanse olehermanse commented Dec 7, 2023

No description provided.

Ticket: CFE-4060
Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
Ticket: CFE-4060
Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
Ticket: CFE-4060
Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
Ticket: CFE-4060
Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
Ticket: CFE-4060
Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
Ticket: CFE-4060
Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
…separately

Ticket: CFE-4060
Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
…e object to only take that module as an argument

Only "dependencies" field needs to reference other modules in the dict.

Ticket: CFE-4060
Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
Ticket: CFE-4060
Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
Changed so the same module validation logic is used for the
different keys ("build", "provides", "index"), and for the
different types of cfbs.json files ("policy-set", "module", "index").

Ticket: CFE-4060
Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
Ticket: CFE-4060
Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
…BSJson

Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
Ticket: CFE-4060
Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
We're now using the same functions for validating all cfbs.json files,
including the index file.

Ticket: CFE-4060
Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
Ticket: CFE-4060
Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
…l lists of accepted fields

Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
…dules

Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
@olehermanse olehermanse removed the request for review from vpodzime December 8, 2023 16:43
@olehermanse olehermanse added the WIP Work in progress label Dec 8, 2023
cfbs/cfbs_config.py Outdated Show resolved Hide resolved
olehermanse and others added 9 commits December 12, 2023 13:03
Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
Co-authored-by: Lars Erik Wik <53906608+larsewi@users.noreply.github.com>
Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
…rray

Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
…alidation

Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
…subtypes

Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
@olehermanse olehermanse changed the title Added a lot more validation for cfbs.json files Added validation for all types of cfbs.json files and all fields Dec 12, 2023
@olehermanse olehermanse removed the WIP Work in progress label Dec 12, 2023
Copy link
Contributor

@craigcomstock craigcomstock left a comment

Choose a reason for hiding this comment

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

after 5f576e3 looks good 👍

tests/test_validate_index_alias.py Outdated Show resolved Hide resolved
Copy link
Contributor

@craigcomstock craigcomstock left a comment

Choose a reason for hiding this comment

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

A few warning message suggestions. Looks good.

cfbs/validate.py Outdated Show resolved Hide resolved
cfbs/validate.py Outdated Show resolved Hide resolved
cfbs/validate.py Outdated Show resolved Hide resolved
cfbs/validate.py Outdated Show resolved Hide resolved
olehermanse and others added 2 commits December 12, 2023 17:18
Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
Code review suggestions from @craigcomstock

Co-authored-by: Craig Comstock <craig.comstock@northern.tech>
Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
cfbs/validate.py Outdated Show resolved Hide resolved
Co-authored-by: Lars Erik Wik <53906608+larsewi@users.noreply.github.com>
@olehermanse olehermanse merged commit 3e5b263 into cfengine:master Dec 13, 2023
7 checks passed
@olehermanse olehermanse deleted the validation branch December 13, 2023 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants