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

default merged_uri should return the parameter not the attribute #18497

Merged
merged 4 commits into from
Mar 5, 2019

Conversation

jerryk55
Copy link
Member

A previous PR changed merged_uri to return the attribute on the object
rather than the passed in parameter. This is incorrect and is changed
herein. Only Swift handles this differently.

Thie method gets called by MiqSchedule.verify_file_depot() which in turn gets called by the UI controller in two different situations - for an AdHoc DB backup, and for a Scheduled DB Backup. We had apparently only tested AdHoc backups previously, which is why this worked. However Scheduled backups were failing because the FileDepot object had not been created in the DB and therefore the URI attribute was nil, which is invalid when the object is subsequently created.
If we return the passed in uri parameter instead of the attribute, both Adhoc and Scheduled DB backups will work correctly.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1678223

@roliveri @h-kataria @NickLaMuro please review. Thanks.

Links

@jerryk55
Copy link
Member Author

@miq-bot add_label hammer/yes

@jerryk55
Copy link
Member Author

@miq-bot add_label bug

@jerryk55
Copy link
Member Author

@miq_bot add_label core

@miq-bot miq-bot added the bug label Feb 27, 2019
Copy link
Member

@NickLaMuro NickLaMuro left a comment

Choose a reason for hiding this comment

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

Unsure if my review review has any valid "weight" to it, so if you disagree, I can reverse the "Request changes" status.

That said, at least would like a minor discussion about how we should avoid this from happening again in the future. Code changes seems reasonable otherwise though.

spec/models/file_depot_nfs_spec.rb Outdated Show resolved Hide resolved
app/models/file_depot.rb Show resolved Hide resolved
@jerryk55
Copy link
Member Author

@miq-bot add_label core

@miq-bot miq-bot added the core label Feb 28, 2019
@jerryk55 jerryk55 force-pushed the refix_merged_uri branch 3 times, most recently from 15eaa13 to 59e2000 Compare March 1, 2019 16:09
Copy link
Member

@NickLaMuro NickLaMuro left a comment

Choose a reason for hiding this comment

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

Thanks for the specs! I think this should be good now. 👍

@roliveri roliveri self-assigned this Mar 1, 2019
A previous PR changed merged_uri to return the attribute on the object
rather than the passed in parameter.  This is incorrect and is changed
herein.  Only Swift handles this differently.
Make the ignored URI attribute and actual parameter more meaningful.
Add tests to validate that MiqSchedule.verify_file_depot does the right thing with regard to calling
FileDepot.merged_uri.
Tried to rename the "uri" attribute inadvertantly in previous incarnation of this
test and broke it.  Fixing now.
@jerryk55
Copy link
Member Author

jerryk55 commented Mar 4, 2019

@roliveri pushing fix to spec test back out. This is approved by Nick L - if Travis passes it is ready to be merged as far as I'm concerned. You can look if you like

@miq-bot
Copy link
Member

miq-bot commented Mar 4, 2019

Checked commits jerryk55/manageiq@a4e1447~...f1e0d16 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
5 files checked, 0 offenses detected
Everything looks fine. ⭐

@roliveri roliveri merged commit c9ae719 into ManageIQ:master Mar 5, 2019
simaishi pushed a commit that referenced this pull request Mar 29, 2019
default merged_uri should return the parameter not the attribute

(cherry picked from commit c9ae719)

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1693728
@simaishi
Copy link
Contributor

Hammer backport details:

$ git log -1
commit cd3b3f3db3955c606d0b6e35ce6b13adf4fb8c47
Author: Richard Oliveri <oliveri.richard.github@gmail.com>
Date:   Tue Mar 5 09:17:14 2019 -0500

    Merge pull request #18497 from jerryk55/refix_merged_uri
    
    default merged_uri should return the parameter not the attribute
    
    (cherry picked from commit c9ae719b966f44fc21019b6594d6a366df77fd97)
    
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1693728

@agrare agrare added this to the Sprint 107 Ending Mar 18, 2019 milestone Apr 4, 2019
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