Skip to content

Commit 5cd5a84

Browse files
Mike Zornhoshsadiq
andauthored
chore: remove vendor dir, fix release action, CI for dev server UI (#502)
* remove vendor dir * Eliminate multiple go builds * actually run pre-commit * set up ssh keys & remove test/build * Remove internal pre-commit * remove extraneous hooks file * update build paths for ui * Add build and test back * eliminate some pre-commit config * use stable go * update golangci * fix lint issues * Remove ui builds from pre-commit * Upgrade release provenance thing * Add ui build * correct directory * add prettier * fixup dirname * set up linting * fix eslint errors * Add eslint config * attempt to ignore mocks * move ignores to end * prettier * rebuild * Use working directory trick Co-authored-by: Hosh <[email protected]> * set working dir correctly * remove extraneous cd --------- Co-authored-by: Hosh <[email protected]>
1 parent 68062e1 commit 5cd5a84

File tree

3,012 files changed

+2328
-1131496
lines changed

Some content is hidden

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

3,012 files changed

+2328
-1131496
lines changed

.github/variables/go-versions.env

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# This workflow will build a golang project
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
3+
4+
name: dev-server UI
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
pull_request:
11+
branches:
12+
- main
13+
14+
jobs:
15+
ci:
16+
runs-on: ubuntu-latest
17+
defaults:
18+
run:
19+
working-directory: internal/dev_server/ui
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
24+
- name: Setup Node.js
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: 'lts/*'
28+
cache: 'npm'
29+
30+
- name: Install dependencies
31+
run: npm ci
32+
33+
- name: Run lint
34+
run: npm run lint
35+
36+
- name: Run Prettier
37+
run: npm run prettier:write
38+
39+
- name: Run tests
40+
run: npm test
41+
42+
- name: Run build
43+
run: npm run build
44+
45+
- name: Check for uncommitted changes
46+
run: |
47+
git diff --exit-code || (echo 'Error: Uncommitted changes detected after build. Run the build locally and commit the changes.' && exit 1)

.github/workflows/go-versions.yml

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

.github/workflows/go.yml

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,20 @@ on:
1010
branches: [ "main" ]
1111

1212
jobs:
13-
go-versions:
14-
uses: ./.github/workflows/go-versions.yml
15-
1613
build:
17-
needs: go-versions
1814
runs-on: ubuntu-latest
19-
strategy:
20-
fail-fast: false
21-
matrix:
22-
go-version: ${{ fromJSON(needs.go-versions.outputs.matrix )}}
2315

2416
steps:
2517
- uses: actions/checkout@v4
2618

2719
- name: Set up Go
2820
uses: actions/setup-go@v4
2921
with:
30-
go-version: ${{ matrix.go-version }}
31-
32-
- name: Enforce formatting / go mod tidy
33-
run: |
34-
./git/hooks/pre-commit
35-
36-
- name: Build
37-
run: go build -o ldcli
38-
39-
- name: Test
40-
run: go test -v ./...
22+
go-version: stable
23+
24+
- uses: actions/setup-python@v3
25+
- uses: pre-commit/[email protected]
26+
- name: build
27+
run: go build .
28+
- name: test
29+
run: go test ./...

.github/workflows/manual-publish.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@ jobs:
3535
with:
3636
fetch-depth: 0
3737

38-
- name: Set up Go
39-
uses: actions/setup-go@v4
40-
with:
41-
go-version: ${{ needs.go-versions.outputs.latest }}
42-
4338
- uses: launchdarkly/gh-actions/actions/[email protected]
4439
name: 'Get Docker token'
4540
with:

.github/workflows/release-please.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,6 @@ jobs:
3737
with:
3838
fetch-depth: 0
3939

40-
- name: Set up Go
41-
uses: actions/setup-go@v4
42-
with:
43-
go-version: ${{ needs.go-versions.outputs.latest }}
44-
4540
- uses: launchdarkly/gh-actions/actions/[email protected]
4641
name: 'Get Docker token'
4742
with:
@@ -88,7 +83,7 @@ jobs:
8883
actions: read
8984
id-token: write
9085
contents: write
91-
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v1.10.0
86+
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v2.0.0
9287
with:
9388
base64-subjects: "${{ needs.release-ldcli.outputs.hashes }}"
9489
upload-assets: true

.pre-commit-config.yaml

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,13 @@
11
repos:
22
- repo: https://github.com/golangci/golangci-lint
3-
rev: v1.57.1
3+
rev: v1.63.4
44
hooks:
55
- id: golangci-lint
66
entry: golangci-lint run
7-
exclude: "^(vendor/|.circleci/)"
87
language: golang
98
require_serial: true
109
types: [go]
11-
- repo: [email protected]:launchdarkly/pre-commit-go
12-
rev: v0.11.0
13-
hooks:
14-
- id: compile-go-tests
15-
entry: bin/run-script run-on-dirs "go test ./..."
16-
exclude: "^vendor/|^.circleci/image/tools"
17-
name: run-go-tests
18-
- id: discarded-stacktrace
19-
exclude: '(^vendor/|.*gen\.go)'
20-
- id: go-mod-tidy
21-
- id: go-mod-verify
22-
- id: go-mod-vendor-no-change
2310
- repo: https://github.com/pre-commit/pre-commit-hooks
2411
rev: v4.6.0
2512
hooks:
2613
- id: end-of-file-fixer
27-
exclude: "^vendor"
28-
- repo: local
29-
hooks:
30-
- id: ui-tests
31-
name: Run dev-server UI tests
32-
entry: bash -c 'cd internal/dev_server/ui && npm test'
33-
language: system
34-
files: \.(jsx|tsx)$
35-
pass_filenames: false
36-
- id: ui-build
37-
name: Build dev-server UI
38-
entry: bash -c 'cd internal/dev_server/ui && npm run build'
39-
language: system
40-
files: \.(jsx|tsx)$
41-
pass_filenames: false

cmd/config/config.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ func run(service config.Service) func(*cobra.Command, []string) error {
117117
return newErr(err.Error())
118118
}
119119

120-
fmt.Fprintf(cmd.OutOrStdout(), output+"\n")
120+
fmt.Fprint(cmd.OutOrStdout(), output+"\n")
121121
case viper.GetBool(SetFlag):
122122
conf, err := config.New(viper.ConfigFileUsed(), os.ReadFile)
123123
if err != nil {
@@ -146,7 +146,7 @@ func run(service config.Service) func(*cobra.Command, []string) error {
146146
return newErr(err.Error())
147147
}
148148

149-
fmt.Fprintf(cmd.OutOrStdout(), output+"\n")
149+
fmt.Fprint(cmd.OutOrStdout(), output+"\n")
150150
case viper.IsSet(UnsetFlag):
151151
conf, err := config.New(viper.ConfigFileUsed(), os.ReadFile)
152152
if err != nil {
@@ -166,7 +166,7 @@ func run(service config.Service) func(*cobra.Command, []string) error {
166166
return newErr(err.Error())
167167
}
168168

169-
fmt.Fprintf(cmd.OutOrStdout(), output+"\n")
169+
fmt.Fprint(cmd.OutOrStdout(), output+"\n")
170170
default:
171171
return cmd.Help()
172172
}

cmd/flags/archive.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func makeArchiveRequest(client resources.Client) func(*cobra.Command, []string)
5656
return errors.NewError(err.Error())
5757
}
5858

59-
fmt.Fprintf(cmd.OutOrStdout(), output+"\n")
59+
fmt.Fprint(cmd.OutOrStdout(), output+"\n")
6060

6161
return nil
6262
}

cmd/flags/toggle.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func runE(client resources.Client) func(*cobra.Command, []string) error {
7878
return errors.NewError(err.Error())
7979
}
8080

81-
fmt.Fprintf(cmd.OutOrStdout(), output+"\n")
81+
fmt.Fprint(cmd.OutOrStdout(), output+"\n")
8282

8383
return nil
8484
}

0 commit comments

Comments
 (0)