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

[eslint/imports/no-boundary-crossing] don't allow package tests to import outside of packages #142166

Merged
merged 3 commits into from
Sep 29, 2022

Conversation

spalger
Copy link
Contributor

@spalger spalger commented Sep 28, 2022

In #140985 new tests were written in a package that depend on plugin code. This shouldn't have been allowed by our no_boundary_crossing eslint rule, but it was because the rule previously allowed test code to import anything.

This PR splits the tests or mocks source class into package tests or mocks and non-package tests or mocks. non-package tests or mocks can still import any file. package tests or mocks can only import other packages or package tests or mocks code.

@WafaaNasr for now I've copied the mocks used into the package. If you'd like to move those mocks to a separate package so they could be used by both the plugin and other packages I'md ask that you do that as a follow up PR.

@spalger spalger force-pushed the implement/prevent-non-package-deps branch 2 times, most recently from 0f129db to 17582f4 Compare September 28, 2022 23:28
@spalger spalger force-pushed the implement/prevent-non-package-deps branch from 17582f4 to 85566ad Compare September 29, 2022 00:27
@spalger spalger added release_note:skip Skip the PR/issue when compiling release notes Team:Operations Team label for Operations Team labels Sep 29, 2022
@spalger spalger marked this pull request as ready for review September 29, 2022 02:52
@spalger spalger requested review from a team as code owners September 29, 2022 02:52
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-operations (Team:Operations)

@spalger spalger requested a review from WafaaNasr September 29, 2022 02:53
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Contributor

@WafaaNasr WafaaNasr 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 so much Spencer ^_^

@spalger spalger merged commit b41a07f into elastic:main Sep 29, 2022
@spalger spalger deleted the implement/prevent-non-package-deps branch September 29, 2022 16:48
@kibanamachine kibanamachine added v8.6.0 backport:skip This commit does not require backporting labels Sep 29, 2022
WafaaNasr pushed a commit to WafaaNasr/kibana that referenced this pull request Oct 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Operations Team label for Operations Team v8.6.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants