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

Switches plugin reporting to use Django name #1102

Merged

Conversation

bmbouter
Copy link
Member

@bmbouter bmbouter commented Feb 1, 2021

The Status API and the OpenAPI schema API now both use the Django name.
This is a backwards incompatible change, but necessary to fix the bug
which was using Python package names incorrectly instead.

This also reapplies the plugin template changes required from the PR
below:

https://github.com/pulp/plugin_template/pull/341/files

closes #8198

@bmbouter bmbouter force-pushed the make-status-api-use-versions-from-plugins branch 2 times, most recently from 7d55deb to 196be42 Compare February 1, 2021 21:38
@bmbouter
Copy link
Member Author

bmbouter commented Feb 1, 2021

This changes from

    "versions": [
        {
            "component": "pulpcore",
            "version": "3.10.0.dev0"
        },
        {
            "component": "pulp_ansible",
            "version": "0.7.0.dev0"
        },
        {
            "component": "pulp_file",
            "version": "1.6.0.dev0"
        }
    ]

To

    "versions": [
        {
            "component": "core",
            "version": "3.10.0.dev"
        },
        {
            "component": "ansible",
            "version": "0.7.0.dev"
        },
        {
            "component": "file",
            "version": "1.6.0.dev"
        }
    ],

Copy link
Member

@mdellweg mdellweg left a comment

Choose a reason for hiding this comment

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

Sounds good to me.
Just a coding style suggestion.

"pulpcore==3.10, plugins are required to define their version on the "
"PulpPluginAppConfig subclass."
)
warnings.warn(msg, FutureWarning)
raise ImproperlyConfigured(msg.format(self.label))
Copy link
Member

Choose a reason for hiding this comment

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

👍

Comment on lines +450 to +452
result["info"]["x-pulp-app-versions"] = {}
for app in pulp_plugin_configs():
result["info"]["x-pulp-app-versions"][app.label] = app.version
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
result["info"]["x-pulp-app-versions"] = {}
for app in pulp_plugin_configs():
result["info"]["x-pulp-app-versions"][app.label] = app.version
result["info"]["x-pulp-app-versions"] = {
app.label: app.version
for app in pulp_plugin_configs()
}

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd like to decline this change if that's alright. The list comprehension with the iterator at the end is less readable for me. What I wrote is a bit slower though.

Copy link
Member

@goosemania goosemania left a comment

Choose a reason for hiding this comment

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

Thanks! Looks good to me.

@goosemania
Copy link
Member

This changes from

    "versions": [
        {
            "component": "pulpcore",
            "version": "3.10.0.dev0"
        },
        {
            "component": "pulp_ansible",
            "version": "0.7.0.dev0"
        },
        {
            "component": "pulp_file",
            "version": "1.6.0.dev0"
        }
    ]

To

    "versions": [
        {
            "component": "core",
            "version": "3.10.0.dev"
        },
        {
            "component": "ansible",
            "version": "0.7.0.dev"
        },
        {
            "component": "file",
            "version": "1.6.0.dev"
        }
    ],

@jlsherrill , FYI, this change is coming in 3.10. I think Katello uses the status endpoint to check pulp services state but I wonder if you check the installed plugins as well.

]
versions = []
for app in pulp_plugin_configs():
versions.append({"component": app.label, "version": app.version})
Copy link
Member

Choose a reason for hiding this comment

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

