Skip to content

Conversation

@MelsHyrule
Copy link
Member

Fixes 8159.

Before

Screen Shot 2022-04-21 at 2 24 50 PM

image

image

image

After

Collect Logs tab was removed
Screen Shot 2022-04-21 at 2 22 20 PM

Collect Logs tab was removed
Screen Shot 2022-04-21 at 2 24 12 PM

Edit Button was removed
Screen Shot 2022-04-21 at 2 22 06 PM

Because the Edit Button was removed Edit page was also removed.

@miq-bot miq-bot added the wip label Apr 21, 2022
@MelsHyrule MelsHyrule force-pushed the file-depot-edit branch 2 times, most recently from 8c498ef to 0d2ae60 Compare April 21, 2022 19:53
@MelsHyrule
Copy link
Member Author

@miq-bot add-reviewer @Fryguy
@miq-bot add-reviewer @jrafanie
@miq-bot add-reviewer @kavyanekkalapu
@miq-bot assign @kavyanekkalapu

'pficon pficon-edit fa-lg',
N_('Edit the Log Depot settings for the selected Server'),
N_('Edit'),
:klass => ApplicationHelper::Button::LogDepotEdit),
Copy link
Member

@Fryguy Fryguy Apr 22, 2022

Choose a reason for hiding this comment

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

Looks like these can all go away now too?

$ git grep LogDepotEdit
app/helpers/application_helper/button/collect_logs.rb:1:class ApplicationHelper::Button::CollectLogs < ApplicationHelper::Button::LogDepotEdit
app/helpers/application_helper/button/log_depot_edit.rb:1:class ApplicationHelper::Button::LogDepotEdit < ApplicationHelper::Button::Basic
app/helpers/application_helper/button/zone_collect_logs.rb:1:class ApplicationHelper::Button::ZoneCollectLogs < ApplicationHelper::Button::LogDepotEdit
app/helpers/application_helper/toolbar/diagnostics_server_center.rb:87:      :klass => ApplicationHelper::Button::LogDepotEdit),
app/helpers/application_helper/toolbar/diagnostics_zone_center.rb:95:      :klass => ApplicationHelper::Button::LogDepotEdit),
spec/helpers/application_helper/buttons/log_depot_edit_spec.rb:1:describe ApplicationHelper::Button::LogDepotEdit do

$ git grep CollectLogs
app/helpers/application_helper/button/collect_logs.rb:1:class ApplicationHelper::Button::CollectLogs < ApplicationHelper::Button::LogDepotEdit
app/helpers/application_helper/button/zone_collect_logs.rb:1:class ApplicationHelper::Button::ZoneCollectLogs < ApplicationHelper::Button::LogDepotEdit
app/helpers/application_helper/toolbar/diagnostics_server_center.rb:71:          :klass => ApplicationHelper::Button::CollectLogs
app/helpers/application_helper/toolbar/diagnostics_server_center.rb:78:          :klass => ApplicationHelper::Button::CollectLogs
app/helpers/application_helper/toolbar/diagnostics_zone_center.rb:79:          :klass => ApplicationHelper::Button::ZoneCollectLogs
app/helpers/application_helper/toolbar/diagnostics_zone_center.rb:86:          :klass => ApplicationHelper::Button::ZoneCollectLogs
spec/helpers/application_helper/buttons/collect_logs_spec.rb:1:describe ApplicationHelper::Button::CollectLogs do
spec/helpers/application_helper/buttons/zone_collect_logs_spec.rb:1:describe ApplicationHelper::Button::ZoneCollectLogs do

Copy link
Member Author

Choose a reason for hiding this comment

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

Yup yup! I'm already on it

@@ -1,15 +0,0 @@
class ApplicationHelper::Button::ZoneCollectLogs < ApplicationHelper::Button::LogDepotEdit
include ApplicationHelper::Button::Mixins::ButtonPromptMixin
Copy link
Member

Choose a reason for hiding this comment

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

Interestingly, from what I can tell, ButtonPromptMixin is only used by ZoneCollectLogs and CollectLogs, so this mixin can also be deleted 🗑️

