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

Replace groovy build-tools (buildSrc) with java #34459

Open
19 of 31 tasks
alpar-t opened this issue Oct 15, 2018 · 37 comments
Open
19 of 31 tasks

Replace groovy build-tools (buildSrc) with java #34459

alpar-t opened this issue Oct 15, 2018 · 37 comments
Assignees
Labels
:Delivery/Build Build or test infrastructure good first issue low hanging fruit >refactoring Team:Delivery Meta label for Delivery team

Comments

@alpar-t
Copy link
Contributor

alpar-t commented Oct 15, 2018

We want to have build code implemented in Java to make it easier to maintain.
We can easily mix java and groovy implementations and everything is already set up to do so, so it's already easy to create new classes in Java.
It would also be great to take this opportunity to add tests for the newly written Java code.

The ingredients of a great rewrite:

  • the groovy code is removed, the java implementation is actually used by the build
  • the java implementation does not use the Groovy SDK ( no groovy imports in Java).
    • note that the "convert to java" option in IDEA does add calls to it
  • Existing Groovy tests are also ported to Java
    • when there are no existing tests, new unit and/or integration tests are created. There is a precedent for both. Integration tests use Gradle Test Kit. We should have tests for basic functionality, making sure that the test is up-to-date when the inputs/outputs don't change and in some cases for error conditions.
  • follow conventions showcased in Gradle example plugin and detailed in the Gradle user guide: writing custom tasks and writing plugins. Make sure to follow the instructions on making tasks incremental.
  • Don't use, and replace the use of project.afterEvaluate in custom task implementations as well as any other configuration logic from the task constructor. The custom task constructor should not reference project. Gradle calls methods annotated with @TaskAction as well as @Input, @Output and the like at execution time rather than configuration time as defined by the
    Gradle build lifecycle.

Here's a list of what is still in Groovy. Note that it goes from simple to complex and there are some inner dependencies :

@alpar-t alpar-t added good first issue low hanging fruit :Delivery/Build Build or test infrastructure v7.0.0 >refactoring v6.5.0 labels Oct 15, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

@pt429sy
Copy link

pt429sy commented Oct 16, 2018

Hello, I would like to work on this.

baptistemesta added a commit to baptistemesta/elasticsearch that referenced this issue Oct 16, 2018
@alpar-t
Copy link
Contributor Author

alpar-t commented Oct 17, 2018

Hi @pt429sy that's great ! Feel free to pick a class and open a PR.

@baptistemesta
Copy link

just for info, I am working on NoticeTask

baptistemesta added a commit to baptistemesta/elasticsearch that referenced this issue Oct 23, 2018
baptistemesta added a commit to baptistemesta/elasticsearch that referenced this issue Oct 23, 2018
@colings86 colings86 added v6.6.0 and removed v6.5.0 labels Oct 25, 2018
@Megamiun
Copy link
Contributor

Megamiun commented Oct 28, 2018

Doing UpdateShasTask, probably will make a PR tonight.

EDIT: Or tomorrow.

@fabiodrg
Copy link

I am interested in giving a try to PluginPropertiesExtension. From my understanding it should be quite straightforward.

@cdschneider
Copy link
Contributor

Going to give ForbiddenPatternsTask a shot, FYI

@GuptaNishant
Copy link

GuptaNishant commented Dec 8, 2018

I am working on DependenciesInfoTask, will raise a PR later

@jasontedor jasontedor added v6.7.0 and removed v6.6.0 labels Dec 19, 2018
@akki
Copy link
Contributor

akki commented Dec 25, 2018

I tried porting vagrant.VagrantPropertiesExtension file to Java but it seems all modules inside vagrant package have to be ported in one go to make it work; Please let me know if this work on VagrantPropertiesExtension can anyhow be used/merged separately, otherwise anybody who aims to port all the other files can feel free to use this patch.

@atorok From what I understand, #34769 can be added against NoticeTask in the first comment.

@paras885
Copy link

paras885 commented Jan 3, 2019

Going to give MavenFilteringHack a shot, FYI

@alpar-t
Copy link
Contributor Author

alpar-t commented Jan 7, 2019

