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

Add convert2rhel fact to host report #896

Merged
merged 4 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion foreman_rh_cloud.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Gem::Specification.new do |s|

s.add_dependency 'foreman_ansible'
s.add_dependency 'foreman-tasks'
s.add_dependency 'katello'
s.add_runtime_dependency 'katello', '>= 4.14.0.rc1.1'

s.add_development_dependency 'rdoc'
s.add_development_dependency 'theforeman-rubocop', '~> 0.1.0'
Expand Down
1 change: 1 addition & 0 deletions lib/foreman_inventory_upload/generators/slice.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def report_host(host)
@stream.simple_field('account', account_id(host.organization).to_s)
@stream.simple_field('subscription_manager_id', uuid_value!(host.subscription_facet&.uuid))
@stream.simple_field('satellite_id', uuid_value!(host.subscription_facet&.uuid))
@stream.simple_field('convert2rhel_through_foreman', host.subscription_facet&.convert2rhel_through_foreman)
@stream.simple_field('bios_uuid', bios_uuid(host))
@stream.simple_field('vm_uuid', uuid_value(fact_value(host, 'virt::uuid')))
@stream.simple_field('insights_id', uuid_value(fact_value(host, 'insights_id')))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ class MachineTelemetriesControllerTest < ActionController::TestCase
context '#branch_info' do
setup do
User.current = User.find_by(login: 'secret_admin')
Setting[:allow_multiple_content_views] = true
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is going to break downstream, unless we expose the setting via foreman_theme_satellite.

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, I am missing something. Is this setting introduced by the theme? I think I have seen it in Katello.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The multi-CV feature isn't fully complete yet, so it's blocked downstream. See https://github.com/RedHatSatellite/foreman_theme_satellite/blob/develop/app/models/concerns/upstream_only_settings.rb

This means that downstream, the setting is not exposed and Setting[:allow_multiple_content_views] = true will error.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

additional context: This had been working (unintentionally) until Katello implemented https://projects.theforeman.org/issues/37657

Copy link
Member

Choose a reason for hiding this comment

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

@jeremylenz Can you add a if condition or dry catch to skip the test if the setting is not there?


@env = FactoryBot.create(:katello_k_t_environment)
@env2 = FactoryBot.create(:katello_k_t_environment, organization: @env.organization)
Expand Down
1 change: 1 addition & 0 deletions test/unit/tags_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class TagsGeneratorTest < ActiveSupport::TestCase

setup do
User.current = User.find_by(login: 'secret_admin')
Setting[:allow_multiple_content_views] = true

env = FactoryBot.create(:katello_k_t_environment)
env2 = FactoryBot.create(:katello_k_t_environment, organization: env.organization)
Expand Down