Skip to content

Commit 5441dec

Browse files
committed
feat: http server & telemetry support
1 parent 95532d0 commit 5441dec

28 files changed

+3569
-0
lines changed

Diff for: .github/ISSUE_TEMPLATE/bug_report.md

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Desktop (please complete the following information):**
27+
- OS: [e.g. iOS]
28+
- Browser [e.g. chrome, safari]
29+
- Version [e.g. 22]
30+
31+
**Smartphone (please complete the following information):**
32+
- Device: [e.g. iPhone6]
33+
- OS: [e.g. iOS8.1]
34+
- Browser [e.g. stock browser, safari]
35+
- Version [e.g. 22]
36+
37+
**Additional context**
38+
Add any other context about the problem here.

Diff for: .github/ISSUE_TEMPLATE/feature_request.md

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

Diff for: .github/workflows/lint.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Lint
2+
on: [ push, pull_request, workflow_dispatch ]
3+
4+
jobs:
5+
golangci-lint:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/setup-go@v2
9+
with:
10+
go-version: "1.18"
11+
- uses: actions/checkout@v2
12+
with:
13+
fetch-depth: 0
14+
- name: golangci-lint
15+
uses: golangci/golangci-lint-action@v2
16+
with:
17+
skip-go-installation: true
18+
version: v1.46.2
19+
args: --timeout=10m

Diff for: .github/workflows/release.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Release
2+
on:
3+
push:
4+
tags:
5+
- "v*.*.*"
6+
7+
jobs:
8+
release:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v2
13+
with:
14+
fetch-depth: 0
15+
- uses: actions/setup-go@v2
16+
with:
17+
go-version: "1.18"
18+
- name: Login to DockerHub
19+
uses: docker/login-action@v1
20+
with:
21+
username: ${{ secrets.DOCKERHUB_USERNAME }}
22+
password: ${{ secrets.DOCKERHUB_TOKEN }}
23+
- name: Run GoReleaser
24+
uses: goreleaser/[email protected]
25+
with:
26+
distribution: goreleaser
27+
version: latest
28+
args: --rm-dist
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GO_RELEASER_TOKEN }}

Diff for: .github/workflows/test.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Test
2+
on: [push, pull_request, workflow_dispatch]
3+
4+
jobs:
5+
test:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v2
9+
- uses: actions/setup-go@v2
10+
with:
11+
go-version: "1.18"
12+
- name: run tests
13+
run: make test

Diff for: .gitignore

+11
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,14 @@
1313

1414
# Dependency directories (remove the comment below to include it)
1515
# vendor/
16+
17+
dist/
18+
coverage/
19+
config.yaml
20+
.vscode
21+
.air.toml
22+
.idea/
23+
tmp/
24+
25+
expt/
26+
requests.http

Diff for: .golangci.yml

