Skip to content

Converting DependencyLicensesTask and UpdateShasTask to java #41921

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

Merged
merged 6 commits into from
Jun 13, 2019

Conversation

Megamiun
Copy link
Contributor

@Megamiun Megamiun commented May 7, 2019

Relates to #34459 and #35231.

Unfortunately, I closed the previous PR on my changes while cleaning my repo.

For more info, see #35231

@Megamiun Megamiun force-pushed the refactor/updateshastask-to-java branch from 6057570 to 93cc4bd Compare May 8, 2019 00:46
@astefan astefan requested a review from alpar-t May 8, 2019 07:38
@astefan astefan added :Delivery/Build Build or test infrastructure >enhancement labels May 8, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

@alpar-t
Copy link
Contributor

alpar-t commented May 8, 2019

@elasticmachine test this please

@Megamiun
Copy link
Contributor Author

Megamiun commented May 8, 2019

Hello, I see it failed on :qa:wildfly:startWildfly, but I have no idea why, has it already happenned another time?

@alpar-t
Copy link
Contributor

alpar-t commented May 8, 2019

that looks unrelated @elasticmachine run elasticsearch-ci/1

@Megamiun
Copy link
Contributor Author

@atorok Do you know what I can do to correct this test? Should we ask the checks to rerun?

@alpar-t
Copy link
Contributor

alpar-t commented May 17, 2019

@Megamiun This one doesn't seem related either, but a rerun won't work for sure without merging master in.

@Megamiun Megamiun force-pushed the refactor/updateshastask-to-java branch from fc71b2b to a9462d9 Compare May 18, 2019 01:27
@Megamiun
Copy link
Contributor Author

@atorok I rebased it. If needed when you will run the pipeline, I think you can merge/rebase it again.

(Not sure, but I think that yes)

@alpar-t
Copy link
Contributor

alpar-t commented May 20, 2019

@elasticmachine test this please.
@Megamiun future note, we prefer merging into existing PRs instead of rebase as we squash merge anyhow and it makes reviewing easier.

@Megamiun
Copy link
Contributor Author

@atorok Ah, ok, I will remember to merge instead of rebase in the future

@Megamiun
Copy link
Contributor Author

Hello, @atorok, just to know, when will this PR be merged? I think there is another PR waiting for this one to be approved to be finished.

Copy link
Contributor

@alpar-t alpar-t left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution! I left a few small comments.
Also can you please arrange method order for tasks so we have inputs/outputs first in the class followed by task action and everything else.

Set<File> getShaFiles() {
File[] array = licensesDir.listFiles();
if (array == null) {
return Collections.emptySet();
Copy link
Contributor

Choose a reason for hiding this comment

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

licensesDir should always be a directory, so we should throw an exception if we get a null here .

}

String getSha1(File file) throws IOException, NoSuchAlgorithmException {
return applySha1(getBytes(file));
Copy link
Contributor

Choose a reason for hiding this comment

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

I would inline applySha1 as otherwise getSha1 is a lazy method., same with getBytes just makes things harder to read.

import org.elasticsearch.gradle.test.GradleIntegrationTestCase;
import org.gradle.testkit.runner.GradleRunner;

public class DependencyLicensesTasksIT extends GradleIntegrationTestCase {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you think there's any added benefit of the integration test over the unit test ?
The only one I see is that it checks that the task is wired correctly, but it does a lot more checks that seem redundant. The unit test is probably sufficient in this case. A unit test for PrecommitTasks could check the wiring if we wanted to ( not saying it needs to go in this PR ).

@Megamiun
Copy link
Contributor Author

Sorry for the lateness, made the changes.

But I have one doubt, should really DependenciesInfoTask receive a LinkedHashMap and DependencyLicensesTask too? Wouldn't it be better that it just returned a common Map?

@alpar-t
Copy link
Contributor

alpar-t commented Jun 12, 2019

@elasticmachine test this please

@alpar-t
Copy link
Contributor

alpar-t commented Jun 12, 2019

@elasticmachine update branch

@alpar-t
Copy link
Contributor

alpar-t commented Jun 12, 2019

@elasticmachine test this please

@alpar-t alpar-t merged commit 15908ac into elastic:master Jun 13, 2019
@mark-vieira mark-vieira added the Team:Delivery Meta label for Delivery team label Nov 11, 2020
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 >enhancement Team:Delivery Meta label for Delivery team v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants