Skip to content

Commit 50e6b47

Browse files
authored
fix: narrow diff to only include changes from the source branch (#423)
1 parent 1dc3068 commit 50e6b47

34 files changed

+2365
-3748
lines changed

.gitattributes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
* text=auto
2+
*.go text eol=lf
3+
go.mod text eol=lf
4+
go.sum text eol=lf linguist-generated=true
5+
mocks/** linguist-generated=true

.mockery.yaml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
1-
with-expecter: true
2-
dir: "mocks/{{.PackageName}}/mocks"
1+
dir: "mocks/{{.SrcPackageName}}/mocks"
2+
filename: "mock_{{.StructName}}.go"
33
packages:
4+
github.com/zapier/kubechecks/pkg/affected_apps:
5+
interfaces:
6+
Matcher: {}
7+
github.com/zapier/kubechecks/pkg/generator:
8+
interfaces:
9+
AppsGenerator: {}
410
github.com/zapier/kubechecks/pkg/vcs:
5-
config:
6-
all: true
11+
interfaces:
12+
Client: {}
713
github.com/zapier/kubechecks/pkg/vcs/github_client:
8-
# place your package-specific config here
9-
config:
10-
all: true
14+
interfaces:
15+
RepositoriesServices: {}
16+
PullRequestsServices: {}
1117
github.com/zapier/kubechecks/pkg/vcs/gitlab_client:
12-
# place your package-specific config here
13-
config:
14-
all: true
18+
interfaces:
19+
ProjectsServices: {}

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ helm-cr 1.6.1
66
helm-ct 3.11.0
77
kubeconform 0.6.7
88
kustomize 5.6.0
9-
mockery 2.46.3
9+
mockery 3.3.4
1010
tilt 0.33.2

cmd/locations.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
// The function returns an error if any Git repository fails to clone.
2323
func processLocations(ctx context.Context, ctr container.Container, locations []string) error {
2424
for index, location := range locations {
25-
if newLocation, err := maybeCloneGitUrl(ctx, ctr.RepoManager, ctr.Config.RepoRefreshInterval, location, ctr.VcsClient.Username(), ctr.Config.RepoShallowClone); err != nil {
25+
if newLocation, err := maybeCloneGitUrl(ctx, ctr.RepoManager, ctr.Config.RepoRefreshInterval, location, ctr.VcsClient.CloneUsername(), ctr.Config.RepoShallowClone); err != nil {
2626
return errors.Wrapf(err, "failed to clone %q", location)
2727
} else if newLocation != "" {
2828
locations[index] = newLocation

docs/contributing.md

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -69,36 +69,38 @@ To get started do the following:
6969

7070
* Copy the `.secret.example` and set required values.
7171

72-
```console
72+
```sh
7373
cp .secret.example .secret
7474
```
75-
You will need to fill in either `GITLAB_TOKEN` or `GITLAB_TOKEN`
76-
If you are testing with GITHUB, please set the tile_config.json file to specify the vcs-type as the default is `gitlab`.
77-
The token you specify must have ability to get repositories, add/delete comment and webhooks.
78-
```json
79-
{
80-
"vcs-type": "github"
81-
}
82-
```
75+
76+
You will need to fill in either `GITLAB_TOKEN` or `GITLAB_TOKEN`
77+
If you are testing with GITHUB, please set the tilt_config.json file to specify the vcs-type as the default is `gitlab`:
78+
79+
```json title="tilt_config.json"
80+
{
81+
"vcs-type": "github"
82+
}
83+
```
84+
85+
The token you specify must have ability to get repositories, add/delete comment and webhooks.
8386

8487
* From the root directory of this repo:
8588

86-
```console
89+
```sh
8790
tilt up
8891
```
8992

9093
You should see output like:
9194

92-
```
93-
Tilt started on http://localhost:10350/
94-
v0.30.13, built 2022-12-05
95-
96-
(space) to open the browser
97-
(s) to stream logs (--stream=true)
98-
(t) to open legacy terminal mode (--legacy=true)
99-
(ctrl-c) to exit
95+
```
96+
Tilt started on http://localhost:10350/
97+
v0.30.13, built 2022-12-05
10098

101-
```
99+
(space) to open the browser
100+
(s) to stream logs (--stream=true)
101+
(t) to open legacy terminal mode (--legacy=true)
102+
(ctrl-c) to exit
103+
```
102104
103105
In the background Tilt has started building and deploying resources.
104106

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ require (
1717
github.com/ghodss/yaml v1.0.0
1818
github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399
1919
github.com/go-logr/zerologr v1.2.3
20+
github.com/golang-jwt/jwt/v4 v4.5.2
2021
github.com/google/go-github/v62 v62.0.0
2122
github.com/google/uuid v1.6.0
2223
github.com/heptiolabs/healthcheck v0.0.0-20211123025425-613501dd5deb
@@ -159,7 +160,6 @@ require (
159160
github.com/gobwas/glob v0.2.3 // indirect
160161
github.com/goccy/go-json v0.10.2 // indirect
161162
github.com/gogo/protobuf v1.3.2 // indirect
162-
github.com/golang-jwt/jwt/v4 v4.5.2 // indirect
163163
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
164164
github.com/golang/protobuf v1.5.4 // indirect
165165
github.com/google/btree v1.1.3 // indirect

justfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,8 @@ unit_test_race:
6767
rebuild_docs:
6868
./earthly.sh +rebuild-docs
6969

70+
rebuild_mocks:
71+
go run github.com/vektra/mockery/v3@v3.3.4
72+
7073
ci-golang:
7174
./earthly.sh +ci-golang

mkdocs.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,11 @@ theme:
88
name: material
99

1010
markdown_extensions:
11-
- attr_list
11+
- attr_list
12+
- pymdownx.highlight:
13+
anchor_linenums: true
14+
line_spans: __span
15+
pygments_lang_class: true
16+
- pymdownx.inlinehilite
17+
- pymdownx.snippets
18+
- pymdownx.superfences

mocks/affected_apps/mocks/mock_Matcher.go renamed to mocks/affected_apps/mocks/mock_MockMatcher.go

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

0 commit comments

Comments
 (0)