-
Notifications
You must be signed in to change notification settings - Fork 358
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] Embedded Workflow integration #8718
Conversation
77740ad
to
fd32ba9
Compare
include Mixins::BreadcrumbsMixin | ||
|
||
def self.model | ||
ManageIQ::Providers::EmbeddedAnsible::AutomationManager::Playbook |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Fryguy , I don't know which model has to be used here. For now I had used Playbook just so that to see that the page works till here..(I am blocked here)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ManageIQ::Providers::Workflows::AutomationManager::Workflow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
guess we need to add something somewhere else for this to work..
[2023-03-30T19:31:47.507212 #5181:5ae4c] FATAL -- : Error caught: [Errno::ENOENT] No such file or directory - Unable to find view yaml file for db "ManageIQ_Providers_Workflows_AutomationManager_Workflow"
/Users/jeffreybonson/Workspace/manageiq/app/models/miq_report/import_export.rb:110:in `load_from_view_options'
/Users/jeffreybonson/Workspace/manageiq-ui-classic/app/controllers/application_controller.rb:1305:in `get_db_view'
/Users/jeffreybonson/Workspace/manageiq-ui-classic/app/controllers/application_controller.rb:1160:in `get_view'
/Users/jeffreybonson/Workspace/manageiq-ui-classic/app/controllers/application_controller/ci_processing.rb:189:in `process_show_list'
/Users/jeffreybonson/Workspace/manageiq-ui-classic/app/controllers/mixins/generic_list_mixin.rb:10:in `show_list'
/Users/jeffreybonson/Workspace/manageiq-ui-classic/app/controllers/automated_workflow_controller.rb:19:in `show_list'
/Users/jeffreybonson/.rvm/gems/ruby-3.0.5@master/gems/actionpack-6.1.7.3/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
/Users/jeffreybonson/.rvm/gems/ruby-3.0.5@master/gems/actionpack-6.1.7.3/lib/abstract_controller/base.rb:228:in `process_action'
/Users/jeffreybonson/.rvm/gems/ruby-3.0.5@master/gems/actionpack-6.1.7.3/lib/action_controller/metal/rendering.rb:30:in `process_action'
/Users/jeffreybonson/.rvm/gems/ruby-3.0.5@master/gems/actionpack-6.1.7.3/lib/abstract_controller/callbacks.rb:42:in `block in process_action'
/Users/jeffreybonson/.rvm/gems/ruby-3.0.5@master/gems/activesupport-6.1.7.3/lib/active_support/callbacks.rb:106:in `run_callbacks'
/Users/jeffreybonson/.rvm/gems/ruby-3.0.5@master/gems/actionpack-6.1.7.3/lib/abstract_controller/callbacks.rb:41:in `process_action'
/Users/jeffreybonson/.rvm/gems/ruby-3.0.5@master/gems/actionpack-6.1.7.3/lib/action_controller/metal/rescue.rb:22:in `process_action'
/Users/jeffreybonson/.rvm/gems/ruby-3.0.5@master/gems/actionpack-6.1.7.3/lib/action_controller/metal/instrumentation.rb:34:in `block in process_action'
/Users/jeffreybonson/.rvm/gems/ruby-3.0.5@master/gems/activesupport-6.1.7.3/lib/active_support/notifications.rb:203:in `block in instrument'
/Users/jeffreybonson/.rvm/gems/ruby-3.0.5@master/gems/activesupport-6.1.7.3/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
/Users/jeffreybonson/.rvm/gems/ruby-3.0.5@master/gems/activesupport-6.1.7.3/lib/active_support/notifications.rb:203:in `instrument'
/Users/jeffreybonson/.rvm/gems/ruby-3.0.5@master/gems/actionpack-6.1.7.3/lib/action_controller/metal/instrumentation.rb:33:in `process_action'
/Users/jeffreybonson/.rvm/gems/ruby-3.0.5@master/gems/actionpack-6.1.7.3/lib/action_controller/metal/params_wrapper.rb:249:in `process_action'
/Users/jeffreybonson/.rvm/gems/ruby-3.0.5@master/gems/activerecord-6.1.7.3/lib/active_record/railties/controller_runtime.rb:27:in `process_action'
/Users/jeffreybonson/.rvm/gems/ruby-3.0.5@master/gems/actionpack-6.1.7.3/lib/abstract_controller/base.rb:165:in `process'
/Users/jeffreybonson/.rvm/gems/ruby-3.0.5@master/gems/actionview-6.1.7.3/lib/action_view/rendering.rb:39:in `process'
/Users/jeffreybonson/.rvm/gems/ruby-3.0.5@master/gems/actionpack-6.1.7.3/lib/action_controller/metal.rb:190:in `dispatch'
/Users/jeffreybonson/.rvm/gems/ruby-3.0.5@master/gems/actionpack-6.1.7.3/lib/action_controller/metal.rb:254:in `dispatch'
/Users/jeffreybonson/.rvm/gems/ruby-3.0.5@master/gems/actionpack-6.1.7.3/lib/action_dispatch/routing/route_set.rb:50:in `dispatch'
/Users/jeffreybonson/.rvm/gems/ruby-3.0.5@master/gems/actionpack-6.1.7.3/lib/action_dispatch/routing/route_set.rb:33:in `serve'
/Users/jeffreybonson/.rvm/gems/ruby-3.0.5@master/gems/actionpack-6.1.7.3/lib/action_dispatch/journey/router.rb:50:in `block in serve'
/Users/jeffreybonson/.rvm/gems/ruby-3.0.5@master/gems/actionpack-6.1.7.3/lib/action_dispatch/journey/router.rb:32:in `each'
/Users/jeffreybonson/.rvm/gems/ruby-3.0.5@master/gems/actionpack-6.1.7.3/lib/action_dispatch/journey/router.rb:32:in `serve'
/Users/jeffreybonson/.rvm/gems/ruby-3.0.5@master/gems/actionpack-6.1.7.3/lib/action_dispatch/routing/route_set.rb:842:in `call'
/Users/jeffreybonson/.rvm/gems/ruby-3.0.5@master/gems/rack-attack-6.5.0/lib/rack/attack.rb:113:in `call'
/Users/jeffreybonson/.rvm/gems/ruby-3.0.5@master/gems/routes_lazy_routes-0.4.2/lib/routes_lazy_routes/lazy_routes_middleware.rb:16:in `call'
/Users/jeffreybonson/Workspace/manageiq/lib/request_started_on_middleware.rb:12:in `call'
/Users/jeffreybonson/.rvm/gems/ruby-3.0.5@master/gems/rack-2.2.6.4/lib/rack/tempfile_reaper.rb:15:in `call'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Every list view screen requires a report file which defines the table structure - the name of the file matches the model.
fd32ba9
to
6c19788
Compare
617b0ca
to
5a61565
Compare
79ce757
to
5ac5f89
Compare
@jeffibm See ManageIQ/manageiq#22429 for the feature names for RBAC |
@@ -0,0 +1,158 @@ | |||
/* ********************************************************** | |||
* This file contains dummy data for List and Summary Page. | |||
* This file can be removed when we have API's in place. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
APIs will be in ManageIQ/manageiq-api#1214
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jeffibm So, I talked with @agrare, and here's what we've decided naming wise.
Menus will looks like
Automation -> Embedded Workflows -> Workflows
Automation -> Embedded Workflows -> Repositories
Automation -> Embedded Workflows -> Credentials
While the Embedded will be in the UI for now, it's only for consistency with Embedded Ansible and Embedded Automate. Eventually, we're thinking of reorganizing it to get rid of the "Embedded" terminology everywhere because it's redundant, but for now we have to at least keep it in the menus.
So, given that, this controller should be named workflow_controller.rb
.
{ name: 'json', text: 'JSON Data' }, | ||
{ name: 'graph', text: 'Graph' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shoulld these be i18n or does that happen elsewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will make it i18 here.
|
||
const AutomatedWorkflowSummary = ({ recordId }) => { | ||
const tabLabels = [ | ||
{ name: 'json', text: 'JSON Data' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally this shouldn't say JSON, even though the format is JSON. Technically it's Amazon States Language or ASL. I'm thinking it should say either Text
or ASL
for this tab. @agrare Thoughts?
import { automatedWorkflowData } from './automated-workflows-dummy-data'; | ||
import '@tshepomgaga/aws-sfn-graph/index.css'; | ||
|
||
const AutomatedWorkflowSummary = ({ recordId }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to the comment above, let's leave out the word Automated
or Embedded
, so this should just be WorkflowSummary
and the file path should be javascript/components/workflows/summary.jsx
Same comment goes for the other .jsx files and directories.
}); | ||
}; | ||
|
||
/** Function to render the code snipper component */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/** Function to render the code snipper component */ | |
/** Function to render the code snippet component */ |
const renderCodeSnippet = () => { | ||
console.log(data.jsonData); | ||
return ( | ||
<CodeSnippet type="multi"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we have a way to present code already that uses CodeMirror (e.g. what we use for the Ruby code in Automate and the YAML in Advanced Settings). We should reuse that component, and also use code syntax coloring for JSON.
Loving this PR!
|
Integrated the API Screen.Recording.2023-04-04.at.11.02.37.AM.mov |
include Mixins::BreadcrumbsMixin | ||
|
||
def self.model | ||
ManageIQ::Providers::EmbeddedAnsible::AutomationManager::Playbook |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ManageIQ::Providers::EmbeddedAnsible::AutomationManager::Playbook | |
ManageIQ::Providers::Workflows::AutomationManager::Workflow |
include Mixins::BreadcrumbsMixin | ||
|
||
def self.model | ||
ManageIQ::Providers::EmbeddedAnsible::AutomationManager::Playbook |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ManageIQ::Providers::EmbeddedAnsible::AutomationManager::Playbook | |
ManageIQ::Providers::Workflows::AutomationManager::Repository |
@agrare Is this one ready yet? I can't recall.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no I didn't think we needed to subclass GitRepository
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we will need git support at minimum for MVP.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I agree, but do we need to subclass GitRepository
? Could we use the existing screens/APIs for managing git repositories and just allow selecting one when importing a Workflow via the UI
@jeffibm I think we're close to being in a position to merge, but before we do I'd like this behind the prototype flag. We probably should gate the routes and the menus at a minimum - not sure on the roles or the permissions (I don't think it's possible to but those behind prototype), but that might be ok. |
May I rebase this PR? already been 21 commits for 20 file changes. |
@@ -51,6 +51,9 @@ const CodeEditor = (props) => { | |||
{ modes.map((mode) => <RadioButton value={mode} labelText={mode} key={mode} />) } | |||
</RadioButtonGroup> | |||
)} | |||
{ | |||
console.log(codeMode) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: remove this
b258844
to
6a0ee30
Compare
I tried this change as suggested by @Fryguy |
Screen.Recording.2023-04-22.at.11.39.58.AM.mov |
@jeffibm can we simplify this so that we can get the basics merged? |
yes, we will work on them next. Could you please provide us a checklist of Todo items with descriptions to keep track of the tasks.. |
package.json
Outdated
@@ -1,7 +1,7 @@ | |||
{ | |||
"name": "manageiq-ui-classic", | |||
"version": "1.0.0", | |||
"description": "ManageIQ Cloud Management Platform", | |||
"description": "ManageIQ Cloud Management Platform ", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change shouldn't be here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, there was a test PR (with a simple change) to check if forking and merging work correctly between 2 users. will change it back soon.
256fa57
to
2d1924c
Compare
2d1924c
to
b37ad2e
Compare
Checked commits jeffbonson/manageiq-ui-classic@b37ad2e~...e4c30ca with ruby 2.6.10, rubocop 1.28.2, haml-lint 0.35.0, and yamllint app/controllers/workflow_controller.rb
app/presenters/menu/default_menu.rb
app/views/catalog/_embedded_workflows_modal.html.haml
app/views/catalog/_form_basic_info.html.haml
app/views/catalog/_provision_entry_points.html.haml
app/views/catalog/_reconfigure_entry_points.html.haml
app/views/catalog/_retirement_entry_points.html.haml
app/views/workflow/show.html.haml
app/views/workflow/show_list.html.haml
app/views/workflow_credential/show.html.haml
app/views/workflow_credential/show_list.html.haml
app/views/workflow_repository/show.html.haml
app/views/workflow_repository/show_list.html.haml
config/routes.rb
|
This pull request is not mergeable. Please rebase and repush. |
This pull request has been automatically closed because it has not been updated for at least 3 months. Feel free to reopen this pull request if these changes are still valid. Thank you for all your contributions! More information about the ManageIQ triage process can be found in the triage process documentation. |
Nav Menu Links
Workflows - ( using playbook model in the controller)
/workflow/show_list#/
/workflow/show/6#/
Repositories
/workflow_repository/show_list#/
/workflow_repository/show/6#/
Credentials
/workflow_credential/show_list#/
/workflow_credential/show/6#/
Latest update - #8718 (comment)
Related PRs