I just realized, this changes the keys and not only the trailing "0" in the versions.
This will break the version check logic in the cli.
Can we get back to the old names`

Copy link
Member Author

Choose a reason for hiding this comment

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

I also thought about this, but I don't see an easy way to. :/ What this change does is hand control over to the plugin for the name it provides. So it's up to the plugins really. Let's talk about it at the pulpcore meeting, I put an agenda item on there.

Copy link
Member

Choose a reason for hiding this comment

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

And BTW. This is what breaks the CI here too.

@bmbouter
Copy link
Member Author

bmbouter commented Feb 2, 2021

This PR will become for 3.11. For 3.10 I've moved the non-breaking changes to this PR #1106

@bmbouter bmbouter marked this pull request as draft February 2, 2021 19:24
@bmbouter bmbouter force-pushed the make-status-api-use-versions-from-plugins branch 2 times, most recently from e1494d5 to 59e3887 Compare February 2, 2021 19:37
@bmbouter
Copy link
Member Author

bmbouter commented Feb 2, 2021

@mdellweg any link on where I should look to fix the CI? Also is this something I'll need to also fix in the plugin template?

@mdellweg
Copy link
Member

mdellweg commented Feb 2, 2021

@mdellweg any link on where I should look to fix the CI? Also is this something I'll need to also fix in the plugin template?

https://github.com/pulp/pulpcore/blob/master/.ci/ansible/start_container.yaml#L87 is the check that fails.
https://github.com/pulp/pulpcore/blob/master/.github/workflows/scripts/before_install.sh#L37 is where that variable is set.

@mdellweg
Copy link
Member

mdellweg commented Feb 2, 2021

Thinking more about this: The check is really valuable, as it catches oops-we-updated-the-thing-to-test-from-pypi-because-of-dependencies mistakes. But it relies on the assumption that there is only one plugin in the repository.

@bmbouter
Copy link
Member Author

bmbouter commented Feb 3, 2021

@mdellweg I agree it's valuable but we no longer have info required to perform it (right?). All I can think to do is to disable the check. What are our other options? Can you (or someone on the CI team) give me some advice? Thanks!

@mdellweg
Copy link
Member

mdellweg commented Feb 8, 2021

@mdellweg I agree it's valuable but we no longer have info required to perform it (right?). All I can think to do is to disable the check. What are our other options? Can you (or someone on the CI team) give me some advice? Thanks!

For our well curated "single_plugins_in_one_repo" we should still able to find the information what version it is supposed to be, right? I really want to avoid testing a released version instead of failing for dependency issues.

@bmbouter
Copy link
Member Author

bmbouter commented Feb 8, 2021

@mdellweg my apologies. I'm haven't looked into that CI check yet and I'm not up to speed on what it does. Can you elaborate a bit more? Thanks!

@mdellweg
Copy link
Member

mdellweg commented Feb 8, 2021

Sure, it makes sure, that the code that is installed inside the container is the one we are supposed to test.
We had previous incidents, where a plugin by not being compatible with the provided version of pulpcore downgraded pulpcore to a compatible one from pypi, and if it weren't for mismatching functional tests, this would have gone unnoticed.

@bmbouter bmbouter force-pushed the make-status-api-use-versions-from-plugins branch from 59e3887 to 638262f Compare February 17, 2021 16:38
@@ -34,7 +34,7 @@ else
fi
mkdir .ci/ansible/vars || true
echo "---" > .ci/ansible/vars/main.yaml
echo "component_name: pulpcore" >> .ci/ansible/vars/main.yaml
echo "component_name: pulp" >> .ci/ansible/vars/main.yaml
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
echo "component_name: pulp" >> .ci/ansible/vars/main.yaml
echo "component_name: core" >> .ci/ansible/vars/main.yaml

@@ -19,7 +19,7 @@ deploy_daily_client_to_rubygems: true
deploy_to_pypi: true
docker_fixtures: true
docs_test: true
plugin_app_label: pulpcore
plugin_app_label: pulp
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
plugin_app_label: pulp
plugin_app_label: core

@bmbouter bmbouter force-pushed the make-status-api-use-versions-from-plugins branch from 638262f to 312a7b4 Compare February 17, 2021 17:01
@mdellweg
Copy link
Member

I'm about to say ACK here, but we need to merge
pulp/plugin_template#341
first and roll it out to all plugins (and their still tested stable branches) first.

@bmbouter bmbouter force-pushed the make-status-api-use-versions-from-plugins branch from 312a7b4 to ce4a8a6 Compare February 17, 2021 18:48
@bmbouter
Copy link
Member Author

@mdellweg I reapplied the plugin template from https://github.com/pulp/plugin_template/pull/341/files and pushed it here to see if this change will pass with that plugin template change.

The Status API and the OpenAPI schema API now both use the Django name.
This is a backwards incompatible change, but necessary to fix the bug
which was using Python package names incorrectly instead.

This also reapplies the plugin template changes required from the PR
below:

https://github.com/pulp/plugin_template/pull/341/files

closes #8198
@bmbouter bmbouter force-pushed the make-status-api-use-versions-from-plugins branch from ce4a8a6 to 721c8d1 Compare February 18, 2021 12:10
mdellweg added a commit to mdellweg/pulp_file that referenced this pull request Feb 18, 2021
This accommodates for a change in pulpcore that will effect the CI.

pulp/pulpcore#1102

[noissue]
mdellweg added a commit to mdellweg/pulp-2to3-migration that referenced this pull request Feb 18, 2021
This accommodates for a change in pulpcore that will effect the CI.

pulp/pulpcore#1102

[noissue]
mdellweg added a commit to mdellweg/pulp_deb that referenced this pull request Feb 18, 2021
This accommodates for a change in pulpcore that will effect the CI.

pulp/pulpcore#1102

[noissue]
mdellweg added a commit to mdellweg/pulp_deb that referenced this pull request Feb 18, 2021
This accommodates for a change in pulpcore that will effect the CI.

pulp/pulpcore#1102

[noissue]
mdellweg added a commit to mdellweg/pulp_maven that referenced this pull request Feb 18, 2021
This accommodates for a change in pulpcore that will effect the CI.

pulp/pulpcore#1102

[noissue]
mdellweg added a commit to mdellweg/pulp_npm that referenced this pull request Feb 18, 2021
This accommodates for a change in pulpcore that will effect the CI.

pulp/pulpcore#1102

[noissue]
mdellweg added a commit to mdellweg/pulp_python that referenced this pull request Feb 18, 2021
This accommodates for a change in pulpcore that will effect the CI.

pulp/pulpcore#1102

[noissue]
mdellweg added a commit to mdellweg/pulp_rpm that referenced this pull request Feb 18, 2021
This accommodates for a change in pulpcore that will effect the CI.

pulp/pulpcore#1102

[noissue]
mdellweg added a commit to pulp/pulp_container that referenced this pull request Feb 19, 2021
This accommodates for a change in pulpcore that will effect the CI.

pulp/pulpcore#1102

[noissue]
mdellweg added a commit to mdellweg/pulp-2to3-migration that referenced this pull request Feb 22, 2021
This accommodates for a change in pulpcore that will effect the CI.

pulp/pulpcore#1102

[noissue]
mdellweg added a commit to mdellweg/pulp_rpm that referenced this pull request Feb 22, 2021
This accommodates for a change in pulpcore that will effect the CI.

pulp/pulpcore#1102

[noissue]
goosemania pushed a commit to pulp/pulp-2to3-migration that referenced this pull request Feb 22, 2021
This accommodates for a change in pulpcore that will effect the CI.

pulp/pulpcore#1102

[noissue]
mdellweg added a commit to mdellweg/pulp_rpm that referenced this pull request Feb 22, 2021
This accommodates for a change in pulpcore that will effect the CI.

pulp/pulpcore#1102

[noissue]
ggainey pushed a commit to pulp/pulp-certguard that referenced this pull request Feb 22, 2021
This accommodates for a change in pulpcore that will effect the CI.

pulp/pulpcore#1102

[noissue]
dralley pushed a commit to pulp/pulp_file that referenced this pull request Feb 22, 2021
This accommodates for a change in pulpcore that will effect the CI.

pulp/pulpcore#1102

[noissue]
dralley pushed a commit to pulp/pulp_rpm that referenced this pull request Feb 22, 2021
This accommodates for a change in pulpcore that will effect the CI.

pulp/pulpcore#1102

[noissue]
bmbouter pushed a commit to pulp/pulp_maven that referenced this pull request Feb 22, 2021
This accommodates for a change in pulpcore that will effect the CI.

pulp/pulpcore#1102

[noissue]
bmbouter pushed a commit to pulp/pulp_npm that referenced this pull request Feb 22, 2021
This accommodates for a change in pulpcore that will effect the CI.

pulp/pulpcore#1102

[noissue]
bmbouter pushed a commit to pulp/pulp_ansible that referenced this pull request Feb 22, 2021
This accommodates for a change in pulpcore that will effect the CI.

pulp/pulpcore#1102

[noissue]
dralley pushed a commit to dralley/pulp_file that referenced this pull request Feb 22, 2021
This accommodates for a change in pulpcore that will effect the CI.

pulp/pulpcore#1102

[noissue]
@pulp pulp deleted a comment from pulpbot Feb 23, 2021
@pulpbot
Copy link
Member

pulpbot commented Feb 23, 2021

Attached issue: https://pulp.plan.io/issues/8198

@mdellweg mdellweg marked this pull request as ready for review February 25, 2021 15:03
@bmbouter bmbouter merged commit b027af8 into pulp:master Feb 25, 2021
@bmbouter bmbouter deleted the make-status-api-use-versions-from-plugins branch February 25, 2021 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants