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

Show Terraform Template stack stdout #9285

Merged
merged 2 commits into from
Oct 21, 2024

Conversation

putmanoj
Copy link
Contributor

@putmanoj putmanoj commented Oct 16, 2024

This PR is dependant on ManageIQ/manageiq-providers-embedded_terraform#78

With this change, separate tab added to show standard output from the terraform cli run job.

  • Before the changes, there was no standard output shown.
Before-Changes(Show-Service)
  • After the changes, there are two tabs, one for details, other for standard output from the terraform cli run job.
After-Changes(Show-Service)
  • Output tab with terraform CLI standard output
After-Change-Stdout(Show-Service)

Additional changes

  • Also added is a 'Refresh' button to refresh the page data
After-Change-Stdout-Refresh(Service-View)

@putmanoj putmanoj force-pushed the show-terraform-stdout branch from 5e664b0 to 7a65c3e Compare October 18, 2024 19:41
@@ -3,6 +3,10 @@
%ul.nav.nav-tabs{'role' => 'tablist'}
= miq_tab_header("details") do
= _("Details")
- if @record.type == "ServiceTerraformTemplate"
- stack = @record.try(:stack, "Provision")
Copy link
Member

Choose a reason for hiding this comment

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

This is extremely close to - provision_job = @record.try(:job, "Provision") below, I wonder if we could drop the "Is this an AnsiblePlaybook service or is it a terraform service" and instead say "does the provision job support stdout" generally

Copy link
Member

Choose a reason for hiding this comment

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

Example #9292

Comment on lines +36 to +41

- if @record.type == "ServiceTerraformTemplate"
= miq_tab_content("output", 'default', :class => 'cm-tab') do
- if stack
= react('ServiceDetailStdout', { :taskid => stack.raw_stdout_via_worker(User.current_user&.userid, 'html')});

Copy link
Member

Choose a reason for hiding this comment

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

My only question is if this could be more like the Ansible examples below versus having the miq_tab_header up above.

@agrare
Copy link
Member

agrare commented Oct 21, 2024

Is it possible to add specs covering this new code? Especially if we start refactoring this to be more generic it would be good to have existing specs in place.

Copy link
Member

@agrare agrare left a comment

Choose a reason for hiding this comment

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

I do think we need tests for this but going to merge as is for now

@agrare agrare merged commit d12d720 into ManageIQ:master Oct 21, 2024
15 checks passed
@Fryguy
Copy link
Member

Fryguy commented Oct 22, 2024

Backported to radjabov in commit 5499814.

commit 5499814505960f936d4d88fbe916b0618f3f44a5
Author: Adam Grare <[email protected]>
Date:   Mon Oct 21 09:24:09 2024 -0400

    Merge pull request #9285 from putmanoj/show-terraform-stdout
    
    Show Terraform Template stack stdout
    
    (cherry picked from commit d12d7201da22f230409976b069d672d45d63d55c)

Fryguy pushed a commit that referenced this pull request Oct 22, 2024
Show Terraform Template stack stdout

(cherry picked from commit d12d720)
@putmanoj putmanoj deleted the show-terraform-stdout branch October 24, 2024 05:18
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