@akki Java code can't reference Groovy classes, but groovy can reference Java, so one has to start with leafs in the dependency tree when porting classes.

rjernst added a commit to rjernst/elasticsearch that referenced this issue Jul 23, 2019
This commit converts the logging related classes (only used for vagrant)
to java from groovy.

relates elastic#34459
rjernst added a commit that referenced this issue Jul 24, 2019
This commit converts the logging related classes (only used for vagrant)
to java from groovy.

relates #34459
rjernst added a commit that referenced this issue Jul 24, 2019
This commit converts the logging related classes (only used for vagrant)
to java from groovy.

relates #34459
polyfractal pushed a commit to polyfractal/elasticsearch that referenced this issue Jul 29, 2019
This commit converts the logging related classes (only used for vagrant)
to java from groovy.

relates elastic#34459
@jbonn360
Copy link
Contributor

jbonn360 commented Aug 7, 2019

Hi @atorok, I'd like to work on MavenFilteringHack if no one's working on it

@rjernst rjernst added the Team:Core/Infra Meta label for core/infra team label May 4, 2020
@rh-id
Copy link

rh-id commented May 20, 2020

hello @alpar-t would like to work on AntTask if no one's working on it

@alpar-t
Copy link
Contributor Author

alpar-t commented May 21, 2020

@mark-vieira where do we stand on the AntTask ?

@mark-vieira
Copy link
Contributor

mark-vieira commented May 21, 2020

My preference would be to remove it, and refactor the two remaining subclasses to not rely on Ant. So I'm not sure it's a good candidate for migration right now.

@mrmodise
Copy link

mrmodise commented Nov 6, 2020

@mark-vieira @alpar-t I just pulled the latest code and I see PrecommitTasks is still pending migration. I would like to take it on if its not hanging in the PR state. Thanks

@mark-vieira mark-vieira added Team:Delivery Meta label for Delivery team and removed Team:Core/Infra Meta label for core/infra team labels Nov 11, 2020
@sachinpaliwal1981
Copy link

sachinpaliwal1981 commented Jan 10, 2021

is there any class pending from the list where work is not in progress already, I would like to contribute.

@mark-vieira
Copy link
Contributor

@sachinpaliwal1981 Both MavenFIlteringHack and NoticeTask are good candiates that have no dependencies on other Groovy code and are mostly a strait conversion to Java.

@MarkRibeiro
Copy link

I would like to work on this, where can i start?

@edh-oss
Copy link
Contributor

edh-oss commented Oct 6, 2021

I'd like to work on the code related to docs, SnippetTask and the related classes.

I have a couple questions:

I've seen both junit and spock used for tests. Is there one test framework that you want to make the standard, or does it not matter?

Is there any documentation that spells out things like "This is what constitutes a valid code snippet", or is the existing implementation effectively the documentation as well?

@mark-vieira
Copy link
Contributor

I've seen both junit and spock used for tests. Is there one test framework that you want to make the standard, or does it not matter?

Yes, we want to prefer Spock going forward.

Is there any documentation that spells out things like "This is what constitutes a valid code snippet", or is the existing implementation effectively the documentation as well?

Yeah, I think we'll have to go off of the existing implementation.

@edh-oss
Copy link
Contributor

edh-oss commented Oct 14, 2021

I'm having trouble getting Spock tests under build-tools-internal recognized by Gradle. I added details and examples in a comment to issue #78864 , thinking it may be related.

fblacutt added a commit to fblacutt/elasticsearch that referenced this issue Nov 22, 2021
@pugnascotia
Copy link
Contributor

@breskeby am I correct in thinking that this is something that you've been working on?

@breskeby
Copy link
Contributor

@pugnascotia yes there is not much groovy left these days but the stuff that is left is more than just a simple port

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-delivery (Team:Delivery)

@morantaf
Copy link

morantaf commented Apr 6, 2023

Hey, I'm going to give a go to SnippetsTask

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Delivery/Build Build or test infrastructure good first issue low hanging fruit >refactoring Team:Delivery Meta label for Delivery team
Projects
None yet
Development

No branches or pull requests