Our recommended best practice for folder structure is to organize by domain, but this can be difficult to coordinate among many teams that don't have a high level view of the entire code base.
I'd like to propose a periodic "folder structure review" by either the platform team or a group of delegates from a few teams to take a look at the top level folders/plugins every now and then, and see if we can make any recommendations or request changes. This will help us avoid getting into the same situation we got into with the legacy ui/public
folder.
Some recent situations I ran into:
kibana_react
. Do we need an xpack version?thoughts?
cc @joshdover @epixa @peterschretlen
@joshdover suggested we make this more of a general "repo health" check that additionally includes things like:
any
type, no export *
at the top level).Perhaps this forum could be done async as well with the outcome being a report of any violations found, tagging the team in question and creating tracking/issues.
I created the kibana-convention-council
slack channel for these kinds of discussions.
Other "health" things that come to mind which would be helpful to check:
export *
)kibana_utils
or es_ui_shared
), when they could logically belong to a specific plugin domainstart
)These are things that are easy for someone to overlook as it isn't possible to lint for all of them.
Periodic checks of the repo sound good, but Iād like to clarify what are the issues we're trying to solve with these checks/reviews. Reading through the GH issue Iām seeing the following:
Is that a good characterization? I'd just want us to be clear on the main issues and objectives.
I think also itās worth asking if there are ways we might address these in our existing processes, before we consider new ones.
Say for example contributors arenāt aware of certain pitfalls, and thatās the main issue. What if there was a short checklist to run through during code review to help detect common pitfalls? That might be a decent alternative to a centralized review.
Yep, great points! I think it's more about the two first bullet points than the last one. A measurement like code coverage would be great, but other than that, I'm not sure how else we could automatically measure health.
Say for example contributors arenāt aware of certain pitfalls, and thatās the main issue. What if there was a short checklist to run through during code review to help detect common pitfalls? That might be a decent alternative to a centralized review.
We have a variety of ways developers can learn about these best practices today:
Some of those should be combined, but some are targeted towards a specific situation.
Agree we should focus on trying to solve the root of the problem, but I think there is an advantage to having dedicated time/process for reviewing the current state of the repo to ensure the conventions are being understood and adhered to. This can expose situations where our documentation falls short and we need to update. A dedicated channel can be a place for people to ask clarifying questions/highlight inconsistencies. We could decide this is part of a single area teams responsibility (or tech leads), but to me, it feels like a mixture of all of those (maybe even ops team too).
One thing that could be useful here is a definition of what types of things do we consider important enough to the entire project to be auditing.
In other words, which things are really worth enforcing / facilitating across the whole project and which aren't?
In my opinion, we should focus on holding the quality line in the areas that can leak out of their domains and create problems for other teams. For example:
Things that I don't think are as important to be consistent:
Great write up @joshdover - I think that sounds great. I just ran across one more that is good to keep an eye on - things that blow up the size of the repo like giant mock files or data archives, especially for testing purposes.
We discussed this during the Platform Team's weekly today. Some thoughts that came up:
Some thoughts on next steps forward:
Aside from overall repo health, I think there may be a real need for individual _plugin health_. I suspect there may be more value in this than overall repo health, especially if we can focus on customer-facing impact, like bug reports.
One thing I've seen done in other organizations is a "Top 10 bugs list" that is well publicized within the organization (even outside engineering) and backed up by real metrics. This kind of visibility has a large potential to actually cause change. We could do something similar with just bugs or even with some of the other general health items (I could easily imagine a "Top 10 untested modules features" list).
For the manual work, we can start with one topic (I prefer directory structure), do an audit with a group of 2-3 people, and report back results. We can see how this goes and evaluate success based on effort to audit, how easily we can get teams to make changes, and whether or not there is a real ROI on this.
++, and I agree on directory structure as the initial topic.
I volunteer myself. Can we get one volunteer from platform team and one from app arch team?
I'll create an issue in kibana-team repo as a place to summarize notes/findings, and can set up a recurring meeting. How does 30min every other week sound? We can try to do most of the work async, and have the meeting as forcing function to identify areas we'll focus on over the next couple weeks, and for topics that are difficult to solve async.
++ to Josh's breakdown of important vs less-important items, as well as the next steps.
Would we consider the question of domain boundaries (e.g. what to do about things like es_ui_shared
) to be part of this discussion, or a different category? If we aren't grouping it with directory structure, this topic would probably be my preference for the next area to address which cannot be automated.
Can we get one volunteer from platform team and one from app arch team?
I'd be happy to help on the app arch side.
Would we consider the question of domain boundaries (e.g. what to do about things like es_ui_shared) to be part of this discussion, or a different category?
I would consider it part of the same discussion. Directory structure / domain organization.
Can we get one volunteer from platform team and one from app arch team?
I can rep the Platform team for the first go around as well.
How does 30min every other week sound?
Every other week to start works, maybe less frequently after we get going?
@tylersmalley
Closing this as we have been having our periodic repo review check ins and storing the summaries and notes elsewhere.
Most helpful comment
We discussed this during the Platform Team's weekly today. Some thoughts that came up:
Some thoughts on next steps forward:
Aside from overall repo health, I think there may be a real need for individual _plugin health_. I suspect there may be more value in this than overall repo health, especially if we can focus on customer-facing impact, like bug reports.
One thing I've seen done in other organizations is a "Top 10 bugs list" that is well publicized within the organization (even outside engineering) and backed up by real metrics. This kind of visibility has a large potential to actually cause change. We could do something similar with just bugs or even with some of the other general health items (I could easily imagine a "Top 10 untested
modulesfeatures" list).