Skip to content

Commit c9824fe

Browse files
author
Rafael Porres Molina
authored
Merge pull request #13 from smacker/fix_analyzer_on_staging
Fix analyzer on staging
2 parents dbd8238 + f40dc03 commit c9824fe

File tree

12 files changed

+473
-84
lines changed

12 files changed

+473
-84
lines changed

.helm_staging.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
app:
22
dataServiceUrl: ipv4://lookout-work:10301
3+
port: 9930
34

45
nodeSelector:
56
srcd.host/app: lookout

Gopkg.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
[[constraint]]
4141
name = "gopkg.in/src-d/lookout-sdk.v0"
42-
version = "0.1.2"
42+
version = "0.3.0"
4343

4444
[prune]
4545
go-tests = true

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Install the analyzer, and run it:
99

1010
```shell
1111
$ go install github.com/src-d/lookout-terraform-analyzer/cmd/lookout-terraform-analyzer
12-
$ PORT=2001 lookout-terraform-analyzer
12+
$ lookout-terraform-analyzer
1313
```
1414

1515
The analyzer will start listening for pull review requests from lookout.
@@ -28,7 +28,7 @@ $ wget -O - https://raw.githubusercontent.com/src-d/lookout-sdk/master/_tools/in
2828
And then run:
2929

3030
```shell
31-
$ ./lookout-sdk review ipv4://localhost:2001
31+
$ ./lookout-sdk review
3232
```
3333

34-
It will mock a Pull Request containing the changes made by `HEAD` over `HEAD~1`, and it will send it to `lookout-terraform-analyzer` that you ran in the [previous step](#usage) and is listening under the specified port (dafault is `2001`)
34+
It will mock a Pull Request containing the changes made by `HEAD` over `HEAD~1`, and it will send it to `lookout-terraform-analyzer` that you ran in the [previous step](#usage).

cmd/lookout-terraform-analyzer/main.go

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package main
22

33
import (
4+
"context"
45
"fmt"
56
"net"
67
"os"
@@ -11,7 +12,7 @@ import (
1112

1213
"github.com/kelseyhightower/envconfig"
1314
"google.golang.org/grpc"
14-
"gopkg.in/src-d/go-log.v1"
15+
log "gopkg.in/src-d/go-log.v1"
1516
)
1617

1718
var (
@@ -24,8 +25,8 @@ const maxMessageSize = 100 * 1024 * 1024 //100mb
2425

2526
type config struct {
2627
Host string `envconfig:"HOST" default:"0.0.0.0"`
27-
Port int `envconfig:"PORT" default:"2001"`
28-
DataServiceURL string `envconfig:"DATA_SERVICE_URL" default:"localhost:10301"`
28+
Port int `envconfig:"PORT" default:"9930"`
29+
DataServiceURL string `envconfig:"DATA_SERVICE_URL" default:"ipv4://localhost:10301"`
2930
LogLevel string `envconfig:"LOG_LEVEL" default:"info"`
3031
}
3132

@@ -36,9 +37,14 @@ func main() {
3637
log.DefaultFactory = &log.LoggerFactory{Level: conf.LogLevel}
3738
log.DefaultLogger = log.New(nil)
3839

39-
grpcAddr := conf.DataServiceURL
40+
grpcAddr, err := pb.ToGoGrpcAddress(conf.DataServiceURL)
41+
if err != nil {
42+
log.Errorf(err, "failed to parse DataService address %s", conf.DataServiceURL)
43+
return
44+
}
4045

41-
conn, err := grpc.Dial(
46+
conn, err := pb.DialContext(
47+
context.Background(),
4248
grpcAddr,
4349
grpc.WithInsecure(),
4450
grpc.WithDefaultCallOptions(grpc.FailFast(false)),

vendor/gopkg.in/src-d/lookout-sdk.v0/LICENSE renamed to vendor/gopkg.in/src-d/lookout-sdk.v0/LICENSE.md

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/gopkg.in/src-d/lookout-sdk.v0/NOTICE.md

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/gopkg.in/src-d/lookout-sdk.v0/pb/event.pb.go

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/gopkg.in/src-d/lookout-sdk.v0/pb/grpc.go

Lines changed: 95 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/gopkg.in/src-d/lookout-sdk.v0/pb/service_analyzer.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)