Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 0 additions & 2 deletions .github/variables/go-versions.env

This file was deleted.

46 changes: 46 additions & 0 deletions .github/workflows/dev-server-ui.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go

name: dev-server UI

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
ci:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'npm'

- name: Install dependencies
run: cd internal/dev_server/ui && npm ci

- name: Run lint
run: cd internal/dev_server/ui && npm run lint

- name: Run Prettier
run: cd internal/dev_server/ui && npm run prettier:write

- name: Run tests
run: cd internal/dev_server/ui && npm test

- name: Run build
run: cd internal/dev_server/ui && npm run build

- name: Check for uncommitted changes
run: |
cd internal/dev_server/ui
git diff --exit-code || (echo 'Error: Uncommitted changes detected after build. Run the build locally and commit the changes.' && exit 1)
49 changes: 0 additions & 49 deletions .github/workflows/go-versions.yml

This file was deleted.

27 changes: 8 additions & 19 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,20 @@ on:
branches: [ "main" ]

jobs:
go-versions:
uses: ./.github/workflows/go-versions.yml

build:
needs: go-versions
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go-version: ${{ fromJSON(needs.go-versions.outputs.matrix )}}

steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}

- name: Enforce formatting / go mod tidy
run: |
./git/hooks/pre-commit

- name: Build
run: go build -o ldcli

- name: Test
run: go test -v ./...
go-version: stable

- uses: actions/setup-python@v3
- uses: pre-commit/[email protected]
- name: build
run: go build .
- name: test
run: go test ./...
5 changes: 0 additions & 5 deletions .github/workflows/manual-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@ jobs:
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ needs.go-versions.outputs.latest }}

- uses: launchdarkly/gh-actions/actions/[email protected]
name: 'Get Docker token'
with:
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@ jobs:
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ needs.go-versions.outputs.latest }}

- uses: launchdarkly/gh-actions/actions/[email protected]
name: 'Get Docker token'
with:
Expand Down Expand Up @@ -88,7 +83,7 @@ jobs:
actions: read
id-token: write
contents: write
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v1.10.0
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v2.0.0
with:
base64-subjects: "${{ needs.release-ldcli.outputs.hashes }}"
upload-assets: true
Expand Down
30 changes: 1 addition & 29 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,41 +1,13 @@
repos:
- repo: https://github.com/golangci/golangci-lint
rev: v1.57.1
rev: v1.63.4
hooks:
- id: golangci-lint
entry: golangci-lint run
exclude: "^(vendor/|.circleci/)"
language: golang
require_serial: true
types: [go]
- repo: [email protected]:launchdarkly/pre-commit-go
rev: v0.11.0
hooks:
- id: compile-go-tests
entry: bin/run-script run-on-dirs "go test ./..."
exclude: "^vendor/|^.circleci/image/tools"
name: run-go-tests
- id: discarded-stacktrace
exclude: '(^vendor/|.*gen\.go)'
- id: go-mod-tidy
- id: go-mod-verify
- id: go-mod-vendor-no-change
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: end-of-file-fixer
exclude: "^vendor"
- repo: local
hooks:
- id: ui-tests
name: Run dev-server UI tests
entry: bash -c 'cd internal/dev_server/ui && npm test'
language: system
files: \.(jsx|tsx)$
pass_filenames: false
- id: ui-build
name: Build dev-server UI
entry: bash -c 'cd internal/dev_server/ui && npm run build'
language: system
files: \.(jsx|tsx)$
pass_filenames: false
6 changes: 3 additions & 3 deletions cmd/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func run(service config.Service) func(*cobra.Command, []string) error {
return newErr(err.Error())
}

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

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

fmt.Fprintf(cmd.OutOrStdout(), output+"\n")
fmt.Fprint(cmd.OutOrStdout(), output+"\n")
default:
return cmd.Help()
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/flags/archive.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func makeArchiveRequest(client resources.Client) func(*cobra.Command, []string)
return errors.NewError(err.Error())
}

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

return nil
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/flags/toggle.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func runE(client resources.Client) func(*cobra.Command, []string) error {
return errors.NewError(err.Error())
}

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

return nil
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/members/invite.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func runE(client resources.Client) func(*cobra.Command, []string) error {
return errors.NewError(err.Error())
}

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

return nil
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/resources/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ func (op *OperationCmd) makeRequest(cmd *cobra.Command, args []string) error {
return errors.NewError(err.Error())
}

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

return nil
}
Expand Down
24 changes: 0 additions & 24 deletions git/hooks/pre-commit

This file was deleted.

2 changes: 1 addition & 1 deletion internal/dev_server/ui/dist/index.html

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions internal/dev_server/ui/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import globals from 'globals';
import pluginJs from '@eslint/js';
import tseslint from 'typescript-eslint';
import pluginReact from 'eslint-plugin-react';

/** @type {import('eslint').Linter.Config[]} */
export default [
{
files: ['**/*.{js,mjs,cjs,ts,jsx,tsx}'],
},
{ languageOptions: { globals: globals.browser } },
pluginJs.configs.recommended,
...tseslint.configs.recommended,
{
...pluginReact.configs.flat.recommended,
rules: {
...pluginReact.configs.flat.recommended.rules,
'react/react-in-jsx-scope': 'off',
},
},
{
ignores: ['**/__mocks__/'],
},
];
Loading
Loading