ManageIQ.angular.app.component('logCollectionForm', {
controllerAs: 'vm',
controller: logCollectionFormController,
templateUrl: '/static/ops/log_collection/log_collection.html.haml',
Copy link
Member

Choose a reason for hiding this comment

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

Not sure where this template comes from, but I think it can also be deleted.

= miq_tab_content("diagnostics_server_list", @sb[:active_tab]) do
= render :partial => "diagnostics_server_list_tab"
= miq_tab_content("diagnostics_collect_logs", @sb[:active_tab]) do
= render :partial => "diagnostics_collect_logs_tab"
Copy link
Member

Choose a reason for hiding this comment

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

With this partial removed here and below you can also delete app/views/ops/_diagnostics_collect_logs_tab.html.haml

'fetch_audit_log' => :fetch_audit_log,
'fetch_log' => :fetch_log,
'fetch_production_log' => :fetch_production_log,
'log_depot_edit' => :log_depot_edit,
Copy link
Member

Choose a reason for hiding this comment

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

Once this goes, I think all (most?) of the following can go too:

$ git grep log_depot_edit
app/controllers/ops_controller.rb:70:    'log_depot_edit'            => :log_depot_edit,
app/controllers/ops_controller.rb:111:    'zone_log_depot_edit'       => :log_depot_edit,
app/controllers/ops_controller.rb:474:        action_url = "log_depot_edit"
app/controllers/ops_controller.rb:628:    elsif nodetype == "log_depot_edit"
app/controllers/ops_controller.rb:794:        if ["log_depot_edit", "ze"].include?(nodetype)
app/controllers/ops_controller/diagnostics.rb:77:  def log_depot_edit
app/controllers/ops_controller/diagnostics.rb:78:    assert_privileges("#{@sb[:selected_typ] == "miq_server" ? "" : "zone_"}log_depot_edit")
app/controllers/ops_controller/diagnostics.rb:147:      replace_right_cell(:nodetype => "log_depot_edit")
app/controllers/ops_controller/diagnostics.rb:280:    assert_privileges("#{@sb[:selected_typ] == "miq_server" ? "" : "zone_"}log_depot_edit")
app/helpers/application_helper/toolbar/diagnostics_server_center.rb:83:      :log_depot_edit,
app/helpers/application_helper/toolbar/diagnostics_zone_center.rb:91:      :zone_log_depot_edit,
app/views/layouts/angular-bootstrap/_auth_credentials_angular_bootstrap.html.haml:2:- validate_url           ||= 'log_depot_edit'
app/views/layouts/angular/_auth_service_account_angular.html.haml:2:- validate_url ||= 'log_depot_edit'
app/views/ops/_log_collection.html.haml:5:                     'save-url'                       => "/#{controller_name}/log_depot_edit/",
config/routes.rb:2400:        log_depot_edit
spec/config/routes.pending.yml:887:- log_depot_edit
spec/controllers/ops_controller/diagnostics_spec.rb:322:    context "#log_depot_edit" do
spec/controllers/ops_controller/diagnostics_spec.rb:342:        controller.send(:log_depot_edit)
spec/controllers/ops_controller_spec.rb:294:      post :x_button, :params => {:id => @miq_server.id, :pressed => 'log_depot_edit', :format => :js}
spec/controllers/ops_controller_spec.rb:301:      post :x_button, :params => {:id => @miq_server.id, :pressed => 'log_depot_edit', :button => "cancel", :format => :js}
spec/controllers/ops_controller_spec.rb:308:      post :x_button, :params => {:id => @miq_server.id, :pressed => 'log_depot_edit', :button => "save", :format => :js}
spec/javascripts/components/ops/log_collection_form_spec.js:20:      saveUrl: "/ops/log_depot_edit/",
spec/javascripts/components/ops/log_collection_form_spec.js:68:      expect(miqService.miqAjaxButton).toHaveBeenCalledWith("/ops/log_depot_edit/123456?button=cancel", true);
spec/javascripts/components/ops/log_collection_form_spec.js:78:      var url = "/ops/log_depot_edit/123456?button=save";
spec/routing/ops_routing_spec.rb:53:    log_depot_edit

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah i've already removed most of those on my local just testing that nothings broken will push once done

:region => MiqRegion.my_region.region}
@right_cell_text ||= case x_active_tree
when :diagnostics_tree then _("Diagnostics %{text}") % {:text => region_text}
when :diagnostics_tree then _("Diagnostics %{text} 121212") % {:text => region_text} ## this is the header for the diagonists page (that is now empty)
Copy link
Member

Choose a reason for hiding this comment

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

typo: diagnostics

Copy link
Member Author

Choose a reason for hiding this comment

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

whoop true true, although this comment isnt meant to stay here forever, its more a reminder so i can ask about what we want to do about this particular page

Screen Shot 2022-04-22 at 3 29 48 PM

since now its basically an empty page, is there any note or comment or label we want to add here or do we want to simply leave it as is?

Copy link
Member

Choose a reason for hiding this comment

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

If there's nothing to show, then we should remove the page.

Copy link
Member

Choose a reason for hiding this comment

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

Are there even any Zone diagnostics after this?

Copy link
Member Author

Choose a reason for hiding this comment

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

If you mean "is there anything left inside the zone diagnostics tab after this?" then the answer is yes
Screen Shot 2022-04-25 at 11 02 12 AM

Copy link
Member

Choose a reason for hiding this comment

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

Interesting - maybe not for this PR, but then I wonder if it's useful to even have the servers in the left side nav anymore, because you can get that same information in the servers tab there. Then again, it's nice to be able to find a particular server if you don't know what zone it's in.

Copy link
Member Author

Choose a reason for hiding this comment

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

Update for here: Just pushed up a change to finish emptying out the page (see this screenshot) however i haven't been able to remove the 'clickyness' of the page and i don't think theres a way to specifically remove it since that functionality is tied to this method https://github.com/ManageIQ/manageiq-ui-classic/blob/master/app/javascript/oldjs/controllers/tree_view_controller.js#L101-L105 which looks to be pretty generic so i dont think we want to be adding diagnostics tree specific code there

@jrafanie
Copy link
Member

jrafanie commented Apr 29, 2022

I checked out your branch locally and you might be missing more opportunities for deletions. Keep in mind, I think we need to delete only the LogFile / log collection stuff and not the FileDepot Yet.

app/controllers/application_controller.rb:451:      settings = {:username => @edit[:new][:log_userid], :password => @edit[:new][:log_password]}
app/controllers/application_controller.rb:454:      settings = {:username => params[:log_userid], :password => params[:log_password]}
app/controllers/ops_controller.rb:62:    'collect_logs'              => :logs_collect,
app/controllers/ops_controller.rb:63:    'collect_current_logs'      => :collect_current_logs,
app/controllers/ops_controller.rb:106:    'zone_collect_logs'         => :logs_collect,
app/controllers/ops_controller.rb:107:    'zone_collect_current_logs' => :collect_current_logs,
app/controllers/ops_controller.rb:125:  def collect_current_logs
app/controllers/ops_controller.rb:126:    assert_privileges("#{x_node.split('-').first == "z" ? "zone_" : ""}collect_current_logs")
app/controllers/ops_controller/diagnostics.rb:209:    log_depot_json = {:depot_name   => log_depot[:name],
app/controllers/ops_controller/diagnostics.rb:212:                      :log_userid   => log_depot.authentication_userid,
app/controllers/ops_controller/diagnostics.rb:213:                      :log_protocol => klass.to_s}
app/controllers/ops_controller/diagnostics.rb:218:    log_depot_json = {:depot_name   => '',
app/controllers/ops_controller/diagnostics.rb:221:                      :log_userid   => '',
app/controllers/ops_controller/diagnostics.rb:222:                      :log_password => '',
app/controllers/ops_controller/diagnostics.rb:223:                      :log_protocol => ''}
app/controllers/ops_controller/diagnostics.rb:303:    assert_privileges("#{obj == "z" ? "zone_" : ""}collect_logs")
app/controllers/ops_controller/diagnostics.rb:308:    elsif instance.log_collection_active_recently?
app/controllers/ops_controller/diagnostics.rb:602:        @sb[:active_tab] = "diagnostics_collect_logs" # setting it to show collect logs tab as first tab for the servers that are not started
app/controllers/ops_controller/diagnostics.rb:671:    if params[:log_userid]
app/controllers/ops_controller/diagnostics.rb:672:      log_password = params[:log_password] || @record.log_file_depot.authentication_password
app/controllers/ops_controller/diagnostics.rb:673:      creds[:default] = {:userid => params[:log_userid], :password => log_password}
app/controllers/ops_controller/settings/schedules.rb:121:      @log_userid           = depot.try(:authentication_userid)
app/controllers/ops_controller/settings/schedules.rb:122:      @log_password         = depot.try(:authentication_password)
app/controllers/ops_controller/settings/schedules.rb:166:      :depot_name           => depot_name,
app/controllers/ops_controller/settings/schedules.rb:170:      :log_userid           => log_userid || "",
app/controllers/ops_controller/settings/schedules.rb:280:    if params[:log_password]
app/controllers/ops_controller/settings/schedules.rb:768:      log_password = params[:log_password] || file_depot.try(:authentication_password)
app/controllers/ops_controller/settings/schedules.rb:769:      uri_settings = {:username => params[:log_userid], :password => log_password}
app/controllers/ops_controller/settings/schedules.rb:773:    uri_settings[:log_protocol]         = params[:log_protocol]
app/javascript/oldjs/controllers/schedule/schedule_form_controller.js:5:      depot_name: '',
app/javascript/oldjs/controllers/schedule/schedule_form_controller.js:7:      log_userid: '',
app/javascript/oldjs/controllers/schedule/schedule_form_controller.js:14:      log_protocol: '',
app/javascript/oldjs/controllers/schedule/schedule_form_controller.js:66:      $scope.scheduleModel.depot_name   = data.depot_name;
app/javascript/oldjs/controllers/schedule/schedule_form_controller.js:68:      $scope.scheduleModel.log_userid   = data.log_userid;
app/javascript/oldjs/controllers/schedule/schedule_form_controller.js:69:      $scope.scheduleModel.log_protocol = data.protocol;
app/javascript/oldjs/controllers/schedule/schedule_form_controller.js:117:      $scope.scheduleModel.log_password = '';
app/javascript/oldjs/controllers/schedule/schedule_form_controller.js:118:      if ($scope.scheduleModel.log_userid !== '') {
app/javascript/oldjs/controllers/schedule/schedule_form_controller.js:119:        $scope.scheduleModel.log_password = miqService.storedPasswordPlaceholder;
app/javascript/oldjs/controllers/schedule/schedule_form_controller.js:303:    $scope.scheduleModel.uri_prefix = uriPrefixes[$scope.scheduleModel.log_protocol];
app/javascript/oldjs/controllers/schedule/schedule_form_controller.js:305:    if (['FileDepotNfs', 'FileDepotSwift', 'FileDepotS3'].includes($scope.scheduleModel.log_protocol)) {
app/javascript/oldjs/controllers/schedule/schedule_form_controller.js:312:    $scope.scheduleModel.log_userid = $scope.modelCopy.log_userid;
app/javascript/oldjs/controllers/schedule/schedule_form_controller.js:313:    $scope.scheduleModel.log_password = $scope.modelCopy.log_password;
app/javascript/oldjs/controllers/schedule/schedule_form_controller.js:368:    return ($scope.angularForm.depot_name.$valid &&
app/javascript/oldjs/controllers/schedule/schedule_form_controller.js:370:      $scope.angularForm.log_userid.$valid &&
app/javascript/oldjs/controllers/schedule/schedule_form_controller.js:371:      $scope.angularForm.log_password.$valid);
app/javascript/oldjs/controllers/schedule/schedule_form_controller.js:395:    return ($scope.angularForm.depot_name.$dirty ||
app/javascript/oldjs/controllers/schedule/schedule_form_controller.js:397:        $scope.angularForm.log_userid.$dirty ||
app/javascript/oldjs/controllers/schedule/schedule_form_controller.js:398:        $scope.angularForm.log_password.$dirty);
app/views/layouts/angular-bootstrap/_auth_credentials_angular_bootstrap.html.haml:2:- validate_url           ||= 'log_depot_edit'
app/views/layouts/angular-bootstrap/_edit_log_depot_settings_angular_bootstrap.html.haml:3:  .form-group{"ng-class" => "{'has-error': angularForm.depot_name.$invalid}"}
app/views/layouts/angular-bootstrap/_edit_log_depot_settings_angular_bootstrap.html.haml:4:    %label.col-md-2.control-label{"for" => "depot_name"}
app/views/layouts/angular-bootstrap/_edit_log_depot_settings_angular_bootstrap.html.haml:8:                          "id"          => "depot_name",
app/views/layouts/angular-bootstrap/_edit_log_depot_settings_angular_bootstrap.html.haml:9:                          "ng-required" => "#{ng_reqd_depot_name}",
app/views/layouts/angular-bootstrap/_edit_log_depot_settings_angular_bootstrap.html.haml:10:                          "name"        => "depot_name",
app/views/layouts/angular-bootstrap/_edit_log_depot_settings_angular_bootstrap.html.haml:11:                          "ng-model"    => "#{ng_model_depot_name}",
app/views/layouts/angular-bootstrap/_edit_log_depot_settings_angular_bootstrap.html.haml:15:      %span.help-block{"ng-show" => "angularForm.depot_name.$invalid"}
app/views/layouts/angular/_auth_service_account_angular.html.haml:2:- validate_url ||= 'log_depot_edit'
app/views/ops/_schedule_form_filter.html.haml:108:                              :ng_reqd_userid    => "credsRequired(scheduleModel.log_userid)",
app/views/ops/_schedule_form_filter.html.haml:109:                              :ng_reqd_password  => "credsRequired(scheduleModel.log_password)",
spec/controllers/ops_controller/diagnostics_spec.rb:25:    expect_any_instance_of(klass).to receive(:log_collection_active_recently?).and_return(true)
spec/controllers/ops_controller/diagnostics_spec.rb:35:      expect_any_instance_of(klass).to receive(:log_collection_active_recently?).and_return(false)
spec/controllers/ops_controller/diagnostics_spec.rb:45:      expect_any_instance_of(klass).to receive(:log_collection_active_recently?).and_return(false)
spec/controllers/ops_controller/diagnostics_spec.rb:98:    it "uses params[:log_password] to set the creds hash if it exists" do
spec/controllers/ops_controller/diagnostics_spec.rb:105:      controller.params = {:log_userid   => "default_userid",
spec/controllers/ops_controller/diagnostics_spec.rb:106:                           :log_password => "default_password2"}
spec/controllers/ops_controller/diagnostics_spec.rb:121:      controller.params = {:log_userid => "default_userid"}
spec/controllers/ops_controller/settings/schedules_spec.rb:86:    it "uses params[:log_password] for validation if one exists" do
spec/controllers/ops_controller/settings/schedules_spec.rb:87:      controller.params = {:log_userid   => "userid",
spec/controllers/ops_controller/settings/schedules_spec.rb:88:                           :log_password => "password2",
spec/controllers/ops_controller/settings/schedules_spec.rb:91:                           :log_protocol => "Samba"}
spec/controllers/ops_controller/settings/schedules_spec.rb:99:    it "uses the stored password for validation if params[:log_password] does not exist" do
spec/controllers/ops_controller/settings/schedules_spec.rb:100:      controller.params = {:log_userid   => "userid",
spec/controllers/ops_controller/settings/schedules_spec.rb:103:                           :log_protocol => "Samba"}
spec/javascripts/controllers/schedule/schedule_form_controller_spec.js:55:      expect($scope.scheduleModel.depot_name).toEqual('depotName');
spec/javascripts/controllers/schedule/schedule_form_controller_spec.js:58:    it('sets the logUserid to the log_userid returned from the http request', function() {
spec/javascripts/controllers/schedule/schedule_form_controller_spec.js:59:      expect($scope.scheduleModel.log_userid).toEqual('logUserId');
spec/javascripts/controllers/schedule/schedule_form_controller_spec.js:62:    it('sets the logPassword to the log_password returned from the http request', function() {
spec/javascripts/controllers/schedule/schedule_form_controller_spec.js:63:      expect($scope.scheduleModel.log_password).toEqual(miqService.storedPasswordPlaceholder);
spec/javascripts/controllers/schedule/schedule_form_controller_spec.js:177:        depot_name: 'depotName',
spec/javascripts/controllers/schedule/schedule_form_controller_spec.js:182:        log_userid: 'logUserId',
spec/javascripts/controllers/schedule/schedule_form_controller_spec.js:237:          expect($scope.scheduleModel.log_protocol).toBe('protocol')
spec/javascripts/controllers/schedule/schedule_form_controller_spec.js:548:        $scope.scheduleModel.log_protocol = 'FileDepotSmb';
spec/javascripts/controllers/schedule/schedule_form_controller_spec.js:559:        $scope.scheduleModel.log_protocol = 'FileDepotNfs';
spec/javascripts/controllers/schedule/schedule_form_controller_spec.js:676:        '<input ng-model="scheduleModel.depot_name" name="depot_name" required" text />' +
spec/javascripts/controllers/schedule/schedule_form_controller_spec.js:678:        '<input ng-model="scheduleModel.log_userid" name="log_userid" required text />' +
spec/javascripts/controllers/schedule/schedule_form_controller_spec.js:679:        '<input ng-model="scheduleModel.log_password" name="log_password" required text />' +
spec/javascripts/controllers/schedule/schedule_form_controller_spec.js:687:      $scope.angularForm.depot_name.$setViewValue('abc');
spec/javascripts/controllers/schedule/schedule_form_controller_spec.js:689:      $scope.angularForm.log_userid.$setViewValue('abcuser');
spec/javascripts/controllers/schedule/schedule_form_controller_spec.js:690:      $scope.angularForm.log_password.$setViewValue('abcpassword');
spec/javascripts/services/miq_service_spec.js:136:          depot_name:   'my_nfs_depot',
spec/javascripts/services/miq_service_spec.js:139:          log_userid:   null,
spec/javascripts/services/miq_service_spec.js:140:          log_password: null,
spec/javascripts/services/miq_service_spec.js:141:          log_protocol: 'NFS'
spec/javascripts/services/miq_service_spec.js:147:            depot_name:   'my_nfs_depot',
spec/javascripts/services/miq_service_spec.js:150:            log_protocol: 'NFS'

I cobbled together this grep command to look for things that might need to be removed:

git grep -n -E "log_depot_edit|collect_logs|logCollection|log_collection|log_protocol|collect_current_logs|collect_logs|last_log_sync_on|log_depot_uri|last_collection_time|last_log_sync_message|LogFile|log_files|log_userid|log_protocol|log_password|depot_name|relative_path_for_upload|build_log_uri|logs_from_server|who_am_i|_request_logs|historical_logfile|current_logfile|empty_logfile|ping_timeout|do_ping|upload_log_file|destination_directory|logfile_name|destination_file_name|post_upload_tasks|format_log_time|legacy_depot_hash" ":(exclude)*.json"

I can't tell if all of these are log collection/ log file references but I think many are.

@jrafanie
Copy link
Member

Note, here's my understanding of the need for FileDepot for PxeServer class... ManageIQ/manageiq#21377 (comment)

@jrafanie
Copy link
Member

jrafanie commented May 6, 2022

Looking better, note, I updated my git grep for the backend PR so there's still references to log_depot_validate which is possibly for the chopping block too.

Please review to see if these are also part of the log collection UI and can be removed:

joerafaniello@Joes-MacBook-Pro-2 manageiq-ui-classic % git grep -n -E "log_management|LogManagement|Elif|elif|base_path|remove_file|upload_file|destination_path|destination_file|requires_support_case|support_case|pg_data_dir|log_patterns|log_start_and_end_for_pattern|format_log_time|post_automate_models|backup_automate_models|post_one_log_pattern|post_automate_dialogs|backup_automate_dialogs|zip_entry_from_path|add_zip_entry|LOG_TIMESTAMP_REGEX|find_timestamp|zip_entry_from_path|add_zip_entry|zip_logs|log_duration_gz|get_log_start_end_times|log_duration|log_timestamp|get_evm_log_for_date|post_current_logs|post_historical_logs|delete_old_requested_logs|base_zip_log_name|log_depot|post_my_logs|post_logs|include_automate_models_and_dialogs|synchronize_logs|collect_logs|logCollection|log_collection|log_protocol|collect_current_logs|collect_logs|last_log_sync|last_collection_time|LogFile|log_userid|log_protocol|log_password|depot_name|relative_path_for_upload|build_log_uri|logs_from_server|who_am_i|_request_logs|historical_logfile|current_logfile|empty_logfile|ping_timeout|do_ping|log_file|destination_directory|logfile_name|destination_file_name|post_upload_tasks|format_log_time|legacy_depot_hash" ":(exclude)*.json" ":(exclude)*.po" ":(exclude)*.pot"k
app/controllers/application_controller.rb:430:  # this is a terrible name, it doesn't validate log_depots
app/controllers/application_controller.rb:431:  def log_depot_validate
app/controllers/application_controller.rb:432:    @schedule = nil # setting to nil, since we are using same view for both db_back and log_depot edit
app/controllers/application_controller.rb:451:      settings = {:username => @edit[:new][:log_userid], :password => @edit[:new][:log_password]}
app/controllers/application_controller.rb:454:      settings = {:username => params[:log_userid], :password => params[:log_password]}
app/controllers/application_controller/sysprep_answer_file.rb:9:        @edit[:new][:sysprep_upload_file] = params[:upload][:file].original_filename
app/controllers/miq_ae_class_controller.rb:784:    session[:log_depot_default_verify_status] = false
app/controllers/miq_ae_class_controller.rb:1005:      if @edit[:default_verify_status] != session[:log_depot_default_verify_status]
app/controllers/miq_ae_class_controller.rb:1006:        session[:log_depot_default_verify_status] = @edit[:default_verify_status]
app/controllers/miq_ae_tools_controller.rb:194:    upload_file = params.fetch_path(:upload, :file)
app/controllers/miq_ae_tools_controller.rb:196:    if upload_file.blank?
app/controllers/miq_ae_tools_controller.rb:199:      import_file_upload_id = automate_import_service.store_for_import(upload_file.read)
app/controllers/miq_policy_export_controller.rb:79:    if upload_file_valid?
app/controllers/miq_policy_export_controller.rb:210:  def upload_file_valid?
app/controllers/report_controller.rb:251:    upload_file = params.fetch_path(:upload, :file)
app/controllers/report_controller.rb:253:    if upload_file.blank?
app/controllers/report_controller.rb:258:        import_file = widget_import_service.store_for_import(upload_file.read)
app/javascript/components/miq-toolbar.jsx:25:  return `${tbUrl}&support_case=${encodeURIComponent(supportCase)}`;
app/javascript/oldjs/import.js:58:    if ($('#upload_file').val()) {
app/views/miq_ae_tools/_import_export.html.haml:151:    $("#upload_file").on("change", function() {
app/views/miq_policy_export/_export.html.haml:47:              $("#upload_file").on("change", function() {
app/views/miq_request/_prov_field.html.haml:483:      - elsif [:sysprep_upload_file].include?(field)
app/views/ops/_schedule_form_filter.html.haml:110:                              :validate_url      => "log_depot_validate",
app/views/report/_export_custom_reports.html.haml:28:          $("#upload_file").on("change", function() {
app/views/report/_export_widgets.html.haml:45:          $("#upload_file").on("change", function() {
app/views/shared/views/_prov_dialog.html.haml:358:          - keys = [:sysprep_upload_file]
app/views/shared/views/_prov_dialog.html.haml:366:          - file_name = (@edit && @edit[:new]) ? @edit[:new][:sysprep_upload_file] : @options[:sysprep_upload_file]
bin/before_install:25:elif [ ! -d "$spec_manageiq" ]; then
config/routes.rb:2607:        log_depot_validate
spec/config/routes.pending.yml:964:- log_depot_validate
spec/controllers/miq_ae_tools_controller_spec.rb:459:      let(:params) { {:upload => {:file => upload_file}} }
spec/controllers/miq_ae_tools_controller_spec.rb:460:      let(:upload_file) { fixture_file_upload("files/dummy_file.yml", "text/yml") }
spec/javascripts/import_spec.js:194:        html += ' <input id="upload_file" />';
spec/javascripts/import_spec.js:202:        $('#upload_file').prop('value', 'test_value');
spec/routing/pxe_routing_spec.rb:30:  describe "#log_depot_validate" do
spec/routing/pxe_routing_spec.rb:32:      expect(post("/pxe/log_depot_validate")).to route_to("pxe#log_depot_validate")

@jrafanie
Copy link
Member

jrafanie commented May 6, 2022

Looks like the tests are failing due to a missing validate_url method that looks to be deleted in this PR:

1) host/form rendering fields in host new/edit form doesn't display IP Address
     Failure/Error: - validate = "#{main_scope}.validateClicked('#{url_for_only_path(:action => validate_url, :id => id, :type => valtype, :button => "validate")}')"

     ActionView::Template::Error:
       undefined local variable or method `validate_url' for #<#<Class:0x00005599b7435070>:0x00005599d2b67e68>
       Did you mean?  validate
     # ./app/views/layouts/angular/_form_buttons_verify_angular.html.haml:11:in `__home_runner_work_manageiq_ui_classic_manageiq_ui_classic_app_views_layouts_angular__form_buttons_verify_angular_html_haml___3405153007502424278_2894040'
     # ./app/views/layouts/angular-bootstrap/_auth_credentials_angular_bootstrap.html.haml:82:in `__home_runner_work_manageiq_ui_classic_manageiq_ui_classic_app_views_layouts_angular_bootstrap__auth_credentials_angular_bootstrap_html_haml___2749254416202368655_2894020'
     # ./app/views/layouts/angular/_multi_auth_credentials.html.haml:85:in `block in __home_runner_work_manageiq_ui_classic_manageiq_ui_classic_app_views_layouts_angular__multi_auth_credentials_html_haml___2529429340228404777_2893960'
     # ./app/helpers/application_helper.rb:1152:in `block in miq_tab_content'
     # ./app/helpers/application_helper.rb:1151:in `miq_tab_content'
     # ./app/views/layouts/angular/_multi_auth_credentials.html.haml:56:in `__home_runner_work_manageiq_ui_classic_manageiq_ui_classic_app_views_layouts_angular__multi_auth_credentials_html_haml___2529429340228404777_2893960'
     # ./app/views/host/_form.html.haml:88:in `__home_runner_work_manageiq_ui_classic_manageiq_ui_classic_app_views_host__form_html_haml__2157218652403150003_2893940'
     # ./spec/views/host/_form.html.haml_spec.rb:19:in `block (3 levels) in <top (required)>'
     # ------------------
     # --- Caused by: ---
     # NameError:
     #   undefined local variable or method `validate_url' for #<#<Class:0x0000[559](https://github.com/ManageIQ/manageiq-ui-classic/runs/6296821016?check_suite_focus=true#step:8:559)9b7435070>:0x00005599d2b67e68>
     #   Did you mean?  validate
     #   ./app/views/layouts/angular/_form_buttons_verify_angular.html.haml:11:in `__home_runner_work_manageiq_ui_classic_manageiq_ui_classic_app_views_layouts_angular__form_buttons_verify_angular_html_haml___3405153007502424278_2894040'

  2) host/form rendering fields in host new/edit form displays Host Name
     Failure/Error: - validate = "#{main_scope}.validateClicked('#{url_for_only_path(:action => validate_url, :id => id, :type => valtype, :button => "validate")}')"

     ActionView::Template::Error:
       undefined local variable or method `validate_url' for #<#<Class:0x00005599b7435070>:0x00005599d6e91a68>
       Did you mean?  validate
     # ./app/views/layouts/angular/_form_buttons_verify_angular.html.haml:11:in `__home_runner_work_manageiq_ui_classic_manageiq_ui_classic_app_views_layouts_angular__form_buttons_verify_angular_html_haml___3405153007502424278_2894040'
     # ./app/views/layouts/angular-bootstrap/_auth_credentials_angular_bootstrap.html.haml:82:in `__home_runner_work_manageiq_ui_classic_manageiq_ui_classic_app_views_layouts_angular_bootstrap__auth_credentials_angular_bootstrap_html_haml___2749254416202368655_2894020'
     # ./app/views/layouts/angular/_multi_auth_credentials.html.haml:85:in `block in __home_runner_work_manageiq_ui_classic_manageiq_ui_classic_app_views_layouts_angular__multi_auth_credentials_html_haml___2529429340228404777_2893960'
     # ./app/helpers/application_helper.rb:1152:in `block in miq_tab_content'
     # ./app/helpers/application_helper.rb:1151:in `miq_tab_content'
     # ./app/views/layouts/angular/_multi_auth_credentials.html.haml:56:in `__home_runner_work_manageiq_ui_classic_manageiq_ui_classic_app_views_layouts_angular__multi_auth_credentials_html_haml___2529429340228404777_2893960'
     # ./app/views/host/_form.html.haml:88:in `__home_runner_work_manageiq_ui_classic_manageiq_ui_classic_app_views_host__form_html_haml__2157218652403150003_2893940'
     # ./spec/views/host/_form.html.haml_spec.rb:14:in `block (3 levels) in <top (required)>'
     # ------------------
     # --- Caused by: ---
     # NameError:
     #   undefined local variable or method `validate_url' for #<#<Class:0x00005599b7435070>:0x00005599d6e91a68>
     #   Did you mean?  validate
     #   ./app/views/layouts/angular/_form_buttons_verify_angular.html.haml:11:in `__home_runner_work_manageiq_ui_classic_manageiq_ui_classic_app_views_layouts_angular__form_buttons_verify_angular_html_haml___3405153007502424278_2894040'

  3) HostController#button edit renders GTL grid with selected Host records
     Failure/Error: expect(response.status).to eq(200)

       expected: 200
            got: 500

       (compared using ==)
     # ./spec/controllers/host_controller_spec.rb:62:in `block (3 levels) in <top (required)>'

Unless these tests are validating non-depot authentication, maybe the callers can be removed too. I don't know if validate_url needs to be remain for non-log but with a different default value, but these look suspect:

diff --git a/app/views/layouts/angular-bootstrap/_auth_credentials_angular_bootstrap.html.haml b/app/views/layouts/angular-bootstrap/_auth_credentials_angular_bootstrap.html.haml
index 2b8711037d..4305255b7a 100644
--- a/app/views/layouts/angular-bootstrap/_auth_credentials_angular_bootstrap.html.haml
+++ b/app/views/layouts/angular-bootstrap/_auth_credentials_angular_bootstrap.html.haml
@@ -1,5 +1,4 @@
 - ng_show                ||= true
-- validate_url           ||= 'log_depot_edit'
 - prefix                 ||= 'log'
 - userid_label           ||= _("Username")
 - password_label         ||= _("Password")
@@ -82,7 +81,6 @@
       .col-md-4
         = render :partial => "layouts/angular/form_buttons_verify_angular",
                                      :locals  => {:ng_show          => "#{ng_show}",
-                                                  :validate_url     => validate_url,

diff --git a/app/views/layouts/angular/_auth_service_account_angular.html.haml b/app/views/layouts/angular/_auth_service_account_angular.html.haml
index 41e3dde7ff..ce0faddebf 100644
--- a/app/views/layouts/angular/_auth_service_account_angular.html.haml
+++ b/app/views/layouts/angular/_auth_service_account_angular.html.haml
@@ -1,5 +1,4 @@
 - ng_show ||= true
-- validate_url ||= 'log_depot_edit'
 - prefix ||= 'log'
 - vm_scope ||= false
 - main_scope = vm_scope ? "$parent.vm" : "$parent"
@@ -26,7 +25,6 @@
       .col-md-4
         = render :partial => "layouts/angular/form_buttons_verify_angular",
                                      :locals  => {:ng_show           => ng_show,
-                                                  :validate_url      => validate_url,
                                                   :id                => id,
                                                   :valtype           => prefix,
                                                   :ng_model          => "#{ng_model}",

Or maybe we need to delete more things, such as the list of log_depot items I listed above...

joerafaniello@Joes-MacBook-Pro-2 manageiq-ui-classic % git grep log_depot_validate
app/controllers/application_controller.rb:  def log_depot_validate
app/views/ops/_schedule_form_filter.html.haml:                              :validate_url      => "log_depot_validate",
config/routes.rb:        log_depot_validate
spec/config/routes.pending.yml:- log_depot_validate
spec/routing/pxe_routing_spec.rb:  describe "#log_depot_validate" do
spec/routing/pxe_routing_spec.rb:      expect(post("/pxe/log_depot_validate")).to route_to("pxe#log_depot_validate")

@MelsHyrule MelsHyrule force-pushed the file-depot-edit branch 2 times, most recently from 2b6b56d to 94b91f0 Compare May 13, 2022 20:14
@miq-bot
Copy link
Member

miq-bot commented Mar 24, 2023

This pull request is not mergeable. Please rebase and repush.

@miq-bot miq-bot added the stale label Jun 26, 2023
@miq-bot miq-bot closed this Jun 26, 2023
@miq-bot
Copy link
Member

miq-bot commented Jun 26, 2023

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.

@Fryguy Fryguy reopened this Nov 8, 2023
@Fryguy Fryguy removed the stale label Nov 8, 2023
@miq-bot
Copy link
Member

miq-bot commented Nov 14, 2023

This pull request is not mergeable. Please rebase and repush.

@miq-bot miq-bot added the stale label Feb 19, 2024
@miq-bot
Copy link
Member

miq-bot commented Feb 19, 2024

This pull request has been automatically marked as stale because it has not been updated for at least 3 months.

If these changes are still valid, please remove the stale label, make any changes requested by reviewers (if any), and ensure that this issue is being looked at by the assigned/reviewer(s).

4 similar comments
@miq-bot
Copy link
Member

miq-bot commented May 20, 2024

This pull request has been automatically marked as stale because it has not been updated for at least 3 months.

If these changes are still valid, please remove the stale label, make any changes requested by reviewers (if any), and ensure that this issue is being looked at by the assigned/reviewer(s).

@miq-bot
Copy link
Member

miq-bot commented Aug 26, 2024

This pull request has been automatically marked as stale because it has not been updated for at least 3 months.

If these changes are still valid, please remove the stale label, make any changes requested by reviewers (if any), and ensure that this issue is being looked at by the assigned/reviewer(s).

@miq-bot
Copy link
Member

miq-bot commented Dec 9, 2024

This pull request has been automatically marked as stale because it has not been updated for at least 3 months.

If these changes are still valid, please remove the stale label, make any changes requested by reviewers (if any), and ensure that this issue is being looked at by the assigned/reviewer(s).

@miq-bot
Copy link
Member

miq-bot commented Apr 14, 2025

This pull request has been automatically marked as stale because it has not been updated for at least 3 months.

If these changes are still valid, please remove the stale label, make any changes requested by reviewers (if any), and ensure that this issue is being looked at by the assigned/reviewer(s).

@miq-bot
Copy link
Member

miq-bot commented Jul 21, 2025

This pull request has been automatically marked as stale because it has not been updated for at least 3 months.

If these changes are still valid, please remove the stale label, make any changes requested by reviewers (if any), and ensure that this issue is being looked at by the assigned/reviewer(s).

Fryguy added a commit to Fryguy/manageiq-ui-classic that referenced this pull request Oct 31, 2025
In containerized deployments we can't support log collection, because we
can't mount the log depot. In appliance deployments, we're trying to get
away from the application UI having anything to do with the system it's
running on to avoid the need to elevate permissions. As such, this
commit removes log collection from the UI.

Instead, on appliances, users can manually mount an NFS server (or
really any server type - even more than our UI supports), and then use
the /var/www/miq/vmdb/tools/collect_logs tool. If the user needs
scheduling, they can schedule a cron on the appliance to run the tool.

Replaces ManageIQ#8235

Co-Authored-By: Melody-Ann-Seda-Marotte <[email protected]>
Fryguy added a commit to Fryguy/manageiq-ui-classic that referenced this pull request Oct 31, 2025
In containerized deployments we can't support log collection, because we
can't mount the log depot. In appliance deployments, we're trying to get
away from the application UI having anything to do with the system it's
running on to avoid the need to elevate permissions. As such, this
commit removes log collection from the UI.

Instead, on appliances, users can manually mount an NFS server (or
really any server type - even more than our UI supports), and then use
the /var/www/miq/vmdb/tools/collect_logs tool. If the user needs
scheduling, they can schedule a cron on the appliance to run the tool.

Replaces ManageIQ#8235

Co-Authored-By: Melody-Ann-Seda-Marotte <[email protected]>
@Fryguy
Copy link
Member

Fryguy commented Oct 31, 2025

Closing in favor of #9704

@Fryguy Fryguy closed this Oct 31, 2025
@miq-bot
Copy link
Member

miq-bot commented Oct 31, 2025

@MelsHyrule Cannot add the following reviewer because they are not recognized: kavyanekkalapu

@miq-bot
Copy link
Member

miq-bot commented Oct 31, 2025

@MelsHyrule 'kavyanekkalapu' is an invalid assignee, ignoring...

Fryguy added a commit to Fryguy/manageiq-ui-classic that referenced this pull request Oct 31, 2025
In containerized deployments we can't support log collection, because we
can't mount the log depot. In appliance deployments, we're trying to get
away from the application UI having anything to do with the system it's
running on to avoid the need to elevate permissions. As such, this
commit removes log collection from the UI.

Instead, on appliances, users can manually mount an NFS server (or
really any server type - even more than our UI supports), and then use
the /var/www/miq/vmdb/tools/collect_logs tool. If the user needs
scheduling, they can schedule a cron on the appliance to run the tool.

Replaces ManageIQ#8235

Co-Authored-By: Melody-Ann-Seda-Marotte <[email protected]>
Fryguy added a commit to Fryguy/manageiq-ui-classic that referenced this pull request Oct 31, 2025
In containerized deployments we can't support log collection, because we
can't mount the log depot. In appliance deployments, we're trying to get
away from the application UI having anything to do with the system it's
running on to avoid the need to elevate permissions. As such, this
commit removes log collection from the UI.

Instead, on appliances, users can manually mount an NFS server (or
really any server type - even more than our UI supports), and then use
the /var/www/miq/vmdb/tools/collect_logs tool. If the user needs
scheduling, they can schedule a cron on the appliance to run the tool.

Replaces ManageIQ#8235

Co-Authored-By: Melody-Ann-Seda-Marotte <[email protected]>
Fryguy added a commit to Fryguy/manageiq-ui-classic that referenced this pull request Oct 31, 2025
In containerized deployments we can't support log collection, because we
can't mount the log depot. In appliance deployments, we're trying to get
away from the application UI having anything to do with the system it's
running on to avoid the need to elevate permissions. As such, this
commit removes log collection from the UI.

Instead, on appliances, users can manually mount an NFS server (or
really any server type - even more than our UI supports), and then use
the /var/www/miq/vmdb/tools/collect_logs tool. If the user needs
scheduling, they can schedule a cron on the appliance to run the tool.

Replaces ManageIQ#8235

Co-Authored-By: Melody-Ann-Seda-Marotte <[email protected]>
Fryguy added a commit to Fryguy/manageiq-ui-classic that referenced this pull request Nov 1, 2025
In containerized deployments we can't support log collection, because we
can't mount the log depot. In appliance deployments, we're trying to get
away from the application UI having anything to do with the system it's
running on to avoid the need to elevate permissions. As such, this
commit removes log collection from the UI.

Instead, on appliances, users can manually mount an NFS server (or
really any server type - even more than our UI supports), and then use
the /var/www/miq/vmdb/tools/collect_logs tool. If the user needs
scheduling, they can schedule a cron on the appliance to run the tool.

Replaces ManageIQ#8235

Co-Authored-By: Melody-Ann-Seda-Marotte <[email protected]>
Fryguy added a commit to Fryguy/manageiq-ui-classic that referenced this pull request Nov 1, 2025
In containerized deployments we can't support log collection, because we
can't mount the log depot. In appliance deployments, we're trying to get
away from the application UI having anything to do with the system it's
running on to avoid the need to elevate permissions. As such, this
commit removes log collection from the UI.

Instead, on appliances, users can manually mount an NFS server (or
really any server type - even more than our UI supports), and then use
the /var/www/miq/vmdb/tools/collect_logs tool. If the user needs
scheduling, they can schedule a cron on the appliance to run the tool.

Replaces ManageIQ#8235

Co-Authored-By: Melody-Ann-Seda-Marotte <[email protected]>
Fryguy added a commit to Fryguy/manageiq-ui-classic that referenced this pull request Nov 3, 2025
In containerized deployments we can't support log collection, because we
can't mount the log depot. In appliance deployments, we're trying to get
away from the application UI having anything to do with the system it's
running on to avoid the need to elevate permissions. As such, this
commit removes log collection from the UI.

Instead, on appliances, users can manually mount an NFS server (or
really any server type - even more than our UI supports), and then use
the /var/www/miq/vmdb/tools/collect_logs tool. If the user needs
scheduling, they can schedule a cron on the appliance to run the tool.

Replaces ManageIQ#8235

Co-Authored-By: Melody-Ann-Seda-Marotte <[email protected]>
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.

File depot edit Page not displaying all the options

5 participants