https://pulp.plan.io/https://pulp.plan.io/favicon.ico2021-07-03T00:30:57ZPulpPulp - Issue #9008: PulpcoreClient::ExportersPulpExportsApi list results in uninitialized constant PulpcoreClient::AnyType errorhttps://pulp.plan.io/issues/9008?journal_id=727762021-07-03T00:30:57Zdkliban@redhat.com
<ul></ul><p>This regression in the bindings seems to have been introduced when we switched from using openapi-generator-cli v4.2.3 to v4.3.1.</p>
<p><a href="https://github.com/pulp/pulp-openapi-generator/pull/48" class="external">https://github.com/pulp/pulp-openapi-generator/pull/48</a></p>
<p>The following ruby script reproduced the issue for me:</p>
<pre><code>require 'pulpcore_client'
require 'pulp_file_client'
require 'tempfile'
require 'digest'
PulpcoreClient.configure do |config|
config.host= "http://localhost:24817"
config.username= 'admin'
config.password= 'password'
config.debugging=true
end
PulpFileClient.configure do |config|
config.host= "http://localhost:24817"
config.username= 'admin'
config.password= 'password'
config.debugging=true
end
@exporters_api = PulpcoreClient::ExportersPulpApi.new
@exports_api = PulpcoreClient::ExportersPulpExportsApi.new
@filerepositories_api = PulpFileClient::RepositoriesFileApi.new
@repoversions_api = PulpFileClient::RepositoriesFileVersionsApi.new
@fileremotes_api = PulpFileClient::RemotesFileApi.new
@tasks_api = PulpcoreClient::TasksApi.new
def monitor_task(task_href)
# Polls the Task API until the task is in a completed state.
#
# Prints the task details and a success or failure message. Exits on failure.
#
# Args:
# task_href(str): The href of the task to monitor
#
# Returns:
# list[str]: List of hrefs that identify resource created by the task
completed = []
task = @tasks_api.read(task_href)
until ["completed", "failed", "canceled"].include? task.state
sleep(2)
task = @tasks_api.read(task_href)
end
if task.state == 'completed'
task.created_resources
else
print("Task failed. Exiting.\n")
exit(2)
end
end
def content_range(start, finish, total)
finish = finish > total ? total : finish
"bytes #{start}-#{finish}/#{total}"
end
# Create a File Remote
remote_url = 'https://fixtures.pulpproject.org/file/PULP_MANIFEST'
remote_data = PulpFileClient::FileFileRemote.new({name: 'bar33', url: remote_url})
file_remote = @fileremotes_api.create(remote_data)
# Create a Repository
repository_data = PulpFileClient::FileFileRepository.new({name: 'foo33'})
file_repository = @filerepositories_api.create(repository_data)
# Sync a Repository
repository_sync_data = PulpFileClient::RepositorySyncURL.new({remote: file_remote.pulp_href})
sync_response = @filerepositories_api.sync(file_repository.pulp_href, repository_sync_data)
# Monitor the sync task
created_resources = monitor_task(sync_response.task)
repository_version_1 = @repoversions_api.read(created_resources[0])
# Create an exporter
exporter = @exporters_api.create({name: 'foo7', path: '/tmp/foo', repositories:[file_repository.pulp_href]})
# Create an export
export_response = @exports_api.create(exporter.pulp_href, versions: [repository_version_1.pulp_href])
created_resources = monitor_task(export_response.task)
# List exports
exports = @exports_api.list(exporter.pulp_href)
</code></pre> Pulp - Issue #9008: PulpcoreClient::ExportersPulpExportsApi list results in uninitialized constant PulpcoreClient::AnyType errorhttps://pulp.plan.io/issues/9008?journal_id=727782021-07-03T10:45:18Zdkliban@redhat.com
<ul></ul><p>I used git bisect to find the commit in openapi-generator which changed the behavior[0]. This commit was introduced in v4.3.1.</p>
<p>We have options for resolving this issue:</p>
<ol>
<li>
<p>Use openapi-generator v4.3.0 to generate ruby clients</p>
</li>
<li>
<p>Try to figure out how to fix the ruby templates to support this change (and contribute the change upstream)</p>
</li>
<li>
<p>Change the OpenAPI schema for exports to not use AnyType.</p>
</li>
</ol>
<p>[0] <a href="https://github.com/OpenAPITools/openapi-generator/commit/3bbaedd9bc086028e7b1be973a30e04870962e5d" class="external">https://github.com/OpenAPITools/openapi-generator/commit/3bbaedd9bc086028e7b1be973a30e04870962e5d</a></p> Pulp - Issue #9008: PulpcoreClient::ExportersPulpExportsApi list results in uninitialized constant PulpcoreClient::AnyType errorhttps://pulp.plan.io/issues/9008?journal_id=727792021-07-03T14:06:33Zdkliban@redhat.com
<ul><li><strong>Status</strong> changed from <i>NEW</i> to <i>ASSIGNED</i></li><li><strong>Assignee</strong> set to <i>dkliban@redhat.com</i></li></ul> Pulp - Issue #9008: PulpcoreClient::ExportersPulpExportsApi list results in uninitialized constant PulpcoreClient::AnyType errorhttps://pulp.plan.io/issues/9008?journal_id=727802021-07-03T14:08:02Zdkliban@redhat.com
<ul></ul><p>I decided that option 3 was the most correct. <a href="https://github.com/pulp/pulpcore/pull/1461" class="external">https://github.com/pulp/pulpcore/pull/1461</a></p> Pulp - Issue #9008: PulpcoreClient::ExportersPulpExportsApi list results in uninitialized constant PulpcoreClient::AnyType errorhttps://pulp.plan.io/issues/9008?journal_id=727812021-07-03T14:10:00Zpulpbot
<ul><li><strong>Status</strong> changed from <i>ASSIGNED</i> to <i>POST</i></li></ul><p>PR: <a href="https://github.com/pulp/pulpcore/pull/1461" class="external">https://github.com/pulp/pulpcore/pull/1461</a></p> Pulp - Issue #9008: PulpcoreClient::ExportersPulpExportsApi list results in uninitialized constant PulpcoreClient::AnyType errorhttps://pulp.plan.io/issues/9008?journal_id=728792021-07-07T14:55:28Ziballou
<ul><li><strong>Copied to</strong> <i><a class="issue tracker-7 status-11 priority-6 priority-default closed" href="/issues/9025">Backport #9025</a>: Backport fix for 9008 to 3.14.z -- PulpcoreClient::ExportersPulpExportsApi list results in uninitialized constant PulpcoreClient::AnyType error</i> added</li></ul> Pulp - Issue #9008: PulpcoreClient::ExportersPulpExportsApi list results in uninitialized constant PulpcoreClient::AnyType errorhttps://pulp.plan.io/issues/9008?journal_id=728832021-07-07T15:37:56Zdkliban@redhat.com
<ul><li><strong>Status</strong> changed from <i>POST</i> to <i>MODIFIED</i></li></ul><p>Applied in changeset <a class="changeset" title="Removes ambiguity from OpenAPI schema for Exports. This patch clearly defines the exported_resou..." href="https://pulp.plan.io/projects/pulp/repository/pulpcore/revisions/f52ba80e41ebbb532a87b6aa50821911a01348ff">pulpcore|f52ba80e41ebbb532a87b6aa50821911a01348ff</a>.</p> Pulp - Issue #9008: PulpcoreClient::ExportersPulpExportsApi list results in uninitialized constant PulpcoreClient::AnyType errorhttps://pulp.plan.io/issues/9008?journal_id=730402021-07-12T16:59:00Zdalleydalley@redhat.com
<ul><li><strong>Status</strong> changed from <i>MODIFIED</i> to <i>CLOSED - CURRENTRELEASE</i></li></ul><p>released in 3.14.1</p> Pulp - Issue #9008: PulpcoreClient::ExportersPulpExportsApi list results in uninitialized constant PulpcoreClient::AnyType errorhttps://pulp.plan.io/issues/9008?journal_id=748582021-08-26T12:08:58Zpulpbot
<ul><li><strong>Sprint/Milestone</strong> set to <i>3.15.0</i></li></ul>