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

Add important asserts to the default save inventory #15197

Conversation

Ladas
Copy link
Contributor

@Ladas Ladas commented May 23, 2017

Add important asserts to the default save inventory. First we just extract the distinct assert to a base class. Then we are adding an assert for a referential_integrity.

Ladas added 5 commits May 23, 2017 16:07
Expose a fixed_foreign_keys list, givin us a way to assert
referential integrity. This tool is vital for targeted refresh
where we need to be sure, that the referential integrity will not
be broken.
Extract distinct relation assertion to a base class
Extract referential integrity assertion to a base class
Use base class assert_distinct_relation
USe base class assert_referential_integrity
@Ladas
Copy link
Contributor Author

Ladas commented May 23, 2017

@miq-bot assign @agrare

@Ladas
Copy link
Contributor Author

Ladas commented May 23, 2017

@miq-bot add_label enhancement

@miq-bot
Copy link
Member

miq-bot commented May 23, 2017

Checked commits Ladas/manageiq@4c99c65~...bcab13b with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
3 files checked, 2 offenses detected

app/models/manager_refresh/inventory_collection.rb

app/models/manager_refresh/save_collection/saver/base.rb

@Ladas
Copy link
Contributor Author

Ladas commented May 23, 2017

@agrare can we ignore the 'Use next to skip iteration' I want to do return there if the first breaks the assert. Rubocop got it wrong I think :-) And I am fixing the other in next PR

@agrare
Copy link
Member

agrare commented May 23, 2017

can we ignore the 'Use next to skip iteration' I want to do return there if the first breaks the assert.

Yeah agreed that looks fine to me

@agrare agrare merged commit 6e7d203 into ManageIQ:master May 23, 2017
@agrare agrare added this to the Sprint 62 Ending Jun 5, 2017 milestone May 23, 2017
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.

3 participants