Skip to content

Commit

Permalink
Merge pull request #531 from moul/dev/moul/small-fixes
Browse files Browse the repository at this point in the history
chore: small fixes
  • Loading branch information
moul committed Jul 23, 2022
2 parents f352cb9 + c5f4c7a commit 3d336c3
Show file tree
Hide file tree
Showing 36 changed files with 40,370 additions and 19,081 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Dockerfile
dist/
vendor/
web/node_modules/
tool/lint/node_modules/
.dockerignore
13 changes: 6 additions & 7 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
goreleaser-dryrun:
strategy:
matrix:
golang: [1.16.x]
golang: [1.18.x]
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -55,7 +55,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
golangci_lint: [v1.38]
golangci_lint: [v1.47]
steps:
- uses: actions/checkout@v2.3.4
- name: golangci-lint
Expand All @@ -71,7 +71,7 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
golang: [1.16.x]
golang: [1.18.x]
steps:
- uses: actions/checkout@v2.3.4
- name: Install Go
Expand All @@ -86,7 +86,7 @@ jobs:
runs-on: macos-latest
strategy:
matrix:
golang: [1.16.x]
golang: [1.18.x]
env:
OS: macos-latest
GOLANG: ${{ matrix.golang }}
Expand Down Expand Up @@ -125,9 +125,8 @@ jobs:
strategy:
matrix:
golang:
- 1.14.x
- 1.15.x
- 1.16.x
- 1.17.x
- 1.18.x
env:
OS: ubuntu-latest
GOLANG: ${{ matrix.golang }}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ jobs:
with:
files: .
config_file: ./tool/lint/.markdownlint.json
- uses: K-Phoen/action-misspell@master
with:
github_token: ${{ github.token }}
reporter: github-pr-review
locale: "US"
#- uses: K-Phoen/action-misspell@master
# with:
# github_token: ${{ github.token }}
# reporter: github-pr-review
# locale: "US"
- name: alexjs
uses: theashraf/alex-action@master
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
golang: [1.16.x]
golang: [1.18.x]
steps:
-
name: Checkout
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
gen.sum.tmp
coverage.txt
/dist/
.DS_Store
Expand Down
9 changes: 4 additions & 5 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ run:
- ".*\\.gen\\.go"

linters-settings:
golint:
min-confidence: 0
maligned:
suggest-new: true
goconst:
Expand Down Expand Up @@ -40,22 +38,23 @@ linters:
- gofmt
- gofumpt
- goimports
- golint
#- golint
- gomnd
- gomodguard
- gosec
- gosimple
- govet
- ineffassign
- interfacer
#- interfacer
#- maligned
- misspell
- nakedret
- nestif
- noctx
- nolintlint
- prealloc
- scopelint
- revive
- exportloopref
- sqlclosecheck
- staticcheck
- structcheck
Expand Down
3 changes: 3 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ builds:
-
goos: darwin
goarch: 386
-
goos: windows
goarch: arm64
flags:
- "-a"
ldflags:
Expand Down
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ ARG VERSION


# web build
FROM node:10 as web-build
FROM node:14 as web-build
RUN npm i -g npm@8
WORKDIR /app
COPY ./web/package*.json ./web/yarn.* ./
RUN npm install
RUN npm install --force
COPY ./web/ ./
RUN npm run build


# go build
FROM golang:1.16.5-alpine as go-build
FROM golang:1.18-alpine as go-build
RUN apk add --update --no-cache git gcc musl-dev make
RUN GO111MODULE=off go get github.com/gobuffalo/packr/v2/packr2
WORKDIR /go/src/moul.io/depviz
ENV GO111MODULE=on \
GOPROXY=proxy.golang.org
Expand All @@ -30,7 +30,7 @@ RUN make install


# minimalist runtime
FROM alpine:3.13.5
FROM alpine:3.16
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.name="depviz" \
org.label-schema.description="" \
Expand Down
37 changes: 19 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
GOPKG ?= moul.io/depviz
GOPKG ?= moul.io/depviz
GOBINS = ./cmd/depviz
#GOBINS += ./tools/opml-to-github-issues
#GOBINS += ./tools/sed-i-github-issues
Expand Down Expand Up @@ -32,41 +32,43 @@ update_examples:


PROTOS_SRC := $(wildcard ./api/*.proto) $(wildcard ./api/internal/*.proto)
GEN_DEPS := $(PROTOS_SRC) Makefile
GEN_DEPS := $(PROTOS_SRC) Makefile go.sum
.PHONY: generate
generate: gen.sum
gen.sum: $(GEN_DEPS)
shasum $(GEN_DEPS) | sort > gen.sum.tmp
@diff -q gen.sum gen.sum.tmp || ( \
set -xe; \
GO111MODULE=on go mod vendor; \
docker run \
--user=`id -u` \
--volume="$(PWD):/go/src/moul.io/depviz" \
--workdir="/go/src/moul.io/depviz" \
--entrypoint="sh" \
--rm \
moul/depviz-protoc:1 \
-xec 'make generate_local'; \
make tidy \
--user=`id -u` \
--volume="`go env GOPATH`/pkg/mod:/go/pkg/mod" \
--volume="$(PWD):/go/src/moul.io/depviz" \
--workdir="/go/src/moul.io/depviz" \
--entrypoint="sh" \
--rm \
moul/depviz-protoc:2 \
-xec 'make generate_local'; \
make tidy \
)
@rm -f gen.sum.tmp


PROTOC_OPTS = -I ./vendor/github.com/grpc-ecosystem/grpc-gateway:./api:./vendor:/protobuf
#PROTOC_OPTS = -I `go list -m -mod=mod -f "{{.Dir}}" github.com/grpc-ecosystem/grpc-gateway`:`go list -m -mod=mod -f {{.Dir}} github.com/gogo/protobuf`/protobuf:`go list -m -mod=mod -f {{.Dir}} github.com/golang/protobuf`:./api:/protobuf
PROTOC_OPTS = -I `go list -m -mod=mod -f "{{.Dir}}" github.com/grpc-ecosystem/grpc-gateway`:./api:/protobuf
.PHONY: generate_local
generate_local:
go mod download
@set -e; for proto in $(PROTOS_SRC); do ( set -xe; \
protoc $(PROTOC_OPTS) \
--grpc-gateway_out=logtostderr=true:"$(GOPATH)/src" \
--gogofaster_out="plugins=grpc:$(GOPATH)/src" \
"$$proto" \
--grpc-gateway_out=logtostderr=true:"$(GOPATH)/src" \
--gogofaster_out="plugins=grpc:$(GOPATH)/src" \
"$$proto" \
); done
@# CUSTOM CHANGE
@# due to go module versionning (currently) incompatible with automatic protobuf generated imports
sed -i s@moul.io/depviz/@moul.io/depviz/v3/@g internal/dvserver/dvserver.pb.go
@# END OF CUSTOM CHANGE
goimports -w ./pkg ./cmd ./internal
go run golang.org/x/tools/cmd/goimports -w ./pkg ./cmd ./internal
shasum $(GEN_DEPS) | sort > gen.sum.tmp
mv gen.sum.tmp gen.sum

Expand All @@ -78,5 +80,4 @@ clean:

.PHONY: packr
packr:
GO111MODULE=off go get github.com/gobuffalo/packr/v2/packr2
cd internal/dvserver && packr2 && ls -la *-packr.go packrd/packed-packr.go
cd internal/dvserver && go run github.com/gobuffalo/packr/v2/packr2 build && ls -la *-packr.go packrd/packed-packr.go
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ _Limited to the following repos: [moul/depviz](https://github.com/moul/depviz),

## Supported providers

*Depviz* aggregates the entities of multiple providers into 3 generic ones.
_Depviz_ aggregates the entities of multiple providers into 3 generic ones.

---

Expand All @@ -64,9 +64,9 @@ Supported providers:
* Task: Issue, Pull Request, Milestone
* Owner: TODO
* Topic: TODO
* GitLab: *(planned)*
* Jira *(planned)*
* Trello *(planned)*
* GitLab: _(planned)_
* Jira _(planned)_
* Trello _(planned)_

TODO: detailed mapping table

Expand Down
2 changes: 1 addition & 1 deletion api/dvmodel.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package depviz.model;

import "github.com/golang/protobuf/ptypes/timestamp/timestamp.proto";
import "google/protobuf/timestamp.proto";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";

option go_package = "moul.io/depviz/internal/dvmodel";
Expand Down
2 changes: 1 addition & 1 deletion api/dvserver.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package depviz.server;

import "google/api/annotations.proto";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
import "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options/annotations.proto";
//import "protoc-gen-swagger/options/annotations.proto";

import "dvmodel.proto";

Expand Down
7 changes: 4 additions & 3 deletions gen.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

61 changes: 46 additions & 15 deletions go.mod

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/dvcore/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/cayleygraph/cayley/graph"
"github.com/cayleygraph/cayley/schema"
"go.uber.org/zap"
"gopkg.in/yaml.v2"
yaml "gopkg.in/yaml.v2"
"moul.io/depviz/v3/internal/dvmodel"
"moul.io/depviz/v3/internal/dvparser"
"moul.io/depviz/v3/internal/dvstore"
Expand Down
Loading

0 comments on commit 3d336c3

Please sign in to comment.