Skip to content

Commit 7229dd5

Browse files
fix: rebootstrap cli (#191)
* fix: rebootstrap cli * fix linters
1 parent 97cf785 commit 7229dd5

35 files changed

+1459
-1191
lines changed

.circleci/config.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
version: 2.1
22
orbs:
3-
shared: getoutreach/shared@1.49.6
3+
shared: getoutreach/shared@1.60.0
44

55
# DEPRECATED: Use the devbase orb instead:
66
# https://github.com/getoutreach/devbase/tree/main/orbs/shared
@@ -29,6 +29,8 @@ jobs:
2929
auth:
3030
username: _json_key
3131
password: $GCLOUD_SERVICE_ACCOUNT
32+
###Block(customContainers)
33+
###EndBlock(customContainers)
3234
environment:
3335
###Block(testEnvVars)
3436
###EndBlock(testEnvVars)
@@ -48,10 +50,26 @@ jobs:
4850
- shared/save_go_cache # We save at the end because binaries are included with this
4951
- shared/upload_test_results # Uploads to CircleCI
5052

53+
finalize-coverage:
54+
executor:
55+
name: shared/testbed-docker
56+
docker:
57+
- image: gcr.io/outreach-docker/bootstrap/ci:stable
58+
auth:
59+
username: _json_key
60+
password: $GCLOUD_SERVICE_ACCOUNT
61+
steps:
62+
- shared/setup_environment
63+
- run:
64+
name: Finish Coveralls upload
65+
command: ./scripts/shell-wrapper.sh ci/testing/coveralls-finish.sh
66+
5167
release-dryrun:
5268
executor:
5369
name: shared/testbed-docker
5470
docker_tag: stable
71+
###Block(releaseDryRun)
72+
###EndBlock(releaseDryRun)
5573
steps:
5674
- shared/setup_environment
5775
- shared/with_node_cache:
@@ -63,6 +81,8 @@ jobs:
6381
executor:
6482
name: shared/testbed-docker
6583
docker_tag: stable
84+
###Block(release)
85+
###EndBlock(release)
6686
steps:
6787
- shared/setup_environment
6888
- shared/with_node_cache:
@@ -133,3 +153,9 @@ workflows:
133153
ignore: /.*/
134154
tags:
135155
only: /v[0-9]+(\.[0-9]+)*(-.*)*/
156+
- finalize-coverage:
157+
context:
158+
- docker-registry
159+
- ghaccesstoken
160+
requires:
161+
- test

.clang-format

Lines changed: 0 additions & 11 deletions
This file was deleted.

.editorconfig

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,13 @@ root = true
55
end_of_line = lf
66
insert_final_newline = true
77

8-
[Makefile]
8+
[*.go,Makefile]
99
indent_style = tab
1010

11-
[*.go]
12-
indent_style = tab
13-
indent_size = 2
14-
1511
[*.{bash,rb,sh,slim,yml,yaml}]
1612
indent_style = space
1713
indent_size = 2
1814

1915
###Block(editorconfig)
16+
2017
###EndBlock(editorconfig)

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
* @getoutreach/fnd-dtss
33

44
###Block(customCodeowners)
5+
56
###EndBlock(customCodeowners)

.github/dependabot.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@ updates:
66
interval: "daily"
77
# Bootstrap managed dependencies
88
ignore:
9-
- dependency-name: github.com/getoutreach/mint
109
- dependency-name: github.com/getoutreach/gobox
11-
- dependency-name: github.com/getoutreach/httpx
12-
- dependency-name: github.com/getoutreach/services
13-
- dependency-name: github.com/getoutreach/datastores/v2
1410
- dependency-name: github.com/urfave/cli/v2
1511

1612
# Ignore semantic-release, this code is only executed in CI.

.github/pull_request_template.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
<!--
22
!!!! README !!!! Please fill this out.
33
4-
Please follow the PR naming conventions:
4+
Please follow the PR naming conventions:
55
https://outreach-io.atlassian.net/wiki/spaces/EN/pages/1902444645/Conventional+Commits
66
-->
77

8-
98
<!-- A short description of what your PR does and what it solves. -->
10-
## What this PR does / why we need it
11-
129

10+
## What this PR does / why we need it
1311

1412
<!--- Block(jiraPrefix) --->
13+
1514
## Jira ID
1615

1716
[XX-XX]
17+
1818
<!--- EndBlock(jiraPrefix) --->
1919

2020
<!-- Notes that may be helpful for anyone reviewing this PR -->
21-
## Notes for your reviewers
22-
2321

22+
## Notes for your reviewers
2423

2524
<!--- Block(custom) -->
25+
2626
<!--- EndBlock(custom) -->

.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
*.so
66
*.dylib
77

8-
# Editors (please update any new editor files in
9-
# https://github.com/getoutreach/bootstrap/edit/master/pkg/codegen/templates/.gitignore.tpl
10-
# so every updated project gets it)
8+
# Editor files
119
*.swp
1210
*~
1311
\#*\#
@@ -63,4 +61,5 @@ Pulumi.*.yaml
6361
/apidocs
6462

6563
###Block(extras)
64+
6665
###EndBlock(extras)

.goreleaser.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
# This is an example goreleaser.yaml file with some sane defaults.
2-
# Make sure to check the documentation at http://goreleaser.com
1+
# Documentation for this file: http://goreleaser.com
32
before:
43
hooks:
54
- make dep
@@ -16,6 +15,7 @@ builds:
1615
ldflags:
1716
- '-w -s -X "github.com/getoutreach/gobox/pkg/app.Version=v{{ .Version }}"'
1817
- '-X "main.HoneycombTracingKey={{ .Env.HONEYCOMB_APIKEY }}"'
18+
- '-X "main.TeleforkAPIKey={{ .Env.TELEFORK_APIKEY }}"'
1919
env:
2020
- CGO_ENABLED=0
2121
archives: []

.releaserc.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
preset: conventionalcommits
22
branches:
3-
- name: master
43
- name: main
54
plugins:
65
- - "@semantic-release/commit-analyzer"
@@ -11,8 +10,7 @@ plugins:
1110
release: patch
1211
# Block major version upgrades due to us not supporting them that well. This can
1312
# be disabled by setting releaseOptions.allowMajorVersions, but be warned this
14-
# is not well supported for services. Please talk to #dev-tooling-support before
15-
# doing this to save yourself from issues.
13+
# is not well supported for services.
1614
- - "@semantic-release/exec"
1715
# We use generateNotesCmd instead of verifyConditionsCmd because it has access
1816
# to last/nextRelease due to when the step runs.

.tool-versions

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
golang 1.17.5
1+
# This file contains tool versions for use with asdf
2+
golang 1.17.9
3+
nodejs 16.13.0
24
terraform 0.13.5
3-
protoc 3.19.1
45
ruby 2.6.6
5-
# Note: This version of node is just for bootstrap tooling
6-
# not for actual usage of node clients (if they exist) for
7-
# this service.
8-
nodejs 16.13.0
6+
protoc 3.19.1
97
# Note: Versions in this block override the above. Be EXTREMELY
108
# CAREFUL with this. If you override a standard version you are
119
# reducing compatibility guarantees.

CONTRIBUTING.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,33 @@
1-
21
# localizer
32

43
<!--- Block(customGeneralInformation) -->
4+
55
<!--- EndBlock(customGeneralInformation) -->
66

77
## Prerequisites
88

9-
<!-- Block(customPrerequisites) -->
10-
<!-- EndBlock(customPrerequisites) -->
9+
<!--- Block(customPrerequisites) -->
10+
11+
<!--- EndBlock(customPrerequisites) -->
1112

1213
## Building and Testing
1314

14-
<!-- Block(customBuildingAndTesting) -->
15-
<!-- EndBlock(customBuildingAndTesting) -->
16-
### Replacing a Remote Version of the Library with Local Version
15+
<!--- Block(customBuildingAndTesting) -->
16+
17+
<!--- EndBlock(customBuildingAndTesting) -->
1718

18-
If you want to test the library exposed in this repository in a project that uses it, you can
19+
### Replacing a Remote Version of the a Package with Local Version
20+
21+
_This is only applicable if this repository exposes a public package_.
22+
23+
If you want to test a package exposed in this repository in a project that uses it, you can
1924
add the following `replace` directive to that project's `go.mod` file:
2025

2126
```
2227
replace github.com/getoutreach/localizer => /path/to/local/version/localizer
2328
```
2429

25-
**_Note_**: This library may have postfixed it's module path with a version, go check the first
30+
**_Note_**: This repository may have postfixed it's module path with a version, go check the first
2631
line of the `go.mod` file in this repository to see if that is the case. If that is the case,
2732
you will need to modify the first part of the replace directive (the part before the `=>`) with
2833
that postfixed path.
@@ -33,4 +38,4 @@ You can run the the linters and unit tests with:
3338

3439
```bash
3540
make test
36-
```
41+
```

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
APP := localizer
22
OSS := true
3-
_ := $(shell ./scripts/bootstrap-lib.sh)
3+
_ := $(shell ./scripts/devbase.sh)
44

55
include .bootstrap/root/Makefile
66

77
###Block(targets)
8+
89
###EndBlock(targets)

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
21
# localizer
2+
33
[![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white)](https://pkg.go.dev/github.com/getoutreach/localizer)
44
[![Generated via Bootstrap](https://img.shields.io/badge/Outreach-Bootstrap-%235951ff)](https://github.com/getoutreach/bootstrap)
5+
[![Coverage Status](https://coveralls.io/repos/github/getoutreach/localizer/badge.svg?branch=main)](https://coveralls.io/github//getoutreach/localizer?branch=main)
56

67
A no-frills local development approach for Kubernetes powered Developer Environments.
78

@@ -12,6 +13,7 @@ Please read the [CONTRIBUTING.md](CONTRIBUTING.md) document for guidelines on de
1213
## High-level Overview
1314

1415
<!--- Block(overview) -->
16+
1517
Tools such as; Telepresence, Skaffold, and others all attempt to solve the problem of getting users
1618
used to using Kubernetes. This is a pretty big task given that Kubernetes has a gigantic surface
1719
area. From my experience (**keyword**: _my experience_), developers have no interest in what
@@ -21,10 +23,10 @@ a tool that requires no configuration, and is self-explanatory. Which these tool
2123

2224
Given the above, localizer attempts to solve this problem with a few rules:
2325

24-
* A kubernetes cluster should be able to be run locally, but applications should be accessible as if
25-
they were running "locally" (**Note**: Only on Linux do containers _actually_ run locally, the rest are VMs pretending)
26-
* There should be little-to-no DSL to interact with services running in Kubernetes locally.
27-
* No assurances of code working locally will just "work" in Kubernetes. (Let's face it, what you're running locally will never match your production clusters 100%, and if we need to test Kubernetes manifests/etc we should be deploying things into our local cluster and be used to debugging whatever way you do that).
26+
- A kubernetes cluster should be able to be run locally, but applications should be accessible as if
27+
they were running "locally" (**Note**: Only on Linux do containers _actually_ run locally, the rest are VMs pretending)
28+
- There should be little-to-no DSL to interact with services running in Kubernetes locally.
29+
- No assurances of code working locally will just "work" in Kubernetes. (Let's face it, what you're running locally will never match your production clusters 100%, and if we need to test Kubernetes manifests/etc we should be deploying things into our local cluster and be used to debugging whatever way you do that).
2830

2931
## What does `localizer` actually do?
3032

@@ -49,6 +51,7 @@ allowing remote resources to access your local machine as if they were also runn
4951
## Install `localizer`
5052

5153
You can install the (OSX/LINUX) binary directly into /usr/local/bin:
54+
5255
```
5356
$ curl -Ls https://github.com/getoutreach/localizer/releases/download/v1.9.0/localizer_1.9.0_$(uname)_amd64.tar.gz | tar -xzC /usr/local/bin localizer
5457
```

api/v1.proto

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ package api.v1;
1818
option go_package = "github.com/getoutreach/localizer/api";
1919

2020
message ExposeServiceRequest {
21-
string namespace = 1;
22-
string service = 2;
21+
string namespace = 1;
22+
string service = 2;
2323
repeated string port_map = 3;
2424
}
2525

@@ -29,14 +29,14 @@ message PingRequest {}
2929

3030
message StopExposeRequest {
3131
string namespace = 1;
32-
string service = 2;
32+
string service = 2;
3333
}
3434

3535
enum ConsoleLevel {
3636
CONSOLE_LEVEL_UNSPECIFIED = 0;
37-
CONSOLE_LEVEL_INFO = 1;
38-
CONSOLE_LEVEL_WARN = 2;
39-
CONSOLE_LEVEL_ERROR = 3;
37+
CONSOLE_LEVEL_INFO = 1;
38+
CONSOLE_LEVEL_WARN = 2;
39+
CONSOLE_LEVEL_ERROR = 3;
4040
}
4141

4242
// This will be turned into ConsoleResponse to be generic probably some
@@ -52,24 +52,20 @@ message ConsoleResponse {
5252
message PingResponse {}
5353

5454
message ListService {
55-
string namespace = 1;
56-
string name = 2;
57-
string status = 3;
58-
string endpoint = 4;
59-
string status_reason = 5;
60-
string ip = 6;
55+
string namespace = 1;
56+
string name = 2;
57+
string status = 3;
58+
string endpoint = 4;
59+
string status_reason = 5;
60+
string ip = 6;
6161
repeated string ports = 7;
6262
}
6363

64-
message ListResponse {
65-
repeated ListService services = 1;
66-
}
64+
message ListResponse { repeated ListService services = 1; }
6765

6866
message Empty {}
6967

70-
message StableResponse {
71-
bool stable = 1;
72-
}
68+
message StableResponse { bool stable = 1; }
7369

7470
service LocalizerService {
7571
rpc ExposeService(ExposeServiceRequest) returns (stream ConsoleResponse) {}

bootstrap.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.

cmd/localizer/expose.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func NewExposeCommand(log logrus.FieldLogger) *cli.Command { //nolint:funlen
8989

9090
for {
9191
res, err := stream.Recv()
92-
if err == io.EOF {
92+
if errors.Is(err, io.EOF) {
9393
return nil
9494
} else if err != nil {
9595
return err

0 commit comments

Comments
 (0)