Skip to content

Conversation

@GilbertCherrie
Copy link
Member

@GilbertCherrie GilbertCherrie commented May 21, 2024

Added the add / edit and summary screen for the terraform template catalog item.

Add Terraform Template Catalog Item:
Screenshot 2024-05-23 at 9 55 14 AM
Screenshot 2024-05-23 at 9 55 23 AM

Edit Terraform Template Catalog Item:
Screenshot 2024-05-23 at 10 02 51 AM
Screenshot 2024-05-23 at 9 57 32 AM

Summary Screen:
Screenshot 2024-05-23 at 10 02 32 AM

@GilbertCherrie GilbertCherrie requested a review from a team as a code owner May 21, 2024 18:09
@miq-bot miq-bot added the wip label May 21, 2024
@GilbertCherrie GilbertCherrie force-pushed the add_terraform_catalog branch 2 times, most recently from 6fdc81e to f2b5373 Compare May 22, 2024 17:08
@GilbertCherrie GilbertCherrie force-pushed the add_terraform_catalog branch from 72ec4b0 to 0a27776 Compare May 22, 2024 18:26
if prov_type == 'generic_terraform_template'
@current_region = MiqRegion.my_region.region
end
prov_type == 'generic_terraform_template'
Copy link
Member

Choose a reason for hiding this comment

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

These methods are nearly identical. Can we try to refactor them? It's also odd that a predicate/query/boolean method would set the @current_region as a side effect. I understand if this was the existing code for ansible but we should really try to fix that.

Copy link
Member Author

Choose a reason for hiding this comment

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

I can fix this in a follow up pr since I don't want to risk breaking the Ansible Playbook forms and the rest of this pr is pretty much done

@GilbertCherrie GilbertCherrie force-pushed the add_terraform_catalog branch from a81b6fe to 0d02c09 Compare May 22, 2024 20:30
@GilbertCherrie GilbertCherrie changed the title [WIP] Add terraform termplate catalog Add terraform termplate catalog May 22, 2024
@GilbertCherrie GilbertCherrie force-pushed the add_terraform_catalog branch 3 times, most recently from 04f603f to c7c63b5 Compare May 22, 2024 22:02
@jrafanie
Copy link
Member

kicking failed ci jobs

Comment on lines +2233 to +2248
# if @record.config_info[:retirement]
# retirement = @record.config_info[:retirement]
# terraform_template_details[:retirement] = {}
# terraform_template_details[:retirement][:remove_resources] = retirement[:remove_resources]
# if retirement[:repository_id]
# terraform_template_details[:retirement][:repository] = fetch_name_from_object(ManageIQ::Providers::EmbeddedTerraform::AutomationManager::ConfigurationScriptSource, retirement[:repository_id])
# terraform_template_details[:retirement][:template] = fetch_name_from_object(ManageIQ::Providers::EmbeddedTerraform::AutomationManager::ConfigurationScriptPayload, retirement[:configuration_script_payload_id])
# terraform_template_details[:retirement][:credential] = fetch_name_from_object(ManageIQ::Providers::EmbeddedTerraform::AutomationManager::Credential, retirement[:credential_id])
# terraform_template_details[:retirement][:network_credential] = fetch_name_from_object(ManageIQ::Providers::EmbeddedTerraform::AutomationManager::NetworkCredential, retirement[:network_credential_id]) if retirement[:network_credential_id]
# end
# terraform_template_details[:retirement][:execution_ttl] = retirement[:execution_ttl]
# terraform_template_details[:retirement][:verbosity] = retirement[:verbosity]
# terraform_template_details[:retirement][:log_output] = retirement[:log_output]
# terraform_template_details[:retirement][:become_enabled] = retirement[:become_enabled] == true ? _('Yes') : _('No')
# end
Copy link
Member

Choose a reason for hiding this comment

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

Minor but I think we should add a comment here about why this block of code is commented out

@agrare
Copy link
Member

agrare commented May 23, 2024

@GilbertCherrie can you add some screenshots of the new page to the PR description?

@agrare
Copy link
Member

agrare commented May 23, 2024

Also the spec failures look related to these changes

@GilbertCherrie GilbertCherrie force-pushed the add_terraform_catalog branch 2 times, most recently from 913a6d6 to 3ce5e2a Compare May 23, 2024 13:54
@GilbertCherrie GilbertCherrie force-pushed the add_terraform_catalog branch from 3ce5e2a to 1cb6906 Compare May 23, 2024 13:57
@miq-bot
Copy link
Member

miq-bot commented May 23, 2024

Checked commit GilbertCherrie@1cb6906 with ruby 2.7.8, rubocop 1.56.3, haml-lint 0.51.0, and yamllint
6 files checked, 3 offenses detected

app/views/catalog/_tt_react_form.html.haml

  • ⚠️ - Line 1 - Style/IfWithBooleanLiteralBranches: Remove redundant ternary operator with boolean literal branches.
  • ⚠️ - Line 2 - Avoid using instance variables in partials views
  • ⚠️ - Line 2 - Line is too long. [238/80]

@jrafanie jrafanie changed the title Add terraform termplate catalog Add terraform template catalog May 23, 2024
@agrare agrare merged commit 64b9d6d into ManageIQ:master May 23, 2024
@GilbertCherrie GilbertCherrie deleted the add_terraform_catalog branch May 23, 2024 14:20
@Fryguy
Copy link
Member

Fryguy commented May 24, 2024

Backported to radjabov in commit 5d020bd.

commit 5d020bde2cd685011ac85ea1b98de0be7eab589b
Author: Adam Grare <[email protected]>
Date:   Thu May 23 10:15:18 2024 -0400

    Merge pull request #9194 from GilbertCherrie/add_terraform_catalog
    
    Add terraform template catalog
    
    (cherry picked from commit 64b9d6d8f072646fb536a8ca4bec48fb68a835d2)

Fryguy pushed a commit that referenced this pull request May 24, 2024
Add terraform template catalog

(cherry picked from commit 64b9d6d)
Comment on lines +96 to +111
/** button component used as a mapper to copy the provision details into retirement */
// export const CopyFromProvisonButton = (props) => {
// const { label, copyFrom, copyTo } = useFieldApi(props);
// const formOptions = useFormApi();
// const handleClick = () => {
// copyFrom.forEach((fromItem, i) => {
// const destination = `config_info.retirement.${copyTo[i]}`;
// formOptions.change(destination, formOptions.getState().values.config_info.provision[fromItem]);
// });
// };
// return (
// <div>
// <Button kind="secondary" onClick={handleClick}>{label}</Button>
// </div>
// );
// };
Copy link
Member

Choose a reason for hiding this comment

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

Hey @GilbertCherrie , we can remove this if not needed..

Comment on lines +19 to +21
// if (Object.prototype.hasOwnProperty.call(catalogData.config_info.retirement, 'extra_vars')) {
// catalogData.config_info.retirement.extra_vars = convertObject(catalogData.config_info.retirement.extra_vars);
// }
Copy link
Member

Choose a reason for hiding this comment

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

this too..

@asirvadAbrahamVarghese asirvadAbrahamVarghese mentioned this pull request Aug 4, 2025
84 tasks
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