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

feature(renderer): version-label not honored #711

Merged
merged 2 commits into from
Jul 11, 2020

Conversation

gdamore
Copy link
Collaborator

@gdamore gdamore commented Jul 11, 2020

This supports the version-label be changed, or even reset
for document attributes.

To support resetting this label, the initial value is located
in the Predefined attributes, and a reset of the attribute is
stored as a nil attribute value instead of deleting it from the
attributes. This allows us to distinguish a reset as an override.

This approach will be used for other predefined text values in
follow ups.

Fixes #710

@codecov
Copy link

codecov bot commented Jul 11, 2020

Codecov Report

Merging #711 into master will decrease coverage by 0.00%.
The diff coverage is 76.47%.

@@            Coverage Diff             @@
##           master     #711      +/-   ##
==========================================
- Coverage   84.81%   84.80%   -0.01%     
==========================================
  Files          75       75              
  Lines        5089     5087       -2     
==========================================
- Hits         4316     4314       -2     
  Misses        488      488              
  Partials      285      285              

This supports the version-label be changed, or even reset
for document attributes.

To support resetting this label, the initial value is located
in the Predefined attributes, and a reset of the attribute is
stored as a nil attribute value instead of deleting it from the
attributes.  This allows us to distinguish a reset as an override.

This approach will be used for other predefined text values in
follow ups.

Fixes bytesparadise#710
if value, ok := value.(string); ok {
return value, true
} else if v, ok := a[key]; ok {
return fmt.Sprintf("%v", v), true
}
}
// check in predefined attributes
Copy link
Member

Choose a reason for hiding this comment

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

I guess that storing a nil value instead of removing it is because you also changed the priority for looking up attributes? We don't want to look in the predefined attributes if there was an explicit reset beforehand?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes. I need a way to distinguish something that was reset vs something that was simply not assigned.

Copy link
Member

Choose a reason for hiding this comment

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

yes, ok, it makes sense.

@xcoulon xcoulon merged commit d3c117e into bytesparadise:master Jul 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

version-label not honored
2 participants