-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Development Experience #34557
Comments
Pinging @elastic/kibana-operations |
Under the "community deviation" section, you could put linting rules in with this. Adopting as many of the defaults of the Airbnb and Prettier linting settings could eliminate a lot of deviation and customization of rules. |
@skaapgif @restrry If you notice any other potential improvements to the developer experience, pls comment here |
I will more points later, right now the main problem for me is to understand how to run any kind of tests (unit, *_integration, functional, etc.) and in what environment it is executed (jest, mocha, karma, etc.) |
My biggest pain point is exactly the same as @restrry On a bad day my workflow looks like this:
To improve this, I'd like to be able to:
|
The build system is hard to understand:
|
@crob611 @peterschretlen @lizozom @emmacunningham @flash1293 @wylieconlon @aaronjcaldwell |
Talking to some of the downstream teams (ML, APM, CodeSearch etc.) two things were mentioned several times: 1) The cycle time on a PR, and 2) difficulty figuring out how to run tests. I think particularly for solutions, the monorepo format feels like a burden because many of their changes feel specific/isolated, and they'd like to "just run the APM" tests for example. |
I've attempted to address this through my github checks pr - #34673 Each check corresponds to a CI task and the check states the command and its arguments. (Yes, it would be better to have more consistency but perhaps this helps.)
@skaapgif - The command you might run locally is different from the command run in CI. That said, I do think communicating such a thing is fairly simple. Might be worthy of more conversation. |
@mattkime #34673 Definitely solves my biggest developer pain at the moment 🎉 If the CI gave me 1 command I could copy and paste that would only target the failed tests instead of showing me the failed test suite command, that would reduce the cycle time even further, but I would consider that a luxury, not a necessity.
This comment was specifically related to making changes to the build system as opposed to understanding the results of the CI system. I had to read through the source code of several build scripts to understand how (and which files) we copy to the build directory, how we modify the typescript config files, what flags the typescript compiler is run with etc. Not impossible, but much harder to wrap my head around than a high-level abstraction like: gulp.task('ts', function () {
return gulp
.src('scripts/**/*.ts')
.pipe(typescript(tscConfig.compilerOptions))
.pipe(gulp.dest('wwwroot'));
}); (of course our build system wouldn't be that simple even if it was all gulp tasks, but I think the high-level stream + plugin abstractions would make it easier to follow) |
If we are talking about solutions, I've got quite a bit of experience wrangling separate tooling into organized chunks via Neutrino. It may be a helpful tool to employ to solve some of these issues, but granted not all. |
I think some other important parts of the development process are code reviews and source-diving. There have been numerous case studies and guidelines that recommend generous whitespace to improve readability and retention, both in design as well as reading. I think opting for more generous and automated whitespace changes could make for a more positive and efficient process. I also understand that some of these rules could be quite subjective. I used to codify changes like these in ESLint (example here enforces newlines between conditionals, declarations, and modules): 'padding-line-between-statements': [
'error',
{
blankLine: 'always',
prev: ['const', 'let', 'var'],
next: '*',
},
{
blankLine: 'never',
prev: ['const', 'let', 'var'],
next: ['const', 'let', 'var'],
},
{
blankLine: 'always',
prev: ['cjs-import'],
next: '*',
},
{
blankLine: 'always',
prev: ['import'],
next: '*',
},
{
blankLine: 'always',
prev: '*',
next: ['cjs-export'],
},
{
blankLine: 'always',
prev: '*',
next: ['export'],
},
{
blankLine: 'never',
prev: ['import'],
next: ['import'],
},
{
blankLine: 'never',
prev: ['cjs-import'],
next: ['cjs-import'],
},
{
blankLine: 'any',
prev: ['export'],
next: ['export'],
},
{
blankLine: 'any',
prev: ['cjs-export'],
next: ['cjs-export'],
},
{ blankLine: 'always', prev: 'multiline-block-like', next: '*' },
{
blankLine: 'always',
prev: '*',
next: ['if', 'do', 'for', 'switch', 'try', 'while'],
},
{ blankLine: 'always', prev: '*', next: 'return' },
], I like to think of whitespace as a controller for context switching into a decision tree. Whenever code needs to branch or change context, whitespace can be a good indicator for your brain to also switch context while reading. import a from 'a';
import b from 'b';
import c from 'c';
const alpha = 'alpha';
const beta = 'beta';
const gamma = 'gamma';
if (alpha === beta) {
return doSomething();
} else if (beta === gamma) {
const value = await somethingElse();
return `delta %{value}`;
} else {
throw new Error();
}
return 'anything'; // module context
import a from 'a';
import b from 'b';
import c from 'c';
// declaration context
const alpha = 'alpha';
const beta = 'beta';
const gamma = 'gamma';
// conditional context
if (alpha === beta) {
return doSomething();
} else if (beta === gamma) {
const value = await somethingElse();
// return context
return `delta %{value}`;
} else {
// error context
throw new Error();
}
// return context
return 'anything'; There are many places in Kibana where this seems to be followed via conventions, but it is certainly not consistent. Thoughts on standardizing on some sort of whitespace automation to improve readability and retention? |
@eliperelman I absolutely agree and the way you described whitespace as a tool for isolating contexts is how I think of it too. The analogy I like to use is that grouping logic together using whitespace is like breaking up long-form text into paragraphs. The same way each paragraph communicates an intention or idea, so does a group of logic communicate an intention within a context. When I'm writing code, this helps me structure the contexts in a way that makes sense. And as a reader, it helps me scan the code's contexts and focus into the ones in which I'm interested. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
another feedback is very hard to write mocha test (under I have a PR here: to address some of our problem, but it might not be an universal solution |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
To add to my previous comment, use but it would be nice if we could have some universal test entry point like |
one more suggestion, I'd really like the backport process could be automatic, I filed another issue #41321 to describe the detail there |
additional pain points:
|
@mattkime can address the points about the Github reporter. But as of right now, re-running a specific test won't take less time. We're working on possibly utilizing pipelines to address this.
I have an issue I opened when creating kbn-es #17419, but so far there hasn't been much support for it. I added a comment mentioning it being raised here.
The snapshots expire, meaning they are no longer available since we utilize TTL's on the S3 bucket. That comment is really only relevant when attempting to run kbn-es from an old branch, say
I agree - Prior to 6.3, X-Pack was a separate repository and we still need to work making a more cohesive, unified experience now that is no longer the case. However, we still have to make sure that people can run/develop only OSS if necessary. |
More requests for functional testing:
|
@tylersmalley, @brianseeders, @spalger and I have been discussing how the functional tests can be improved to address:
and
Spencer will be working on a proof-of-concept for a solution that he has in mind. |
Not sure if it is the right place to ask, but the thing I am missing (or maybe I just don't know it exists) is a publicly exposed kibana endpoint built from a pull-request branch. If we could provide a URL to kibana which we built for running ci tests on a branch, that would:
|
The point @Dosant mentioned also came up a couple of times during our team syncs. There is a high demand for having preview builds on the PR automatically for the listed reasons. Do you think this is anything that'll be feasible in the mid-term to achieve that? |
|
@tylersmalley Anything we can do to address Mikhail's above feedback? |
All packages within the |
Regarding
yeah, I think it makes sense to focus on improving caching strategy, but we might squeeze a couple of minutes tuning build pipeline (at least for development) Is there an issue in the Kibana repo to tune optimizer perf? @elastic/kibana-operations |
While debugging x-pack tests I noticed React component testing is extremely slow. |
Thanks for mentioning this, @restrry. Would it help if we excluded our client integration tests from the |
@cjcenizal there is a dedicated jest runner for integration tests |
Closing in favor of #70733 |
I am opening this issue to discuss potential improvements to the development experience of Kibana. The topics I am bringing up here are mostly specific to the development toolchain as I have a bit of experience with the current field of JS project tools.
Potential issues
Configuration is spread across many files in various locations.
From Babel to webpack, TypeScript, Jest, files in
scripts
, grunt files, dotfiles, etc., the configuration of tools is spread across many files in various locations across the repo. It takes a fair amount of source diving to connect all the pieces to get a clear understanding of how a build works.Some custom configuration deviates from community norms, slightly increasing the barrier of familiarity for external contributors.
With our very custom build setup and monorepo management structure, we deviate from patterns and setups that the community is used to, which raises the barrier to entry for external contributors. Possibly re-evaluate tools like lerna make yarn workspaces more consistent or organized.
Logging is verbose and can be obscure.
Processes can be slow.
Things like build, test, and lint times could always be improved. 😃
Tooling is hard-coded to repository.
There are many pieces of our toolchain that could be used outside the toolchain to make development consistent and easier. If non-application-specific configuration was extracted, we could re-use the tooling across more repositories and expose it as tooling for other projects and plugin authors to consume. By co-mingling the application's concerns with that of the tools, we make it so these must be versioned and shipped together when this isn't necessarily a requirement.
The invitation is open for anyone to add their ideas around improvements or more challenges to development experience. Adding @tylersmalley and @tsouza for their insight and direction on this.
The text was updated successfully, but these errors were encountered: