tylerbertrand opened a new pull request, #2680:
URL: https://github.com/apache/solr/pull/2680

   <!--
   _(If you are a project committer then you may remove some/all of the 
following template.)_
   
   Before creating a pull request, please file an issue in the ASF Jira system 
for Solr:
   
   * https://issues.apache.org/jira/projects/SOLR
   
   For something minor (i.e. that wouldn't be worth putting in release notes), 
you can skip JIRA. 
   To create a Jira issue, you will need to create an account there first.
   
   The title of the PR should reference the Jira issue number in the form:
   
   * SOLR-####: <short description of problem or changes>
   
   SOLR must be fully capitalized. A short description helps people scanning 
pull requests for items they can work on.
   
   Properly referencing the issue in the title ensures that Jira is correctly 
updated with code review comments and commits. -->
   
   
   # Description
   
   Sometimes, `NpmTask`s are failing with being unable to find files/commands 
under `npmProjectDir`. [Here's an example of such a 
failure](https://ge.solutions-team.gradle.com/s/edxfitmmecv7i/failure#1). The 
failing tasks always execute after the `nodeSetup` task for that project, so in 
theory, everything should be in place.
   
   However, in this case, multiple subprojects share the same `npmProjectDir`. 
The way the `gradle-node-plugin` works, having multiple projects use the same 
`npmProjectDir` doesn't save work, and can actually cause timing issues like 
the failures we are seeing. This is because [each `nodeSetup` task clears out 
the old directory before it unpacks it 
again](https://github.com/node-gradle/gradle-node-plugin/blob/main/src/main/kotlin/com/github/gradle/node/task/NodeSetupTask.kt#L50-L85).
 [In the Timeline view of the same Build Scan linked 
above](https://ge.solutions-team.gradle.com/s/edxfitmmecv7i/timeline?details=wa5cqs7lpiyvq&end=1724359674712&outcome=failed&start=1724359674660),
 we can see that the `:solr:solr-ref-guide:downloadAntoraCli` task (an 
`NpmTask`), is executing at the same time as `:solr:packaging:nodeSetup`, and 
`downloadAntoraCli` can't find `node` because it's been cleared out by another 
suproject's `nodeSetup` task.
   
   # Solution
   
   This PR updates each subproject to use its own individual `nodeProjectDir` 
to avoid these timing issues. Separating these out doesn't result in `node` 
being downladed twice - despite unpacking the same version multiple times, it's 
only ever downloaded once.  So no extra work is being done, since sharing the 
same `nodeProjectDir` doesn't save work in the first place, as explained above.
   
   # Tests
   
   No new tests were added, and no existing tests were modified, but the 
`check` and `integrationTests` tasks consistently pass when run locally with 
these changes.
   
   # Checklist
   
   Please review the following and check all that apply:
   
   - [x] I have reviewed the guidelines for [How to 
Contribute](https://github.com/apache/solr/blob/main/CONTRIBUTING.md) and my 
code conforms to the standards described there to the best of my ability.
   - [ ] I have created a Jira issue and added the issue ID to my pull request 
title.
   - [x] I have given Solr maintainers 
[access](https://help.github.com/en/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork)
 to contribute to my PR branch. (optional but recommended, not available for 
branches on forks living under an organisation)
   - [x] I have developed this patch against the `main` branch.
   - [x] I have run `./gradlew check`.
   - [ ] I have added tests for my changes.
   - [ ] I have added documentation for the [Reference 
Guide](https://github.com/apache/solr/tree/main/solr/solr-ref-guide)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to