Skip to content

Commit 52815ed

Browse files
Merge 5df768c into ac944c9
2 parents ac944c9 + 5df768c commit 52815ed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+115
-5472
lines changed
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: API Diff
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
paths:
8+
- ".github/workflows/sherlock-api-diff.yaml"
9+
- "sherlock/**"
10+
- "!sherlock/docs/**"
11+
- "go-shared/**"
12+
13+
concurrency:
14+
# Don't run this workflow concurrently on the same branch
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
# For PRs, don't wait for completion of existing runs, cancel them instead
17+
cancel-in-progress: true
18+
19+
jobs:
20+
api-diff:
21+
runs-on: ubuntu-latest
22+
permissions:
23+
contents: "read"
24+
# Make comments
25+
pull-requests: "write"
26+
steps:
27+
- name: Checkout Base
28+
uses: actions/checkout@v3
29+
with:
30+
ref: ${{ github.base_ref }}
31+
path: base
32+
persist-credentials: false
33+
34+
- name: Checkout Head
35+
uses: actions/checkout@v3
36+
with:
37+
# Technically superfluous but clearer to be explicit
38+
ref: ${{ github.head_ref }}
39+
path: head
40+
persist-credentials: false
41+
42+
- name: Set up Go
43+
uses: actions/setup-go@v4
44+
with:
45+
go-version-file: head/sherlock/go.mod
46+
47+
- name: Set up Swag
48+
working-directory: head
49+
run: go install github.com/swaggo/swag/cmd/swag@latest
50+
51+
- name: Generate Swagger source
52+
working-directory: head
53+
run: make generate-swagger
54+
55+
- name: Create output directory
56+
if: ${{ github.actor != 'dependabot[bot]' }}
57+
run: mkdir output
58+
59+
- name: Generate diff
60+
run: |
61+
docker run --rm -t \
62+
-v "$(pwd)/base/sherlock/docs:/specs/base:ro" \
63+
-v "$(pwd)/head/sherlock/docs:/specs/head:ro" \
64+
-v "$(pwd)/output:/output" \
65+
openapitools/openapi-diff:latest \
66+
--log INFO \
67+
${{ (github.actor == 'dependabot[bot]' && '--fail-on-changed') || '--markdown /output/diff.md' }} \
68+
/specs/base/swagger.yaml \
69+
/specs/head/swagger.yaml
70+
71+
- name: Check diff
72+
id: check-diff
73+
if: ${{ github.actor != 'dependabot[bot]' }}
74+
run: |
75+
if [[ -z $(grep '[^[:space:]]' output/diff.md) ]] ; then
76+
echo present=false
77+
else
78+
echo present=true
79+
fi
80+
81+
- name: Comment diff
82+
if: ${{ github.actor != 'dependabot[bot]' }}
83+
uses: marocchino/sticky-pull-request-comment@v2
84+
with:
85+
header: api-diff
86+
path: ${{ (steps.check-diff.outputs.present == 'true' && 'output/diff.md') || '' }}
87+
message: |
88+
No API changes detected

.github/workflows/sherlock-build.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@ jobs:
115115
quay.io/goswagger/swagger:${GO_SWAGGER_VERSION} \
116116
generate client -f /local/sherlock/docs/swagger.json -A sherlock --default-scheme=https -m client/models -c client
117117
118+
- name: Tidy Go client library dependencies
119+
if: ${{ github.event_name == 'push' }}
120+
working-directory: sherlock-go-client
121+
run: go mod tidy
122+
118123
- name: Generate Typescript client library
119124
if: ${{ github.event_name == 'push' }}
120125
run: |
@@ -215,6 +220,7 @@ jobs:
215220
if: ${{ github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' }}
216221
uses: marocchino/sticky-pull-request-comment@v2
217222
with:
223+
header: image
218224
message: |
219225
Published image from ${{ github.event.pull_request.head.sha }} (merge ${{ github.sha }}):
220226

.github/workflows/sherlock-lint.yaml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,13 @@ jobs:
2424
directory: ["sherlock", "go-shared", "sherlock-webhook-proxy"]
2525
steps:
2626
- uses: actions/checkout@v3
27-
- name: golangci-lint
27+
28+
- name: Set up Go
29+
uses: actions/setup-go@v4
30+
with:
31+
go-version-file: ${{ matrix.directory }}/go.mod
32+
33+
- name: Lint
2834
uses: golangci/golangci-lint-action@v3
2935
with:
3036
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
@@ -39,11 +45,15 @@ jobs:
3945
# Optional: show only new issues if it's a pull request. The default value is `false`.
4046
# only-new-issues: true
4147

42-
# Optional: if set to true then the action will use pre-installed Go.
43-
# skip-go-installation: true
48+
# Optional: if set to true then the all caching functionality will be complete disabled,
49+
# takes precedence over all other caching options.
50+
# skip-cache: true
4451

4552
# Optional: if set to true then the action don't cache or restore ~/go/pkg.
4653
# skip-pkg-cache: true
4754

4855
# Optional: if set to true then the action don't cache or restore ~/.cache/go-build.
4956
# skip-build-cache: true
57+
58+
# Optional:The mode to install golangci-lint. It can be 'binary' or 'goinstall'.
59+
# install-mode: "goinstall"

sherlock-webhook-proxy/go.mod

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,40 +5,29 @@ go 1.19
55
require (
66
github.com/GoogleCloudPlatform/functions-framework-go v1.7.4
77
github.com/broadinstitute/sherlock/sherlock-go-client v0.0.0
8+
github.com/go-openapi/runtime v0.26.0
9+
github.com/go-openapi/strfmt v0.21.7
810
github.com/go-playground/webhooks/v6 v6.1.0
9-
google.golang.org/api v0.114.0
1011

1112
)
1213

1314
replace github.com/broadinstitute/sherlock/sherlock-go-client => ../sherlock-go-client
1415

1516
require (
16-
cloud.google.com/go v0.110.0 // indirect
17-
cloud.google.com/go/compute v1.19.0 // indirect
18-
cloud.google.com/go/compute/metadata v0.2.3 // indirect
1917
cloud.google.com/go/functions v1.13.0 // indirect
20-
cloud.google.com/go/logging v1.7.0 // indirect
21-
cloud.google.com/go/longrunning v0.4.1 // indirect
2218
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
2319
github.com/cloudevents/sdk-go/v2 v2.14.0 // indirect
2420
github.com/go-logr/logr v1.2.3 // indirect
2521
github.com/go-logr/stdr v1.2.2 // indirect
2622
github.com/go-openapi/analysis v0.21.4 // indirect
27-
github.com/go-openapi/errors v0.20.3 // indirect
23+
github.com/go-openapi/errors v0.20.4 // indirect
2824
github.com/go-openapi/jsonpointer v0.19.5 // indirect
2925
github.com/go-openapi/jsonreference v0.20.0 // indirect
3026
github.com/go-openapi/loads v0.21.2 // indirect
31-
github.com/go-openapi/runtime v0.26.0 // indirect
3227
github.com/go-openapi/spec v0.20.8 // indirect
33-
github.com/go-openapi/strfmt v0.21.7 // indirect
34-
github.com/go-openapi/swag v0.22.3 // indirect
28+
github.com/go-openapi/swag v0.22.4 // indirect
3529
github.com/go-openapi/validate v0.22.1 // indirect
36-
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
37-
github.com/golang/protobuf v1.5.3 // indirect
38-
github.com/google/go-cmp v0.5.9 // indirect
3930
github.com/google/uuid v1.3.0 // indirect
40-
github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect
41-
github.com/googleapis/gax-go/v2 v2.7.1 // indirect
4231
github.com/josharian/intern v1.0.0 // indirect
4332
github.com/json-iterator/go v1.1.10 // indirect
4433
github.com/mailru/easyjson v0.7.7 // indirect
@@ -48,21 +37,11 @@ require (
4837
github.com/oklog/ulid v1.3.1 // indirect
4938
github.com/opentracing/opentracing-go v1.2.0 // indirect
5039
go.mongodb.org/mongo-driver v1.11.3 // indirect
51-
go.opencensus.io v0.24.0 // indirect
5240
go.opentelemetry.io/otel v1.14.0 // indirect
5341
go.opentelemetry.io/otel/trace v1.14.0 // indirect
5442
go.uber.org/atomic v1.4.0 // indirect
5543
go.uber.org/multierr v1.1.0 // indirect
5644
go.uber.org/zap v1.10.0 // indirect
57-
golang.org/x/net v0.8.0 // indirect
58-
golang.org/x/oauth2 v0.6.0 // indirect
59-
golang.org/x/sync v0.1.0 // indirect
60-
golang.org/x/sys v0.6.0 // indirect
61-
golang.org/x/text v0.8.0 // indirect
62-
google.golang.org/appengine v1.6.7 // indirect
63-
google.golang.org/genproto v0.0.0-20230323212658-478b75c54725 // indirect
64-
google.golang.org/grpc v1.54.0 // indirect
65-
google.golang.org/protobuf v1.30.0 // indirect
6645
gopkg.in/yaml.v2 v2.4.0 // indirect
6746
gopkg.in/yaml.v3 v3.0.1 // indirect
6847
)

0 commit comments

Comments
 (0)