-
Notifications
You must be signed in to change notification settings - Fork 395
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
Compare DokkaSourceSetImpl by DokkaSourceSetID only #3568
Conversation
* Add checker that all sourceSet ids are unique during generation * `verificationStage` should always run in tests * `verificationStage` should run as a first step as in `SingleModuleGeneration::generate` in tests
Note to other reviewers: this is about unit tests only. I got scared for a second when reading this sentence 😅 I think it's correct to enable it, yeah
Why are you worried about this, what problems could it lead to? To me that's expected: source sets are only visible when you open a specific module, and each module is processed separately. The plugins are also written as if for a single module, so hashCode / equals should as expected
We don't use
If the spec (i.e documentation) states that the implementations should compare it by DokkaSourceSetID, I think the behavior should be aligned. I doubt that comparing by identity here would lead to bugs, but I'd change it just for consistency and to cause less questions later on
Good thought to check it! I wouldn't say they will "stop working" - they will be working correctly from the specification's (documentation's) point of view, but I see your concern - they might deserialize some fields of a source set incorrectly and it will pass the equals check I would actually expect specialized serialization/deserialization tests to be checking every field one by one, not just compare the two topmost objects by As to how to fix the tests - that's a good question. Do you have any thoughts here? I only have two ideas atm:
|
Oops, my bad, fixed the PR description.
I believe there should be no problems here for now. May be I'm a bit too worried about such change, and so not feeling safe without all possible checks.
I would disagree, as we do have
Just in case, for reference, the issue is here: #2620
yeah, exactly my thoughts, just wanted to recheck
As I will have last provocative question - what about overall making Big thanks for such detailed review! I will be able to finish the PR based on this discussion. |
…on` for tests To be able to use `dokka-test-api` in Gradle plugin module, it's needed for Gradle project name to be the same as the published artifact name, because of composite builds
149bdee
to
77c2a6b
Compare
PR is ready for review:
|
Nice idea about adding
If we were designing it from scratch, I don't think I would mind, because it's indeed only created during the configuration, so it shouldn't change, and I can't think of a reason for why someone might create their own implementation during the other steps (documentable, content, renderer, etc) Right now though, given that we already have I've also just now remembered that we have dokka/dokka-subprojects/core/src/main/kotlin/org/jetbrains/dokka/configuration.kt Line 178 in d4d457d
and Lines 43 to 44 in d4d457d
I think this part could also be refactored to use identity, but that comes with a whole new can of worms. But without this refactoring, I think it would be confusing and possibly error prone to use both |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to know if this change breaks, e.g. the Google plugin.
it's also expected that we wouldn't see a noticeable difference.
Me too. And I am not even sure about the Google plugin. In my opinion, the description of the issue is too promising)
I would use a flame graph to compare the performance.
But, anyway, it is nice to fix the comparison.
|
probably fixes #3246
Note: PR is not ready to be merged, documentation is not added.
There are several questions which should be resolved first:
pre-generation
check I found out, that those checks are not run by default in TESTS - in this PR, I've enabled them to run by default (one test started to fail:JavadocDocumentableJVMSourceSetFilterTest
because ofjs
sourceSet present, which is not supported by javadoc plugin) - does anyone have anything against enabling them, as I do expect them to run?pre-generation
check for sourceSet IDs uniqueness during multi-module generation, as we don't have information about sourceSets there, only the result of Dokka execution - Do you think it's fine? I'm a little worried about this.DokkaConfiguration
orDModule
inassertEquals
. So if we will changeequals
ofDokkaSourceSet
to use ID only, such tests will just silently stop working - we could fix those, but what about future tests and overall complexity of understanding this behaviour? WDYT?