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

Fixes #36686 - temporarily patch out Pulp dist hidden field #10701

Merged
merged 1 commit into from
Aug 21, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ AllCops:
- node_modules/**/*
- Gemfile
- locale/action_names.rb
- lib/monkeys/remove_hidden_distribution.rb
Include:
- '**/*.rb'
- app/views/**/*.rabl
Expand Down
1 change: 1 addition & 0 deletions config/initializers/monkeys.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
require 'monkeys/anemone'
require 'monkeys/ar_postgres_evr_t'
require 'monkeys/fx_sqlite_skip'
require 'monkeys/remove_hidden_distribution'
163 changes: 163 additions & 0 deletions lib/monkeys/remove_hidden_distribution.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
require 'pulp_rpm_client'
require 'pulp_container_client'
require 'pulp_ostree_client'
PulpRpmClient::RpmRpmDistribution.class_eval do
# Initializes the object
# @param [Hash] attributes Model attributes in the form of hash
def initialize(attributes = {})
if (!attributes.is_a?(Hash))
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpRpmClient::RpmRpmDistribution` initialize method"
end

# check to see if the attribute exists and convert string to symbol for hash key
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpRpmClient::RpmRpmDistribution`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
end
h[k.to_sym] = v
}

if attributes.key?(:'base_path')
self.base_path = attributes[:'base_path']
end

if attributes.key?(:'content_guard')
self.content_guard = attributes[:'content_guard']
end

if attributes.key?(:'hidden')
self.hidden = attributes[:'hidden']
# Monkey-patch here. The rest of the initializer is copied from the library code.
#else
# self.hidden = false
end

if attributes.key?(:'pulp_labels')
if (value = attributes[:'pulp_labels']).is_a?(Hash)
self.pulp_labels = value
end
end

if attributes.key?(:'name')
self.name = attributes[:'name']
end

if attributes.key?(:'repository')
self.repository = attributes[:'repository']
end

if attributes.key?(:'publication')
self.publication = attributes[:'publication']
end
end
end

PulpContainerClient::ContainerContainerDistribution.class_eval do
# Initializes the object
# @param [Hash] attributes Model attributes in the form of hash
def initialize(attributes = {})
if (!attributes.is_a?(Hash))
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpContainerClient::ContainerContainerDistribution` initialize method"
end

# check to see if the attribute exists and convert string to symbol for hash key
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpContainerClient::ContainerContainerDistribution`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
end
h[k.to_sym] = v
}

if attributes.key?(:'pulp_labels')
if (value = attributes[:'pulp_labels']).is_a?(Hash)
self.pulp_labels = value
end
end

if attributes.key?(:'content_guard')
self.content_guard = attributes[:'content_guard']
end

if attributes.key?(:'repository')
self.repository = attributes[:'repository']
end

if attributes.key?(:'name')
self.name = attributes[:'name']
end

if attributes.key?(:'hidden')
self.hidden = attributes[:'hidden']
# Monkey-patch here. The rest of the initializer is copied from the library code.
#else
# self.hidden = false
end

if attributes.key?(:'base_path')
self.base_path = attributes[:'base_path']
end

if attributes.key?(:'repository_version')
self.repository_version = attributes[:'repository_version']
end

if attributes.key?(:'private')
self.private = attributes[:'private']
end

if attributes.key?(:'description')
self.description = attributes[:'description']
end
end
end

PulpOstreeClient::OstreeOstreeDistribution.class_eval do
# Initializes the object
# @param [Hash] attributes Model attributes in the form of hash
def initialize(attributes = {})
if (!attributes.is_a?(Hash))
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpOstreeClient::OstreeOstreeDistribution` initialize method"
end

# check to see if the attribute exists and convert string to symbol for hash key
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpOstreeClient::OstreeOstreeDistribution`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
end
h[k.to_sym] = v
}

if attributes.key?(:'base_path')
self.base_path = attributes[:'base_path']
end

if attributes.key?(:'content_guard')
self.content_guard = attributes[:'content_guard']
end

if attributes.key?(:'hidden')
self.hidden = attributes[:'hidden']
# Monkey-patch here. The rest of the initializer is copied from the library code.
#else
# self.hidden = false
end

if attributes.key?(:'pulp_labels')
if (value = attributes[:'pulp_labels']).is_a?(Hash)
self.pulp_labels = value
end
end

if attributes.key?(:'name')
self.name = attributes[:'name']
end

if attributes.key?(:'repository')
self.repository = attributes[:'repository']
end

if attributes.key?(:'repository_version')
self.repository_version = attributes[:'repository_version']
end
end
end
Loading
Loading