Integration issue with new foreman

Hello All,

I have created one foreman plugin and integrated with foreman 1.9 version
where it was working fine.

But after upgrading my system fro 1.9 to 1.10 .It is throwing exception
like host_status not found and Also I am displaying hosts form
name_column(host) where it is throwing some array related exception.

Does we change the design or function of foreman in 1.10 release?

Thanks,
Aditya

> Hello All,
>
> I have created one foreman plugin and integrated with foreman 1.9
> version where it was working fine.
>
> But after upgrading my system fro 1.9 to 1.10 .It is throwing exception
> like host_status not found and Also I am displaying hosts form
> name_column(host) where it is throwing some array related exception.

Could you include the precise error details? Any code of yours leading
to the stack trace would be valuable too.

> Does we change the design or function of foreman in 1.10 release?

Every release changes somewhat. Some plugin APIs are public and
documented, but if you've extended internal-only things then it may well
change between releases.

··· On 22/03/16 12:28, Aditya Gupta wrote:


Dominic Cleal
dominic@cleal.org

Hello Dominic,

Thanks for the reply:

As it is not well maintained but Here like we have one Controller Action :

def version
begin
@hosts = Host.order("id")
Rails.logger.debug("Versions::version : Hosts Data fetched
successfully")

    @os_release = FactValue.joins(:fact_name).where("fact_names.name = 

'operatingsystemrelease'")
Rails.logger.debug("Versions::version : operating system release
fetched successfully")

    @last_reports = Report.where(:host_id => 

@hosts.map(&:id)).group(:host_id).maximum(:id)
Rails.logger.debug("Versions::version : last report fetched
successfully")

    @versions = CmVersion.find(:all)
    Rails.logger.debug("Versions::version : All versions fetched 

successfully")

  rescue => e

    Rails.logger.error("Versions::version : Failed to print all host 

list #{e.message}")

  end
end
··· ----------------------------------

Then we are using this in view :
<% @hosts.each do |host| %>

<%= name_column(host) %>

<%end%>

I am generating the hosts link as foreman is using in all hosts tab, but
when i am clicking onto it it is giving one error:

NoMethodError
*undefined method host_id' for [4, 8030]:Array* /usr/share/foreman/app/models/host_status/configuration_status.rb:102:inblock in handle_options’
/usr/share/foreman/app/models/host_status/configuration_status.rb:102:in
each' /usr/share/foreman/app/models/host_status/configuration_status.rb:102:infind’
/usr/share/foreman/app/models/host_status/configuration_status.rb:102:in
handle_options' /usr/share/foreman/app/models/host_status/configuration_status.rb:81:inrelevant?’
/usr/share/foreman/app/models/host_status/global.rb:14:in block in build' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/associations/collection_association.rb:82:inblock in select’
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/associations/collection_association.rb:82:in
select' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/associations/collection_association.rb:82:ineach’
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/associations/collection_association.rb:82:in
select' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/associations/collection_proxy.rb:46:inselect’
/usr/share/foreman/app/models/host_status/global.rb:10:in build' /usr/share/foreman/app/models/host/managed.rb:918:inbuild_global_status’
/usr/share/foreman/app/helpers/hosts_helper.rb:94:in
host_global_status_icon_class_for_host' /usr/share/foreman/app/helpers/hosts_helper.rb:83:inname_column’
/opt/rh/ruby193/root/usr/share/gems/gems/foreman_config_monitor-0.1.0/app/views/foreman_config_monitor/versions/_list_host.html.erb:36:in
block in _e5a2c3ec4622394b63bd101eebfecae2' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/relation/delegation.rb:6:ineach’
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/relation/delegation.rb:6:in
each' /opt/rh/ruby193/root/usr/share/gems/gems/foreman_config_monitor-0.1.0/app/views/foreman_config_monitor/versions/_list_host.html.erb:29:in_e5a2c3ec4622394b63bd101eebfecae2’
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_view/template.rb:145:in
block in render' /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/notifications.rb:125:ininstrument’
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_view/template.rb:143:in
render' /opt/theforeman/tfm/root/usr/share/gems/gems/deface-1.0.1/lib/deface/action_view_extensions.rb:41:inrender’
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_view/renderer/partial_renderer.rb:265:in
render_partial' /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_view/renderer/partial_renderer.rb:238:inblock in render’
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_view/renderer/abstract_renderer.rb:38:in
block in instrument' /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/notifications.rb:123:inblock in instrument’
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/notifications/instrumenter.rb:20:in
instrument' /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/notifications.rb:123:ininstrument’
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_view/renderer/abstract_renderer.rb:38:in
instrument' /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_view/renderer/partial_renderer.rb:237:inrender’
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_view/renderer/renderer.rb:41:in
render_partial' /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_view/renderer/renderer.rb:15:inrender’
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_view/helpers/rendering_helper.rb:24:in
render' /opt/rh/ruby193/root/usr/share/gems/gems/foreman_config_monitor-0.1.0/app/views/foreman_config_monitor/versions/version.html.erb:5:in_0e6c018de70ae8fe28e7480534b27874’
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_view/template.rb:145:in
block in render' /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/notifications.rb:125:ininstrument’
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_view/template.rb:143:in
render' /opt/theforeman/tfm/root/usr/share/gems/gems/deface-1.0.1/lib/deface/action_view_extensions.rb:41:inrender’
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_view/renderer/template_renderer.rb:47:in
block (2 levels) in render_template' /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_view/renderer/abstract_renderer.rb:38:inblock in instrument’
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/notifications.rb:123:in
block in instrument' /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/notifications/instrumenter.rb:20:ininstrument’
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/notifications.rb:123:in
instrument' /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_view/renderer/abstract_renderer.rb:38:ininstrument’
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_view/renderer/template_renderer.rb:46:in
block in render_template' /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_view/renderer/template_renderer.rb:54:inrender_with_layout’
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_view/renderer/template_renderer.rb:45:in
render_template' /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_view/renderer/template_renderer.rb:18:inrender’
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_view/renderer/renderer.rb:36:in
render_template' /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_view/renderer/renderer.rb:17:inrender’
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/rendering.rb:110:in
_render_template' /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/streaming.rb:225:in_render_template’
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/rendering.rb:103:in
render_to_body' /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/renderers.rb:28:inrender_to_body’
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/compatibility.rb:50:in
render_to_body' /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/rendering.rb:88:inrender’
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/rendering.rb:16:in
render' /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:40:inblock (2 levels) in render’
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/core_ext/benchmark.rb:5:in
block in ms' /opt/rh/ruby193/root/usr/share/ruby/benchmark.rb:295:inrealtime’
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/core_ext/benchmark.rb:5:in
ms' /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:40:inblock in render’
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:83:in
cleanup_view_runtime' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/railties/controller_runtime.rb:24:incleanup_view_runtime’
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:39:in
render' /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/implicit_render.rb:10:indefault_render’
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/implicit_render.rb:5:in
send_action' /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/base.rb:167:inprocess_action’
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/rendering.rb:10:in
process_action' /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/callbacks.rb:18:inblock in process_action’
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:627:in
block (4 levels) in _run__3871211701244590454__process_action__3274236218785665339__callbacks' /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:215:inblock in _conditional_callback_around_8674’
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:326:in
around' /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:310:in_callback_around_3728’
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:214:in
_conditional_callback_around_8674' /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:626:inblock (3 levels) in
_run__3871211701244590454__process_action__3274236218785665339__callbacks’
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:215:in
block in _conditional_callback_around_8673' /usr/share/foreman/app/controllers/concerns/application_shared.rb:13:inset_timezone’
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:214:in
_conditional_callback_around_8673' /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:625:inblock (2 levels) in
_run__3871211701244590454__process_action__3274236218785665339__callbacks’
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:215:in
block in _conditional_callback_around_8672' /usr/share/foreman/app/models/concerns/foreman/thread_session.rb:32:inclear_thread’
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:214:in
_conditional_callback_around_8672' /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:448:inblock in
_run__3871211701244590454__process_action__3274236218785665339__callbacks’
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:215:in
block in _conditional_callback_around_8671' /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:326:inaround’
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:310:in
_callback_around_13' /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:214:in_conditional_callback_around_8671’
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:414:in
_run__3871211701244590454__process_action__3274236218785665339__callbacks' /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in__run_callback’
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:385:in
_run_process_action_callbacks' /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:81:inrun_callbacks’
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/callbacks.rb:17:in
process_action' /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/rescue.rb:29:inprocess_action’
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:30:in
block in process_action' /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/notifications.rb:123:inblock in instrument’
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/notifications/instrumenter.rb:20:in
instrument' /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/notifications.rb:123:ininstrument’
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:29:in
process_action' /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/params_wrapper.rb:207:inprocess_action’
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/railties/controller_runtime.rb:18:in
process_action' /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/base.rb:121:inprocess’
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/rendering.rb:45:in
process' /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal.rb:203:indispatch’
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/rack_delegation.rb:14:in
dispatch' /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal.rb:246:inblock in action’
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:73:in
call' /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:73:indispatch’
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:36:in
call' /opt/rh/ruby193/root/usr/share/gems/gems/journey-1.0.4/lib/journey/router.rb:68:inblock in call’
/opt/rh/ruby193/root/usr/share/gems/gems/journey-1.0.4/lib/journey/router.rb:56:in
each' /opt/rh/ruby193/root/usr/share/gems/gems/journey-1.0.4/lib/journey/router.rb:56:incall’
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:600:in
call' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.2.6/lib/apipie/static_dispatcher.rb:65:incall’
/opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.2.6/lib/apipie/extractor/recorder.rb:97:in
call' /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/static.rb:62:incall’
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/static.rb:62:in
call' /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/static.rb:62:incall’
/opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.2.6/lib/apipie/middleware/checksum_in_headers.rb:27:in
call' /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/best_standards_support.rb:17:incall’
/opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/etag.rb:23:in
call' /opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/conditionalget.rb:25:incall’
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/head.rb:14:in
call' /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/params_parser.rb:21:incall’
/usr/share/foreman/lib/middleware/catch_json_parse_errors.rb:9:in call' /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/flash.rb:242:incall’
/opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:205:in
context' /opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:200:incall’
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/cookies.rb:339:in
call' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/query_cache.rb:64:incall’
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:473:in
call' /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/callbacks.rb:28:inblock in call’
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in
_run__1889425605210970480__call__2618019341734894967__callbacks' /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in__run_callback’
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:385:in
_run_call_callbacks' /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:81:inrun_callbacks’
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/callbacks.rb:27:in
call' /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/remote_ip.rb:31:incall’
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/debug_exceptions.rb:16:in
call' /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/show_exceptions.rb:56:incall’
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/rack/logger.rb:26:in
call_app' /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/rack/logger.rb:16:incall’
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/request_id.rb:22:in
call' /opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/methodoverride.rb:21:incall’
/opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/runtime.rb:17:in
call' /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/cache/strategy/local_cache.rb:72:incall’
/opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/lock.rb:15:in
call' /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/static.rb:62:incall’
/opt/rh/ruby193/root/usr/share/gems/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in
forward' /opt/rh/ruby193/root/usr/share/gems/gems/rack-cache-1.2/lib/rack/cache/context.rb:245:infetch’
/opt/rh/ruby193/root/usr/share/gems/gems/rack-cache-1.2/lib/rack/cache/context.rb:185:in
lookup' /opt/rh/ruby193/root/usr/share/gems/gems/rack-cache-1.2/lib/rack/cache/context.rb:66:incall!’
/opt/rh/ruby193/root/usr/share/gems/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in
`call’
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails

> Hello Dominic,
>
> Thanks for the reply:
>
> As it is not well maintained but Here like we have one Controller Action :
>
> def version
> begin
> @hosts = Host.order("id")
> Rails.logger.debug("Versions::version : Hosts Data fetched
> successfully")
>
> @os_release = FactValue.joins(:fact_name).where("fact_names.name
> = 'operatingsystemrelease'")
> Rails.logger.debug("Versions::version : operating system release
> fetched successfully")
>
> @last_reports = Report.where(:host_id =>
> @hosts.map(&:id)).group(:host_id).maximum(:id)

The contents of this instance variable changed to reports, not IDs:

Updating it to fill those two instance variables as above should fix it.

> 2. in new release foreman changed it host_status function where in
> previous release it reported the string with status but now this
> function removed and has some different implementation.

Yeah, most controller-specific helpers shouldn't be considered stable
APIs and will change. The general application-wide layout/form ones are
pretty stable.

··· On 22/03/16 14:36, Aditya Gupta wrote:


Dominic Cleal
dominic@cleal.org

Thanks Alot Dominic.

So what would you suggest to me , how should i avoid such issue in future .

And in such cases should we manage two different version of plugin as it
has different functionality cases like status of the host .

thanks,
Aditya

> So what would you suggest to me , how should i avoid such issue in future .

Check where helpers you're depending on are defined, as I'd suggest that
helpers in app/helpers/hosts_helper.rb shouldn't be relied upon too much
by plugins - they're only really intended to be used in our own hosts views.

You could also use Rails functional tests running against Foreman's
develop or stable branches to catch these kind of errors early. You can
always raise a bug then against Foreman if it's an important API to let
us know we've broken it before release. (Though in this case, it
probably isn't applicable.)

If you think we've got useful code in Foreman core that plugins should
be using then it might be worth helping us standardise it by either
moving it to the application-wide helpers and/or writing tests to
include in Foreman core for the helper's API to ensure we keep it unchanged.

> And in such cases should we manage two different version of plugin as it
> has different functionality cases like status of the host .

Yes, I'd generally recommend that. Most plugins use branching
successfully, so they'd have a master branch that's compatible with the
latest Foreman (or even our develop/nightly branch), then use stable
branches that have tweaks for older versions of Foreman or that don't
use newly available features.

You can sometimes use checks like respond_to?, but it's hacky and harder
to test.

··· On 22/03/16 14:48, Aditya Gupta wrote:


Dominic Cleal
dominic@cleal.org

>
> Thanks Alot , you always provided helpful information.

Last question :slight_smile:

This is regarding security vulnerability, how we release patches for that:

For ex:

If we found some security vulnerability in release 1.9.2 and we already
have upgraded version 1.10.2 where we fixed such cases .So, are we fixing
these security vulnerability in same release like 1.9.3 or we suggest user
to upgrade system(1.10.2) and we are not going to fix in 1.9.2.

Thanks,
Aditya

It depends on the severity of the security issue, risk of the patch and
how long since the last 1.9.x release. Generally for medium or high
severity issues then it gets released in the next 1.9.x as well as say
1.10.x. If it was low to medium then we probably wouldn't schedule a
new 1.9.x release just for it, only if there were more fixes to release
with it.

But you're right in that usually we only release from one or two streams
at a time, so either 1.9 or 1.10 - there's a small overlap of a few
weeks where the old release might still get updated after 1.10.0 was
released if there are enough relevant and important fixes.

Right now we're close to releasing 1.11.0 (RC3 should be today) and I'm
planning to do 1.10.3 next week as we have 15 tickets for it. One is a
low-medium security issue
(Foreman :: Security) and will be included.
There could be a 1.10.4 if there are enough tickets in ~4 weeks time.

http://projects.theforeman.org/projects/foreman/wiki/Development_Resources#Release-process
has links to each release schedule, I try and keep these up to date with
my plans. The release management wiki page linked there also has info
on schedules and timings.

··· On 23/03/16 05:46, Aditya Gupta wrote: > Thanks Alot , you always provided helpful information. > > > Last question :) > > This is regarding security vulnerability, how we release patches for that: > > For ex: > > If we found some security vulnerability in release 1.9.2 and we already > have upgraded version 1.10.2 where we fixed such cases .So, are we > fixing these security vulnerability in same release like 1.9.3 or we > suggest user to upgrade system(1.10.2) and we are not going to fix in 1.9.2.


Dominic Cleal
dominic@cleal.org

>
> Thanks alot Dominic…

I am willing to contribute in upstream but not confident enough… :frowning: