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

WIP: (SIMP-9753) Add legacy/productmd treeinfo parser #166

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

op-ct
Copy link
Member

@op-ct op-ct commented Jun 4, 2021

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

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']
Copy link
Contributor

@lnemsick-simp lnemsick-simp Jun 7, 2021

Choose a reason for hiding this comment

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

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
Copy link
Contributor

Choose a reason for hiding this comment

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

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
Copy link
Contributor

@lnemsick-simp lnemsick-simp Jun 7, 2021

Choose a reason for hiding this comment

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

How does @verbose get enabled?

end
end
end
end
Copy link
Contributor

Choose a reason for hiding this comment

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

where are the tests for the error cases (e.g., invalid or unsupported treeinfo version)?

@trevor-vaughan trevor-vaughan changed the title (SIMP-9753) Add legacy/productmd treeinfo parser WIP: (SIMP-9753) Add legacy/productmd treeinfo parser Jun 16, 2021
@op-ct op-ct marked this pull request as draft June 28, 2021 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants