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

Remove new fields from export if empty #17080

Merged
merged 2 commits into from
Mar 5, 2018

Conversation

mkanoor
Copy link
Contributor

@mkanoor mkanoor commented Mar 2, 2018

To stay backward compatible with old importers, if the 2 new attributes from G release

  1. options
  2. embedded_methods

are empty, then we should not export it. This would help if we try
to export the Automate model from newer versions, which dont have

  1. Embedded Methods or
  2. Embedded Ansible methods, which use options

into an older system. The old importer wouldn't be aware of these new attributes.

Issue found when back porting fixes to Fine release PR # ManageIQ/manageiq-content#256

To stay backward compatible with old importers, if the
2 new attributes
options
embedded_methods

are empty, then we should not export it. This wold help if we try
to export the Automate model from newer versions, which dont have
 * Embedded Methods or
 * Embedded Ansible methods, which use options

into an older system.
@mkanoor
Copy link
Contributor Author

mkanoor commented Mar 2, 2018

@tinaafitz @gmcculloug @lfu
Please review

Copy link
Member

@tinaafitz tinaafitz left a comment

Choose a reason for hiding this comment

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

@mkanoor Looks good. This changes makes a lot of sense.

expect(result['name']).to eql('foo_method')
expect(result['location']).to eql('inline')
expect(result['options']).to be_nil
expect(result['embedded_methods']).to be_nil
Copy link
Member

Choose a reason for hiding this comment

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

We should check that the result hash does not have to key instead of the accessor method returning nil.

@miq-bot
Copy link
Member

miq-bot commented Mar 5, 2018

Checked commits mkanoor/manageiq@4ee8834~...a4156e5 with ruby 2.3.3, rubocop 0.52.0, haml-lint 0.20.0, and yamllint 1.10.0
2 files checked, 0 offenses detected
Everything looks fine. ⭐

@gmcculloug gmcculloug self-assigned this Mar 5, 2018
@gmcculloug gmcculloug merged commit 7a68d86 into ManageIQ:master Mar 5, 2018
@gmcculloug gmcculloug added this to the Sprint 81 Ending Mar 12, 2018 milestone Mar 5, 2018
@simaishi
Copy link
Contributor

simaishi commented Mar 7, 2018

@mkanoor Please add BZ link.

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.

6 participants