+147
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
run:
2+
go: '1.17'
3+
timeout: 10m
4+
skip-files:
5+
- expt/main.go
6+
7+
output:
8+
format: colored-line-number
9+
10+
linters:
11+
enable-all: true
12+
disable:
13+
- exhaustruct
14+
- cyclop
15+
- exhaustive
16+
- exhaustivestruct
17+
- exhaustruct
18+
- funlen
19+
- gochecknoglobals
20+
- gocyclo
21+
- godox
22+
- gofumpt
23+
- golint
24+
- interfacer
25+
- lll
26+
- maintidx
27+
- ireturn
28+
- maligned
29+
- nlreturn
30+
- nolintlint
31+
- prealloc
32+
- promlinter
33+
- scopelint
34+
- tagliatelle
35+
- testpackage
36+
- paralleltest
37+
- tparallel
38+
- containedctx
39+
- varnamelen
40+
- wrapcheck
41+
- wsl
42+
43+
linters-settings:
44+
decorder:
45+
dec-order:
46+
- type
47+
- const
48+
- var
49+
- func
50+
disable-dec-order-check: false
51+
disable-init-func-first-check: false
52+
dupl:
53+
threshold: 100
54+
errcheck: # Report about not checking of errors in type assertions: `a := b.(MyStruct)`.
55+
check-type-assertions: true
56+
goconst:
57+
min-len: 2 # Minimal length of string constant.
58+
min-occurrences: 2 # Minimum occurrences of constant string count to trigger issue.
59+
ignore-tests: true
60+
match-constant: false # Look for existing constants matching the values.
61+
numbers: true # Search also for duplicated numbers.
62+
min: 2 # Minimum value, only works with goconst.numbers
63+
max: 2 # Maximum value, only works with goconst.numbers
64+
revive:
65+
ignore-generated-header: true
66+
severity: warning
67+
confidence: 0.8
68+
rules:
69+
- name: atomic
70+
- name: context-as-argument
71+
- name: context-keys-type
72+
- name: defer
73+
- name: dot-imports
74+
- name: empty-block
75+
- name: error-naming
76+
- name: error-return
77+
- name: error-strings
78+
- name: errorf
79+
- name: increment-decrement
80+
- name: modifies-parameter
81+
- name: modifies-value-receiver
82+
- name: package-comments
83+
- name: range
84+
- name: receiver-naming
85+
- name: redefines-builtin-id
86+
- name: superfluous-else
87+
- name: time-naming
88+
- name: unreachable-code
89+
- name: unused-parameter
90+
- name: unused-receiver
91+
- name: var-declaration
92+
- name: var-naming
93+
gomnd:
94+
ignored-numbers:
95+
- '0o600'
96+
- '0o644'
97+
- '0o655'
98+
- '0o666'
99+
- '0o770'
100+
- '0o755'
101+
- '0o765'
102+
- '0o777'
103+
ignored-functions:
104+
- 'args.Error'
105+
- 'strconv.ParseInt'
106+
gosimple:
107+
go: "1.17"
108+
checks:
109+
- "all"
110+
staticcheck:
111+
go: "1.17"
112+
checks:
113+
- "all"
114+
goimports:
115+
local-prefixes: github.com/odpf/dex
116+
gci:
117+
sections:
118+
- standard # Captures all standard packages if they do not match another section.
119+
- default # Contains all imports that could not be matched to another section type.
120+
- prefix(github.com/odpf/dex) # Groups all imports with the specified Prefix.
121+
gocritic:
122+
disabled-checks:
123+
- ifElseChain
124+
- singleCaseSwitch
125+
enabled-tags:
126+
- diagnostic
127+
# - style
128+
# - opinionated
129+
# - performance
130+
unparam:
131+
# Inspect exported functions.
132+
# XXX: if you enable this setting, unparam will report a lot of false-positives in text editors:
133+
check-exported: true
134+
135+
issues:
136+
exclude-rules:
137+
# Exclude some linters from running on tests files.
138+
- path: _test\.go
139+
linters:
140+
- gocritic
141+
- dupl
142+
- path: cli
143+
linters:
144+
- forbidigo
145+
- contextcheck
146+
severity:
147+
default-severity: error

Diff for: .goreleaser.yml

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
project_name: dex
2+
3+
release:
4+
prerelease: auto
5+
draft: true
6+
7+
builds:
8+
- main: ./main.go
9+
id: "dex"
10+
binary: dex
11+
flags: [ -a ]
12+
ldflags:
13+
- -X github.com/odpf/dex/pkg/version.Version={{.Tag}}
14+
- -X github.com/odpf/dex/pkg/version.Commit={{.FullCommit}}
15+
- -X github.com/odpf/dex/pkg/version.BuildTime={{.Date}}
16+
goos:
17+
- darwin
18+
- linux
19+
- windows
20+
goarch:
21+
- amd64
22+
- arm64
23+
env:
24+
- CGO_ENABLED=0
25+
26+
archives:
27+
- replacements:
28+
darwin: macos
29+
linux: linux
30+
windows: windows
31+
386: i386
32+
amd64: x86_64
33+
format_overrides:
34+
- goos: windows
35+
format: zip
36+
37+
checksum:
38+
name_template: 'checksums.txt'
39+
40+
snapshot:
41+
name_template: "{{ .Version }}-next"
42+
43+
changelog:
44+
sort: asc
45+
filters:
46+
exclude:
47+
- '^docs'
48+
- '^test'
49+
- '^build'
50+
- '^ci'
51+
- '^chore'
52+
- '^refactor'
53+
54+
dockers:
55+
- goos: linux
56+
goarch: amd64
57+
ids:
58+
- dex
59+
dockerfile: Dockerfile
60+
image_templates:
61+
- 'docker.io/odpf/{{.ProjectName}}:latest'
62+
- 'docker.io/odpf/{{.ProjectName}}:{{ .Version }}'
63+
- 'docker.io/odpf/{{.ProjectName}}:{{ .Version }}-amd64'
64+
65+
brews:
66+
- name: dex
67+
homepage: "https://github.com/odpf/dex"
68+
description: "Infrastructure orchestration tool."
69+
tap:
70+
owner: odpf
71+
name: homebrew-tap
72+
license: "Apache 2.0"
73+
folder: Formula
74+
dependencies:
75+
- name: git
76+
install: |-
77+
bin.install "dex"
78+
commit_author:
79+
name: Shivaprasad Bhat
80+

Diff for: Dockerfile

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM alpine:3.13
2+
3+
COPY dex /usr/bin/dex
4+
5+
RUN apk --no-cache add ca-certificates bash
6+
RUN GRPC_HEALTH_PROBE_VERSION=v0.4.5 && \
7+
wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \
8+
chmod +x /bin/grpc_health_probe
9+
10+
CMD ["dex"]

0 commit comments

Comments
 (0)