feat: Include hardware registry info into DB via django command#1905
Open
alanpeixinho wants to merge 1 commit into
Open
feat: Include hardware registry info into DB via django command#1905alanpeixinho wants to merge 1 commit into
alanpeixinho wants to merge 1 commit into
Conversation
Comment on lines
+66
to
+78
| missing = [k for k in EXPECTED_SECTIONS if k not in data] | ||
| if missing: | ||
| self.stderr.write( | ||
| self.style.WARNING( | ||
| "Missing typical hardware-registry sections : {', '.join(missing)}" | ||
| ) | ||
| ) | ||
|
|
||
| silicon_vendors = data["silicon_vendors"] | ||
| platform_vendors = data["platform_vendors"] | ||
| processors = data["processors"] | ||
| system_modules = data["system_modules"] | ||
| platforms = data["platforms"] |
Contributor
There was a problem hiding this comment.
Is it safe to access these keys even if data may be missing?
Contributor
Author
There was a problem hiding this comment.
I believe we could trust this data, as it is a manifest, and not data directly from user, but you are correct, we should be careful.
| if missing: | ||
| self.stderr.write( | ||
| self.style.WARNING( | ||
| "Missing typical hardware-registry sections : {', '.join(missing)}" |
Contributor
There was a problem hiding this comment.
Missing f prefix in the string?
466044d to
4866317
Compare
into db Closes kernelci#1899 Signed-off-by: Alan Peixinho <alan.peixinho@profusion.mobi>
4866317 to
5b07ed7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
How to test:
./migrate-app-db.sh. (Using a local database with write permissions)poetry run python3 manage.py update_hardware_registry ti.yamlcommand passing an example of valid hardware registry manifest (https://github.com/kernelci/kernelci-pipeline/blob/main/config/hardware_registry/ti.yaml).Closes #1899