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

[APM] Prevent imports of public in server code #67210

Closed
tylersmalley opened this issue May 21, 2020 · 5 comments · Fixed by #75979
Closed

[APM] Prevent imports of public in server code #67210

tylersmalley opened this issue May 21, 2020 · 5 comments · Fixed by #75979
Assignees
Labels
Team:APM All issues that need APM UI Team support technical debt Improvement of the software architecture and operational architecture

Comments

@tylersmalley
Copy link
Contributor

tylersmalley commented May 21, 2020

An exception was made to the ESLint rule preventing imports of public into server. With other plugins, the fixes were pretty straightforward but with APM a lot of organization decisions needed to be made.

For this to be considered completed, the exception needs to be remove from .eslintrc.js

Related to #67149

x-pack/plugins/apm/server/lib/environments/get_all_environments.test.ts
  11:8  error  Unexpected path "../../../public/utils/testHelpers" imported in restricted zone. Server code can not import from public, use a common directory  @kbn/eslint/no-restricted-paths

x-pack/plugins/apm/server/lib/errors/distribution/queries.test.ts
  11:8  error  Unexpected path "../../../../public/utils/testHelpers" imported in restricted zone. Server code can not import from public, use a common directory  @kbn/eslint/no-restricted-paths

x-pack/plugins/apm/server/lib/errors/queries.test.ts
  12:8  error  Unexpected path "../../../public/utils/testHelpers" imported in restricted zone. Server code can not import from public, use a common directory  @kbn/eslint/no-restricted-paths

x-pack/plugins/apm/server/lib/metrics/queries.test.ts
  15:8  error  Unexpected path "../../../public/utils/testHelpers" imported in restricted zone. Server code can not import from public, use a common directory  @kbn/eslint/no-restricted-paths

x-pack/plugins/apm/server/lib/observability_overview/get_transaction_coordinates.ts
  12:29  error  Unexpected path "../../../../observability/public" imported in restricted zone. Server code can not import from public, use a common directory  @kbn/eslint/no-restricted-paths

x-pack/plugins/apm/server/lib/rum_client/queries.test.ts
  10:8  error  Unexpected path "../../../public/utils/testHelpers" imported in restricted zone. Server code can not import from public, use a common directory  @kbn/eslint/no-restricted-paths

x-pack/plugins/apm/server/lib/service_nodes/queries.test.ts
  16:8  error  Unexpected path "../../../public/utils/testHelpers" imported in restricted zone. Server code can not import from public, use a common directory  @kbn/eslint/no-restricted-paths

x-pack/plugins/apm/server/lib/services/annotations/index.test.ts
  10:8  error  Unexpected path "../../../../public/utils/testHelpers" imported in restricted zone. Server code can not import from public, use a common directory  @kbn/eslint/no-restricted-paths

x-pack/plugins/apm/server/lib/services/queries.test.ts
  15:8  error  Unexpected path "../../../public/utils/testHelpers" imported in restricted zone. Server code can not import from public, use a common directory  @kbn/eslint/no-restricted-paths

x-pack/plugins/apm/server/lib/settings/agent_configuration/queries.test.ts
  14:8  error  Unexpected path "../../../../public/utils/testHelpers" imported in restricted zone. Server code can not import from public, use a common directory  @kbn/eslint/no-restricted-paths

x-pack/plugins/apm/server/lib/settings/custom_link/create_or_update_custom_link.test.ts
  8:25  error  Unexpected path "../../../../public/utils/testHelpers" imported in restricted zone. Server code can not import from public, use a common directory  @kbn/eslint/no-restricted-paths

x-pack/plugins/apm/server/lib/settings/custom_link/get_transaction.test.ts
  9:8  error  Unexpected path "../../../../public/utils/testHelpers" imported in restricted zone. Server code can not import from public, use a common directory  @kbn/eslint/no-restricted-paths

x-pack/plugins/apm/server/lib/settings/custom_link/list_custom_links.test.ts
  11:8  error  Unexpected path "../../../../public/utils/testHelpers" imported in restricted zone. Server code can not import from public, use a common directory  @kbn/eslint/no-restricted-paths

x-pack/plugins/apm/server/lib/traces/queries.test.ts
  11:8  error  Unexpected path "../../../public/utils/testHelpers" imported in restricted zone. Server code can not import from public, use a common directory  @kbn/eslint/no-restricted-paths

x-pack/plugins/apm/server/lib/transaction_groups/queries.test.ts
  11:8  error  Unexpected path "../../../public/utils/testHelpers" imported in restricted zone. Server code can not import from public, use a common directory  @kbn/eslint/no-restricted-paths

x-pack/plugins/apm/server/lib/transactions/queries.test.ts
  14:8  error  Unexpected path "../../../public/utils/testHelpers" imported in restricted zone. Server code can not import from public, use a common directory  @kbn/eslint/no-restricted-paths

x-pack/plugins/apm/server/lib/ui_filters/local_ui_filters/queries.test.ts
  11:8  error  Unexpected path "../../../../public/utils/testHelpers" imported in restricted zone. Server code can not import from public, use a common directory  @kbn/eslint/no-restricted-paths

x-pack/plugins/apm/server/lib/ui_filters/queries.test.ts
  11:8  error  Unexpected path "../../../public/utils/testHelpers" imported in restricted zone. Server code can not import from public, use a common directory  @kbn/eslint/no-restricted-paths

✖ 18 problems (18 errors, 0 warnings)
@tylersmalley tylersmalley changed the title [APM] Prevent imports of public into server code [APM] Prevent imports of public in server code May 21, 2020
@myasonik myasonik added the Team:APM All issues that need APM UI Team support label May 26, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/apm-ui (Team:apm)

@sorenlouv
Copy link
Member

sorenlouv commented May 26, 2020

@tylersmalley Thanks for creating this. Can you help with a few examples in APM where this is a problem. Or a way to detect these (I assume eslint should show this?)
Will make it easier for us to fix.

@tylersmalley
Copy link
Contributor Author

@sqren, I have updated the description.

@sorenlouv sorenlouv added the technical debt Improvement of the software architecture and operational architecture label Jun 15, 2020
@tylersmalley
Copy link
Contributor Author

I have updated the description with the current list - we're currently down to tests and types.

@sorenlouv
Copy link
Member

Thanks for the help @tylersmalley . I'll ask someone from the team to pick this up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:APM All issues that need APM UI Team support technical debt Improvement of the software architecture and operational architecture
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants