Skip to content

Bug fix for distinting between string and map type tags in forms#3441

Merged
yadvr merged 2 commits into
apache:masterfrom
shapeblue:tagger_bug
Jun 28, 2019
Merged

Bug fix for distinting between string and map type tags in forms#3441
yadvr merged 2 commits into
apache:masterfrom
shapeblue:tagger_bug

Conversation

@anuragaw
Copy link
Copy Markdown
Contributor

Some APIs consume 'tags' param as string and some consume as maps.
Since each API can have at most one 'tags' param the extraction of
map based tags should only happen when strings based tags are not
extracted from the form serialization.

Description

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

Screenshots (if appropriate):

How Has This Been Tested?

Try tagging in 2 different places -

  1. Snapshot , Snapshot policies
  2. Disk offering creation

Both places should work. Without this patch only former would work.

Some APIs consume 'tags' param as string and some consume as maps.
Since each API can have at most one 'tags' param the extraction of
map based tags should only happen when strings based tags are not
extracted from the form serialization.
@anuragaw
Copy link
Copy Markdown
Contributor Author

ping for review - @rhtyd , @shwstppr , @nvazquez , @borisstoyanov , @PaulAngus

Copy link
Copy Markdown
Member

@yadvr yadvr left a comment

Choose a reason for hiding this comment

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

lgtm, however, it's affects all users of the change and without testing it's hard to tell if it will cause any regressions

@anuragaw
Copy link
Copy Markdown
Contributor Author

Tags extraction was a recent change I had worked on for supporting snapshot and snapshot policy tags. This was merged in the last few days . This PR change makes it more conservative and avoids overwriting of string based tags if any because a form should not contain multiple params with name 'tags'

Copy link
Copy Markdown
Contributor

@shwstppr shwstppr left a comment

Choose a reason for hiding this comment

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

LGTM. Tested manually

Before these changes tags in form data of create disk offering form is empty
Screenshot from 2019-06-28 16-16-43

After these changes, it shows the correct value
Screenshot from 2019-06-28 16-20-57

Copy link
Copy Markdown
Contributor

@borisstoyanov borisstoyanov left a comment

Choose a reason for hiding this comment

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

LGTM

@yadvr yadvr merged commit 541d280 into apache:master Jun 28, 2019
@yadvr
Copy link
Copy Markdown
Member

yadvr commented Jun 28, 2019

Merged based on reviews, manual test and screenshot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants