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

[WIP]Refactoring cloud vm provisioning validate_request method #419

Closed
wants to merge 2 commits into from
Closed

[WIP]Refactoring cloud vm provisioning validate_request method #419

wants to merge 2 commits into from

Conversation

pkomanek
Copy link
Contributor

@pkomanek pkomanek commented Sep 3, 2018

Purpose or Intent

Refactoring Cloud/VM/Provisioning/StateMachines/ProvisionRequestApproval.class/validate_request.rb method with a spec.

This PR is based on the issue bellow.

Links

Issue: #8

@miq-bot add_label refactoring

Coverage

coverage

def initialize_variables
@prov = @handle.root['miq_request']
@prov_resource = @prov.resource
raise "Provisioning Request not found" if @prov.nil? || @prov_resource.nil?
Copy link
Contributor

Choose a reason for hiding this comment

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

@pkomanek
Since this is related to requests and tasks would it make sense to have another method in

that can be called log_and_task(...,msg,task) log_and_task_and_raise(...., msg, task) log_and_request(...., msg, request) or log_and_request_raise(..,msg, request)

Because we dont want to loose these error conditions in the log, we can have it be stored in the request as well as in the task

validate_max_retirement_days

# Update Message to Requester
if @approval_req == true
Copy link
Contributor

Choose a reason for hiding this comment

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

@pkomanek can this go into a separate private method

@mkanoor
Copy link
Contributor

mkanoor commented Sep 4, 2018

@pkomanek can you run it with

export CI=1
spec ...
open coverage/index.html

and attach a snippet

@pkomanek pkomanek changed the title Refactoring cloud vm provisioning validate_request method [WIP]Refactoring cloud vm provisioning validate_request method Sep 4, 2018
@miq-bot
Copy link
Member

miq-bot commented Sep 4, 2018

Checked commits pkomanek/manageiq-content@575675b~...e81a315 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
2 files checked, 0 offenses detected
Everything looks fine. 🏆

@miq-bot miq-bot added the wip label Sep 4, 2018
@billfitzgerald0120
Copy link
Contributor

@pkomanek Looks good

@miq-bot
Copy link
Member

miq-bot commented May 6, 2019

This pull request has been automatically closed because it has not been updated for at least 6 months.

Feel free to reopen this pull request if these changes are still valid.

Thank you for all your contributions!

@miq-bot miq-bot closed this May 6, 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.

4 participants