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

Format plugin name to fix CI #3469

Merged
merged 2 commits into from
Jan 2, 2024
Merged

Format plugin name to fix CI #3469

merged 2 commits into from
Jan 2, 2024

Conversation

AhdraMeraliQB
Copy link
Contributor

@AhdraMeraliQB AhdraMeraliQB commented Jan 2, 2024

Description

Resolves #3461 and #3464

Development notes

Tests were failing because they were attempting to disable test-plugin, however within #3329 the plugin name was changed to test_plugin and therefore was not being properly disabled. In this PR the name is change back, following package naming convention and fixing the e2e tests.

Developer Certificate of Origin

We need all contributions to comply with the Developer Certificate of Origin (DCO). All commits must be signed off by including a Signed-off-by line in the commit message. See our wiki for guidance.

If your PR is blocked due to unsigned commits, then you must follow the instructions under "Rebase the branch" on the GitHub Checks page for your PR. This will retroactively add the sign-off to all unsigned commits and allow the DCO check to pass.

Checklist

  • Read the contributing guidelines
  • Signed off each commit with a Developer Certificate of Origin (DCO)
  • Opened this PR as a 'Draft Pull Request' if it is work-in-progress
  • Updated the documentation to reflect the code changes
  • Added a description of this change in the RELEASE.md file
  • Added tests to cover my changes
  • Checked if this change will affect Kedro-Viz, and if so, communicated that with the Viz team

Signed-off-by: Ahdra Merali <[email protected]>
@AhdraMeraliQB AhdraMeraliQB marked this pull request as ready for review January 2, 2024 15:00
Copy link
Member

@merelcht merelcht left a comment

Choose a reason for hiding this comment

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

It's surprising to me that this change fixes things, because it seems to be the opposite of what we describe in the docs: https://docs.kedro.org/en/stable/extend_kedro/plugins.html#cli-hooks

@DimedS
Copy link
Contributor

DimedS commented Jan 2, 2024

It's surprising to me that this change fixes things, because it seems to be the opposite of what we describe in the docs: https://docs.kedro.org/en/stable/extend_kedro/plugins.html#cli-hooks

Looks like we should modify our codes to use "test_plugin" name, not revert name back

@AhdraMeraliQB
Copy link
Contributor Author

CC: @DimedS @merelcht

There are two avenues for the fix, either changing the name to match what the test looks for, or modify the test to look for the different name. I went for the former as using a hyphen instead of an underscore seems to match the convention we use in for our plugins kedro-airflow, kedro-datasets, kedro-docker, and kedro-telemetry, but happy to go with the latter.

@AhdraMeraliQB
Copy link
Contributor Author

It's surprising to me that this change fixes things, because it seems to be the opposite of what we describe in the docs: https://docs.kedro.org/en/stable/extend_kedro/plugins.html#cli-hooks

I don't see how our docs conflict with this change, it's ultimately (I believe) a choice of formatting, and the docs make no mention of settings.py as far as I can see, which is where we reference the plugin name in our tests

@DimedS
Copy link
Contributor

DimedS commented Jan 2, 2024

CC: @DimedS @merelcht

There are two avenues for the fix, either changing the name to match what the test looks for, or modify the test to look for the different name. I went for the former as using a hyphen instead of an underscore seems to match the convention we use in for our plugins kedro-airflow, kedro-datasets, kedro-docker, and kedro-telemetry, but happy to go with the latter.

Yes, you right, that package naming is our common situation, but I think it's better to leave entry point "test_plugin", I think previously it was the same.

Copy link
Contributor

@DimedS DimedS left a comment

Choose a reason for hiding this comment

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

Thank you, @AhdraMeraliQB ! I think we should fix only name, not entry-point?

@merelcht
Copy link
Member

merelcht commented Jan 2, 2024

It's surprising to me that this change fixes things, because it seems to be the opposite of what we describe in the docs: https://docs.kedro.org/en/stable/extend_kedro/plugins.html#cli-hooks

I don't see how our docs conflict with this change, it's ultimately (I believe) a choice of formatting, and the docs make no mention of settings.py as far as I can see, which is where we reference the plugin name in our tests

What I meant is that in the docs we talk about a plugin called "plugin-name" e.g. "my-plugin", should then be referenced in the pyproject.toml as:

[project.entry-points."kedro.hooks"]
plugin_name = "plugin_name.plugin:hooks"

So for "my-plugin" this should be:

[project.entry-points."kedro.hooks"]
my_plugin = "my_plugin.plugin:hooks"

So the change here to

[project.entry-points."kedro.hooks"]
test-plugin = "plugin:hooks"

seems conflicting to me.

Signed-off-by: Ahdra Merali <[email protected]>
@AhdraMeraliQB
Copy link
Contributor Author

It's surprising to me that this change fixes things, because it seems to be the opposite of what we describe in the docs: https://docs.kedro.org/en/stable/extend_kedro/plugins.html#cli-hooks

I don't see how our docs conflict with this change, it's ultimately (I believe) a choice of formatting, and the docs make no mention of settings.py as far as I can see, which is where we reference the plugin name in our tests

What I meant is that in the docs we talk about a plugin called "plugin-name" e.g. "my-plugin", should then be referenced in the pyproject.toml as:

[project.entry-points."kedro.hooks"]
plugin_name = "plugin_name.plugin:hooks"

So for "my-plugin" this should be:

[project.entry-points."kedro.hooks"]
my_plugin = "my_plugin.plugin:hooks"

So the change here to

[project.entry-points."kedro.hooks"]
test-plugin = "plugin:hooks"

seems conflicting to me.

Interesting, it works both ways, I've changed it back to align with the docs but it's intriguing that there's no consistency requirement. Maybe @astrojuanlu can provide more insight on how toml processes this?

Copy link
Member

@merelcht merelcht left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this @AhdraMeraliQB ! ⭐

I agree it would be good to clarify if there's a best practice when it comes to the naming convention for the entry point in pyproject.toml and make sure we adopt it consistently in our docs and code.

@AhdraMeraliQB AhdraMeraliQB enabled auto-merge (squash) January 2, 2024 17:42
@AhdraMeraliQB AhdraMeraliQB merged commit 6eb3907 into main Jan 2, 2024
30 checks passed
@AhdraMeraliQB AhdraMeraliQB deleted the fix/failing-e2e-test branch January 2, 2024 17:55
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.

ci: Nightly build failure on main
3 participants