Skip to content

Conversation

@spalger
Copy link
Contributor

@spalger spalger commented Apr 29, 2020

While working on #64843 I noticed a number of imports for the src/core/utils module, which the platform team didn't expect to be used externally, so I've re-exported portions of that module from src/core/server and src/core/public, updated all uses, and added an eslint config to validate we don't add more src/core/utils imports down the road.

@spalger spalger force-pushed the fix/remove-imports-for-core-utils branch 3 times, most recently from c4b2c90 to 4c86c5e Compare April 29, 2020 23:59
Copy link
Contributor

Choose a reason for hiding this comment

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

@joshdover I'm surprised we have this in utils. Shouldn't we move it to the application or another service instead? utils are meant to provide functionality extending the language standard library.

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this is utils due to problems with importing from server into public. We can't use the server/types workaround since this is a value. Long-term we could fix this by either leveraging a common directory or the organize by domain proposal for core #52182

Copy link
Contributor

@mshustov mshustov Apr 30, 2020

Choose a reason for hiding this comment

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

Ok, I think we can get rid of the server-side use-cases when all plugin migrate to KP most plugins migrate to KP and we can inline values in the remaining cases.

Copy link
Contributor

Choose a reason for hiding this comment

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

DEFAULT_APP_CATEGORIES 'util' was introduced during the grouped nav PR, because these values needed to be accessed by the legacy apps registrations that are performed on the server-side. I agree with @restrry that once we only have a small amount of legacy app registrations, moving this back to client-side and using inline values for the legacy apps would be an acceptable solution.

@spalger spalger force-pushed the fix/remove-imports-for-core-utils branch 2 times, most recently from 2e768c5 to 1331b8d Compare April 30, 2020 22:42
@spalger spalger force-pushed the fix/remove-imports-for-core-utils branch from 1331b8d to ccdb8e7 Compare May 1, 2020 07:01
@spalger
Copy link
Contributor Author

spalger commented May 1, 2020

@elasticmachine merge upstream

@spalger spalger marked this pull request as ready for review May 5, 2020 16:53
@spalger spalger requested a review from a team as a code owner May 5, 2020 16:53
@spalger spalger requested a review from a team May 5, 2020 16:53
@spalger spalger requested a review from a team as a code owner May 5, 2020 16:53
@spalger spalger requested a review from a team May 5, 2020 16:53
@spalger spalger requested review from a team as code owners May 5, 2020 16:53
@spalger spalger requested a review from a team May 5, 2020 16:53
@spalger spalger added release_note:skip Skip the PR/issue when compiling release notes Team:Operations Kibana-Operations Team v7.8.0 v8.0.0 labels May 5, 2020
@elasticmachine
Copy link
Contributor

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

@spalger
Copy link
Contributor Author

spalger commented May 5, 2020

@elasticmachine merge upstream

Copy link
Contributor

@nreese nreese left a comment

Choose a reason for hiding this comment

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

maps LGTM
code review

Copy link
Contributor

@jportner jportner left a comment

Choose a reason for hiding this comment

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

Security changes LGTM

Copy link
Contributor

@chrisronline chrisronline left a comment

Choose a reason for hiding this comment

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

LGTM for stack monitoring

Copy link
Contributor

@crob611 crob611 left a comment

Choose a reason for hiding this comment

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

Canvas looks fine 👍

Copy link
Contributor

@mikecote mikecote left a comment

Choose a reason for hiding this comment

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

Alerting changes LGTM

Copy link
Contributor

@mattkime mattkime left a comment

Choose a reason for hiding this comment

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

app arch changes lgtm

Copy link
Member

@dgieselaar dgieselaar left a comment

Choose a reason for hiding this comment

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

APM changes LGTM

Copy link
Member

@nchaulet nchaulet left a comment

Choose a reason for hiding this comment

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

Ingest management changes LGTM

Copy link
Member

@jasonrhodes jasonrhodes left a comment

Choose a reason for hiding this comment

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

Infra and Ingest Manager changes LGTM, just simple path changes 👍

Copy link
Contributor

@wylieconlon wylieconlon left a comment

Choose a reason for hiding this comment

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

Scanned all the code changes, LGTM. Left a question to confirm my understanding.

// https://www.typescriptlang.org/docs/handbook/advanced-types.html#exhaustiveness-checking
export function assertNever(x: never): never {
throw new Error(`Unexpected object: ${x}`);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not import this assertNever just like all the otherrs? Is it because it's in common?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, there isn't currently a common import for src/core and it was just so simple.

Copy link
Contributor

@joshdover joshdover left a comment

Choose a reason for hiding this comment

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

Platform changes LGTM

@spalger
Copy link
Contributor Author

spalger commented May 5, 2020

@elasticmachine merge upstream

@botelastic botelastic bot added the Team:APM - DEPRECATED Use Team:obs-ux-infra_services. label May 5, 2020
@elasticmachine
Copy link
Contributor

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

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

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

@spalger spalger merged commit ee270c7 into elastic:master May 5, 2020
spalger pushed a commit to spalger/kibana that referenced this pull request May 5, 2020
@spalger spalger deleted the fix/remove-imports-for-core-utils branch August 18, 2020 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release_note:skip Skip the PR/issue when compiling release notes Team:APM - DEPRECATED Use Team:obs-ux-infra_services. Team:Operations Kibana-Operations Team v7.8.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.