Skip to content

Commit 2f1c131

Browse files
committed
cleanup lint-and-format, ruby build, bump features to use latest sdkbuild ruby for local deps
1 parent e56c1ad commit 2f1c131

5 files changed

Lines changed: 25 additions & 31 deletions

File tree

cmd/dev/lint_and_format.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,14 @@ func lintAndFormatRubyWorker(ctx context.Context, workerDir string) error {
214214
}
215215

216216
harnessDir := workerDir + "/harness"
217-
fmt.Println("Installing Ruby harness deps for type checking...")
218-
if err := runCommandInDir(ctx, harnessDir, "bundle", "install"); err != nil {
217+
218+
fmt.Println("Formatting Ruby harness...")
219+
if err := runCommandInDir(ctx, harnessDir, "bundle", "exec", "rubocop", "-A"); err != nil {
220+
return err
221+
}
222+
223+
fmt.Println("Linting Ruby harness...")
224+
if err := runCommandInDir(ctx, harnessDir, "bundle", "exec", "rubocop"); err != nil {
219225
return err
220226
}
221227

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ require (
1212
github.com/spf13/cobra v1.7.0
1313
github.com/spf13/pflag v1.0.5
1414
github.com/stretchr/testify v1.11.1
15-
github.com/temporalio/features v0.0.0-20260331150122-757294c2a9e9
15+
github.com/temporalio/features v0.0.0-20260427223549-86e4c0deedd7
1616
github.com/temporalio/omes/workers/go/projects/harness/api v0.0.0-00010101000000-000000000000
1717
go.temporal.io/api v1.62.7
1818
go.temporal.io/sdk v1.42.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/
9797
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
9898
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
9999
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
100-
github.com/temporalio/features v0.0.0-20260331150122-757294c2a9e9 h1:9ifP6KcfPhf22qFb4t7L8M11nkWGD8cyAFQ3fUrLqFw=
101-
github.com/temporalio/features v0.0.0-20260331150122-757294c2a9e9/go.mod h1:LsZUh/AkCjnOKrEpnEklGmsJ3g758Hyq2X+hzMofMjw=
100+
github.com/temporalio/features v0.0.0-20260427223549-86e4c0deedd7 h1:gBLwgyi8xw0oqZgxMwxTRGIfP8RxtI7r1igm3G6aXGY=
101+
github.com/temporalio/features v0.0.0-20260427223549-86e4c0deedd7/go.mod h1:BUWwBMK+Ga5h9xPTS7+kmutSIfY4K1gfSH8eG7fSbU0=
102102
github.com/tklauser/go-sysconf v0.3.15 h1:VE89k0criAymJ/Os65CSn1IXaol+1wrsFHEB8Ol49K4=
103103
github.com/tklauser/go-sysconf v0.3.15/go.mod h1:Dmjwr6tYFIseJw7a3dRLJfsHAMXZ3nEnL/aZY+0IuI4=
104104
github.com/tklauser/numcpus v0.10.0 h1:18njr6LDBk1zuna922MgdjQuJFjrdppsZG60sHGfjso=

workers/build.go

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -278,37 +278,22 @@ func (b *Builder) buildDotNet(ctx context.Context, baseDir string) (sdkbuild.Pro
278278
}
279279

280280
func (b *Builder) buildRuby(ctx context.Context, baseDir string) (sdkbuild.Program, error) {
281-
// If version not provided, read the version constraint from the gemspec.
282-
version := b.SdkOptions.Version
283-
if version == "" {
284-
gemspecBytes, err := os.ReadFile(filepath.Join(baseDir, "omes.gemspec"))
285-
if err != nil {
286-
return nil, fmt.Errorf("failed reading omes.gemspec: %w", err)
287-
}
288-
for _, line := range strings.Split(string(gemspecBytes), "\n") {
289-
line = strings.TrimSpace(line)
290-
if strings.Contains(line, "'temporalio'") || strings.Contains(line, `"temporalio"`) {
291-
parts := strings.Split(line, ",")
292-
if len(parts) >= 2 {
293-
version = strings.TrimSpace(parts[1])
294-
version = strings.Trim(version, `"'`)
295-
}
296-
break
297-
}
298-
}
299-
if version == "" {
300-
return nil, fmt.Errorf("version not found in omes.gemspec")
301-
}
302-
}
303-
304-
prog, err := sdkbuild.BuildRubyProgram(ctx, sdkbuild.BuildRubyProgramOptions{
281+
options := sdkbuild.BuildRubyProgramOptions{
305282
BaseDir: baseDir,
306283
SourceDir: baseDir,
307284
DirName: b.DirName,
308-
Version: version,
285+
Version: b.SdkOptions.Version,
309286
Stdout: b.stdout,
310287
Stderr: b.stderr,
311-
})
288+
}
289+
if b.ProjectName == "" {
290+
options.MoreDependencies = []sdkbuild.RubyDependency{{
291+
Name: "harness",
292+
Path: filepath.Join(baseDir, "harness"),
293+
}}
294+
}
295+
296+
prog, err := sdkbuild.BuildRubyProgram(ctx, options)
312297
if err != nil {
313298
return nil, fmt.Errorf("failed preparing: %w", err)
314299
}

workers/ruby/harness/harness.gemspec

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
# frozen_string_literal: true
2+
13
Gem::Specification.new do |s|
24
s.name = 'harness'
35
s.version = '0.1.0'
46
s.summary = 'Ruby harness for Omes projects'
57
s.authors = ['Temporal Technologies Inc']
68
s.email = ['sdk@temporal.io']
79
s.license = 'MIT'
10+
s.required_ruby_version = '>= 3.3'
811
s.files = Dir['lib/**/*.rb'] + Dir['sig/**/*.rbs']
912
s.require_paths = ['lib']
1013
s.add_dependency 'google-protobuf', '~> 4.0'

0 commit comments

Comments
 (0)