Skip to content

Commit b41fc7b

Browse files
authored
chore: remove dead gRPC plumbing after JSON-RPC migration (PR 3/3) (#1867)
Both transport halves now speak JSON-RPC over a TCP loopback socket (#1863 PR 1/3, #1864 PR 2/3). This final cleanup removes the now-dead gRPC references so the repo has zero gRPC plumbing and is ready to cut a release. - proto/gradle.proto: delete the `service Gradle { ... }` block (all message definitions stay - they remain the JSON-RPC payload schema). - build.gradle: delete the unused `grpcVersion` ext property. - cgmanifest.json: drop the 4 stale io.grpc maven entries (deps removed in PR 1/3). - ThirdPartyNotices.txt: drop the grpc notice + renumber the index. - npm-package: drop the unused `@grpc/grpc-js` dependency + refresh lock. - extension/webpack.config.js: drop the dead `@grpc/proto-loader` external. - docs (README/ARCHITECTURE/CONTRIBUTING): describe the transport as JSON-RPC over TCP loopback instead of gRPC. - code comments: reword stale/legacy "gRPC" mentions to "legacy transport" while keeping the error-code-parity rationale. No runtime behavior change; no proto schema change; log/telemetry paths untouched.
1 parent 299c90b commit b41fc7b

18 files changed

Lines changed: 47 additions & 411 deletions

File tree

ARCHITECTURE.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,31 +21,31 @@ For information about the Build Server itself, visit the [Gradle Build Server](h
2121
Language Server provides language features such as code completion and diagnostics for Gradle script files. It communicates with the Language Client using the [Language Server Protocol](https://microsoft.github.io/language-server-protocol/) through named pipe.
2222

2323
## Task Server
24-
The task server and client using [gRPC](https://grpc.io/) as the interface between each other. It uses TypeScript (Node.js) on the client and Java on the server. A long running server provides very good performance.
24+
The task server and client use [JSON-RPC 2.0](https://www.jsonrpc.org/specification) over a TCP loopback socket (`127.0.0.1` + an ephemeral port) as the interface between each other, via [LSP4J](https://github.com/eclipse-lsp4j/lsp4j) on the server and [`vscode-jsonrpc`](https://www.npmjs.com/package/vscode-jsonrpc) on the client. It uses TypeScript (Node.js) on the client and Java on the server. A long running server provides very good performance.
2525

26-
On extension activate, the client starts the Java gRPC server which remains running for the period the extension is activated. The server is packaged with the extension as a fat `.jar` file and is started by Node.js via executables generated by Gradle [CreateStartScripts](https://docs.gradle.org/current/dsl/org.gradle.jvm.application.tasks.CreateStartScripts.html).
26+
On extension activate, the client binds the loopback listener and starts the Java server, which connects back over JSON-RPC and remains running for the period the extension is activated. The server is packaged with the extension as a fat `.jar` file and is started by Node.js via executables generated by Gradle [CreateStartScripts](https://docs.gradle.org/current/dsl/org.gradle.jvm.application.tasks.CreateStartScripts.html).
2727

28-
[Protocol buffers](https://developers.google.com/protocol-buffers) are used to define the gRPC service & messages. The Java & JavaScript message classes, as well as the client and server interfaces, are generated from the Protobuf files via the `protoc` compiler. TypeScript type definitions are generated from the JavaScript classes.
28+
[Protocol buffers](https://developers.google.com/protocol-buffers) are used to define the message types exchanged between the client and server (serialized as payloads inside the JSON-RPC envelope). The Java & JavaScript message classes are generated from the Protobuf files via the `protoc` compiler. TypeScript type definitions are generated from the JavaScript classes.
2929

3030
The Java server uses the [Gradle Tooling Api](https://docs.gradle.org/current/userguide/third_party_integration.html#embedding) to discover projects & tasks, and to run Gradle tasks.
3131

3232
### Discovering Projects & Tasks
3333

3434
Tasks belong to projects and projects are hierarchical, meaning projects can have sub-projects, and any/all projects in the tree can have tasks.
3535

36-
The gRPC server provides a `getBuild` method to provide this hierarchical data structure, and accepts a `projectDir` argument, which the client provides.
36+
The server provides a `getBuild` method to provide this hierarchical data structure, and accepts a `projectDir` argument, which the client provides.
3737

3838
A root project (`projectDir`) is defined by having a gradle wrapper script at the root (`gradlew` or `gradlew.bat`). By default the extension will search for wrapper scripts at the root of the workspaces, but you can control this behaviour by setting `gradle.nestedProjects` to allow the extension to discover Gradle projects at other locations.
3939

40-
Once the client has discovered the root projects for all workspaces, it requests project data for each root project via separate gRPC method calls using `getBuild`. Gradle progress and output (`STDERR` & `STDOUT`) are streamed to the client. Once the tasks have been discovered and returned to the client, it builds a single-dimensional list of vscode tasks from the Gradle project tasks. These vscode tasks have definitions that contain all the relevant task & project information.
40+
Once the client has discovered the root projects for all workspaces, it requests project data for each root project via separate `getBuild` method calls. Gradle progress and output (`STDERR` & `STDOUT`) are streamed to the client. Once the tasks have been discovered and returned to the client, it builds a single-dimensional list of vscode tasks from the Gradle project tasks. These vscode tasks have definitions that contain all the relevant task & project information.
4141

4242
The extension models the project hierarchical structure using the vscode tree view. The tree view data provider consumes the vscode tasks, and builds a tree of projects & tasks using the information provided in the task definitions.
4343

4444
### Running Tasks
4545

4646
Gradle tasks can be run through either the [Tree View](https://code.visualstudio.com/api/extension-guides/tree-view) or the Command Palette.
4747

48-
Tasks are run via the `runBuild` gRPC method. Similar to getting project data, Gradle progress and output (`STDERR` & `STDOUT`) is streamed to the client. Tasks are run in a custom vscode terminal. The `runBuild` gRPC method accepts a list of arguments which are passed to the `BuildLauncher`.
48+
Tasks are run via the `runBuild` method. Similar to getting project data, Gradle progress and output (`STDERR` & `STDOUT`) is streamed to the client. Tasks are run in a custom vscode terminal. The `runBuild` method accepts a list of arguments which are passed to the `BuildLauncher`.
4949

5050
## The Build System
5151

CONTRIBUTING.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ Start by opening an issue using one of the issue templates, or propose a change
1414
- Add `npm_arch=x64` to $HOME/.gradle/gradle.properties
1515
- Add `protoc_platform=osx-x86_64` to $HOME/.gradle/gradle.properties
1616
5. If using Windows:
17-
- The extension uses `grpc-tools@1.12.x` dependency which does not work out-of-the-box in Windows (check [this issues](https://github.com/grpc/grpc-node/issues/2338) for details), so you'll need to install some aditional DLLs if the project build is failed.
1817
- Download and start [Build Tools for Visual Studio 2022](https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2022).
1918
- Go to the **Individual Components** tab and select the following:
2019
- `MSVC v143 - VS 2022 C++ x64/x86 build tools (latest)` (replacing `x64/x86` with your arch)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ We will continue improving the auto completion feature to support more cases in
191191
- View [Gradle Dependencies](https://docs.gradle.org/current/userguide/declaring_dependencies.html)
192192
- Supports massive Gradle projects (eg with 10000+ tasks)
193193
- Uses the [Gradle Tooling API](https://docs.gradle.org/current/userguide/third_party_integration.html#embedding) to discover and run Gradle tasks
194-
- Uses a long running gRPC server which provides good performance
194+
- Uses a long running JSON-RPC server which provides good performance
195195
- Supports Kotlin & Groovy build files
196196
- Supports [multi-project builds](https://docs.gradle.org/current/userguide/multi_project_builds.html)
197197
- Supports [multi-root workspaces](https://code.visualstudio.com/docs/editor/multi-root-workspaces)

ThirdPartyNotices.txt

Lines changed: 3 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@ are grateful to these developers for their contribution to open source.
1717
11. bcel (https://gitbox.apache.org/repos/asf?p=commons-bcel.git)
1818
12. gradle-tooling-api (https://github.com/gradle/gradle)
1919
13. javax.annotation-api (https://github.com/javaee/javax.annotation)
20-
14. grpc (https://github.com/grpc/grpc-java)
21-
15. version-compare (https://github.com/G00fY2/version-compare)
22-
16. slf4j-simple (http://www.slf4j.org/)
23-
17. await-lock (https://github.com/ide/await-lock)
20+
14. version-compare (https://github.com/G00fY2/version-compare)
21+
15. slf4j-simple (http://www.slf4j.org/)
22+
16. await-lock (https://github.com/ide/await-lock)
2423

2524
fs-extra NOTICES BEGIN HERE
2625
=============================
@@ -2161,78 +2160,6 @@ from your version.
21612160
=========================================
21622161
END OF javax.annotation-api NOTICES AND INFORMATION
21632162

2164-
grpc NOTICES BEGIN HERE
2165-
=============================
2166-
Apache License
2167-
Version 2.0, January 2004
2168-
http://www.apache.org/licenses/
2169-
2170-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
2171-
2172-
1. Definitions.
2173-
2174-
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
2175-
2176-
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
2177-
2178-
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
2179-
2180-
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
2181-
2182-
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
2183-
2184-
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
2185-
2186-
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
2187-
2188-
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
2189-
2190-
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
2191-
2192-
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
2193-
2194-
2. Grant of Copyright License.
2195-
2196-
Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
2197-
2198-
3. Grant of Patent License.
2199-
2200-
Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
2201-
2202-
4. Redistribution.
2203-
2204-
You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
2205-
2206-
You must give any other recipients of the Work or Derivative Works a copy of this License; and
2207-
You must cause any modified files to carry prominent notices stating that You changed the files; and
2208-
You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
2209-
If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
2210-
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
2211-
2212-
5. Submission of Contributions.
2213-
2214-
Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
2215-
2216-
6. Trademarks.
2217-
2218-
This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
2219-
2220-
7. Disclaimer of Warranty.
2221-
2222-
Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
2223-
2224-
8. Limitation of Liability.
2225-
2226-
In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
2227-
2228-
9. Accepting Warranty or Additional Liability.
2229-
2230-
While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
2231-
2232-
END OF TERMS AND CONDITIONS
2233-
=========================================
2234-
END OF grpc NOTICES AND INFORMATION
2235-
22362163
version-compare NOTICES BEGIN HERE
22372164
=============================
22382165
Apache License

build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ plugins {
55
alias(libs.plugins.spotless)
66
}
77

8-
project.ext.set('grpcVersion', '1.54.2')
98
project.ext.set('protobufVersion', '3.25.5')
109
// protoc compiler stays at 3.12.0 because the extension subproject uses
1110
// the built-in --js_out, which was removed in protoc 3.21+.

cgmanifest.json

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -78,28 +78,6 @@
7878
},
7979
"DevelopmentDependency": false
8080
},
81-
{
82-
"Component": {
83-
"Type": "maven",
84-
"Maven": {
85-
"GroupId": "io.grpc",
86-
"ArtifactId": "grpc-protobuf",
87-
"Version": "1.54.2"
88-
}
89-
},
90-
"DevelopmentDependency": false
91-
},
92-
{
93-
"Component": {
94-
"Type": "maven",
95-
"Maven": {
96-
"GroupId": "io.grpc",
97-
"ArtifactId": "grpc-stub",
98-
"Version": "1.54.2"
99-
}
100-
},
101-
"DevelopmentDependency": false
102-
},
10381
{
10482
"Component": {
10583
"Type": "maven",
@@ -122,17 +100,6 @@
122100
},
123101
"DevelopmentDependency": false
124102
},
125-
{
126-
"Component": {
127-
"Type": "maven",
128-
"Maven": {
129-
"GroupId": "io.grpc",
130-
"ArtifactId": "grpc-netty",
131-
"Version": "1.54.2"
132-
}
133-
},
134-
"DevelopmentDependency": false
135-
},
136103
{
137104
"Component": {
138105
"Type": "maven",
@@ -144,17 +111,6 @@
144111
},
145112
"DevelopmentDependency": false
146113
},
147-
{
148-
"Component": {
149-
"Type": "maven",
150-
"Maven": {
151-
"GroupId": "io.grpc",
152-
"ArtifactId": "grpc-testing",
153-
"Version": "1.54.2"
154-
}
155-
},
156-
"DevelopmentDependency": true
157-
},
158114
{
159115
"Component": {
160116
"Type": "maven",

extension/src/test/unit/gradleTasks.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ describe(getSuiteName("Gradle tasks"), () => {
675675

676676
describe("onDidLoadTasks subscription", () => {
677677
// The tree data provider subscribes to GradleTaskProvider.onDidLoadTasks
678-
// so the view recovers after a transient gRPC failure where the immediate
678+
// so the view recovers after a transient load failure where the immediate
679679
// retry succeeded but nothing else drove a re-render. These tests pin the
680680
// subscription contract: non-empty load fires the tree's change event,
681681
// empty load does not.

extension/src/test/unit/recentTasks.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ describe(getSuiteName("Recent tasks"), () => {
289289

290290
describe("onDidLoadTasks subscription", () => {
291291
// Same contract as the gradle-tasks tree: recover the recent-tasks view
292-
// after a transient gRPC failure where the immediate retry succeeded but
292+
// after a transient load failure where the immediate retry succeeded but
293293
// nothing else drove a re-render. Non-empty load must refresh, empty
294294
// load must not.
295295
it("emits onDidChangeTreeData when the load yielded tasks", () => {

0 commit comments

Comments
 (0)