WIP: (SIMP-9753) Add legacy/productmd treeinfo parser#166
Draft
op-ct wants to merge 2 commits intosimp:masterfrom
Draft
WIP: (SIMP-9753) Add legacy/productmd treeinfo parser#166op-ct wants to merge 2 commits intosimp:masterfrom
op-ct wants to merge 2 commits intosimp:masterfrom
Conversation
This patch adds a .treeinfo parser that understands the EL7 legacy format and the EL8+ productmd treeinfo 1.x format[0]. [SIMP-9753] #close [0]: https://productmd.readthedocs.io/en/1.2/treeinfo-1.1.html
| # release version, for example: "21", "7.0", "2.1" | ||
| # @return [String] | ||
| def release_version | ||
| @treeinfo_maj_version > 0 ? section('release')['version'] : section('general')['version'] |
Contributor
There was a problem hiding this comment.
What if section() returns nil? This code does not handle that error case in a fashion that an end-user would understand. In other words, the error message from operating on a nil object would be incomprehensible to the end user.
| unless version.to_s.split('.').first == '1' | ||
| fail "ERROR: Unsupported productmd .treeinfo version: '#{version}': '#{@file}'" | ||
| end | ||
| warn "Detected productmd .treeinfo, version '#{verison}'" if @verbose |
Contributor
There was a problem hiding this comment.
why does this code send debug messages to $stderr?
| unless version.to_s.split('.').first == '1' | ||
| fail "ERROR: Unsupported productmd .treeinfo version: '#{version}': '#{@file}'" | ||
| end | ||
| warn "Detected productmd .treeinfo, version '#{verison}'" if @verbose |
Contributor
There was a problem hiding this comment.
How does @verbose get enabled?
| end | ||
| end | ||
| end | ||
| end |
Contributor
There was a problem hiding this comment.
where are the tests for the error cases (e.g., invalid or unsupported treeinfo version)?
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.
This patch adds a .treeinfo parser that understands the EL7 legacy
format and the EL8+ productmd 1.x treeinfo 1.x format [0] .
SIMP-9753 #close
[0]: https://productmd.readthedocs.io/en/1.2/treeinfo-1.1.html