Skip to content

Commit b58f501

Browse files
chore: merge main into generate-libraries-main
2 parents 6f9f9cf + f22935d commit b58f501

9 files changed

Lines changed: 25 additions & 21 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ on:
33
branches:
44
- main
55
pull_request:
6-
paths-ignore:
7-
- 'internal/librariangen/**'
86
name: ci
97
jobs:
108
build:

.github/workflows/dependency_compatibility_test.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ on:
44
pull_request:
55
branches:
66
- 'main'
7-
paths-ignore:
8-
- 'internal/librariangen/**'
97
workflow_dispatch:
108
inputs:
119
dependencies-list:

.github/workflows/hermetic_library_generation.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
name: Hermetic library generation upon generation config change through pull requests
1717
on:
1818
pull_request:
19-
paths-ignore:
20-
- 'internal/librariangen/**'
2119

2220
env:
2321
REPO_FULL_NAME: ${{ github.event.pull_request.head.repo.full_name }}

.github/workflows/java_compatibility_check.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
# downstream client libraries before they are released.
1616
on:
1717
pull_request:
18-
paths-ignore:
19-
- 'internal/librariangen/**'
2018
name: Java 8 compatibility check
2119
jobs:
2220
java8-compatibility-check:

.github/workflows/sonar.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ on:
55
- main
66
pull_request:
77
types: [opened, synchronize, reopened]
8-
paths-ignore:
9-
- 'internal/librariangen/**'
108
jobs:
119
build:
1210
name: Build

.github/workflows/verify_library_generation.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
on:
22
pull_request:
3-
paths-ignore:
4-
- 'internal/librariangen/**'
53

64
name: verify_library_generation
75
jobs:

internal/librariangen/generate/generator.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ import (
2727

2828
"cloud.google.com/java/internal/librariangen/bazel"
2929
"cloud.google.com/java/internal/librariangen/execv"
30+
"cloud.google.com/java/internal/librariangen/message"
3031
"cloud.google.com/java/internal/librariangen/protoc"
31-
"cloud.google.com/java/internal/librariangen/request"
3232
)
3333

3434
// Test substitution vars.
3535
var (
3636
bazelParse = bazel.Parse
3737
execvRun = execv.Run
38-
requestParse = request.ParseLibrary
38+
requestParse = message.ParseLibrary
3939
protocBuild = protoc.Build
4040
)
4141

@@ -113,7 +113,7 @@ func Generate(ctx context.Context, cfg *Config) error {
113113
// invokeProtoc handles the protoc GAPIC generation logic for the 'generate' CLI command.
114114
// It reads a request file, and for each API specified, it invokes protoc
115115
// to generate the client library. It returns the module path and the path to the service YAML.
116-
func invokeProtoc(ctx context.Context, cfg *Config, generateReq *request.Library) error {
116+
func invokeProtoc(ctx context.Context, cfg *Config, generateReq *message.Library) error {
117117
for _, api := range generateReq.APIs {
118118
apiServiceDir := filepath.Join(cfg.SourceDir, api.Path)
119119
slog.Info("processing api", "service_dir", apiServiceDir)
@@ -135,7 +135,7 @@ func invokeProtoc(ctx context.Context, cfg *Config, generateReq *request.Library
135135
// readGenerateReq reads generate-request.json from the librarian-tool input directory.
136136
// The request file tells librariangen which library and APIs to generate.
137137
// It is prepared by the Librarian tool and mounted at /librarian.
138-
func readGenerateReq(librarianDir string) (*request.Library, error) {
138+
func readGenerateReq(librarianDir string) (*message.Library, error) {
139139
reqPath := filepath.Join(librarianDir, "generate-request.json")
140140
slog.Debug("librariangen: reading generate request", "path", reqPath)
141141

@@ -264,4 +264,4 @@ func unzip(src, dest string) error {
264264
}
265265
}
266266
return nil
267-
}
267+
}
Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,30 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
package request
15+
// Package message defines data types which the Librarian CLI and language
16+
// containers exchange.
17+
// There shouldn't be CLI-specific data type or language container-specific
18+
// data types in this package.
19+
// TODO(b/447404382): Move this package to the https://github.com/googleapis/librarian
20+
// GitHub repository once the interface is finalized.
21+
package message
1622

1723
import (
1824
"encoding/json"
1925
"fmt"
2026
"os"
2127
)
2228

29+
// ReleaseInitRequest is the structure of the release-init-request.json file.
30+
type ReleaseInitRequest struct {
31+
Libraries []*Library `json:"libraries"`
32+
}
33+
34+
// ReleaseInitResponse is the structure of the release-init-response.json file.
35+
type ReleaseInitResponse struct {
36+
Error string `json:"error,omitempty"`
37+
}
38+
2339
// Library is the combination of all the fields used by CLI requests and responses.
2440
// Each CLI command has its own request/response type, but they all use Library.
2541
type Library struct {
@@ -75,4 +91,4 @@ func ParseLibrary(path string) (*Library, error) {
7591
}
7692

7793
return &req, nil
78-
}
94+
}

internal/librariangen/request/request_test.go renamed to internal/librariangen/message/message_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
package request
15+
package message
1616

1717
import (
1818
"os"
@@ -95,4 +95,4 @@ func TestParseLibrary_FileNotFound(t *testing.T) {
9595
if err == nil {
9696
t.Error("Parse() expected error for non-existent file, got nil")
9797
}
98-
}
98+
}

0 commit comments

Comments
 (0)