Skip to content

Commit

Permalink
Merge branch 'develop' into feature/correct-cost-for-s3
Browse files Browse the repository at this point in the history
  • Loading branch information
bishal7679 authored Oct 9, 2023
2 parents 334e804 + 3356762 commit f2da0a3
Show file tree
Hide file tree
Showing 24 changed files with 448 additions and 263 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Lint
on:
push:

jobs:
lint:
name: golangci-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup go
uses: actions/setup-go@v4
with:
go-version-file: go.mod
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
args: --timeout=10m
version: v1.54.2
214 changes: 103 additions & 111 deletions README.md

Large diffs are not rendered by default.

125 changes: 46 additions & 79 deletions dashboard/package-lock.json

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

2 changes: 1 addition & 1 deletion dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"cytoscape-cose-bilkent": "^4.1.0",
"cytoscape-node-html-label": "^1.2.2",
"cytoscape-popper": "^2.0.0",
"next": "^13.5.3",
"next": "^13.5.4",
"next-transpile-modules": "^10.0.1",
"react": "18.2.0",
"react-chartjs-2": "^5.2.0",
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ require (
golang.org/x/tools v0.6.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230330154414-c0448cd141ea
google.golang.org/genproto v0.0.0-20230330154414-c0448cd141ea // indirect
google.golang.org/grpc v1.54.0 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
Expand Down
2 changes: 1 addition & 1 deletion handlers/feedback_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (handler *ApiHandler) NewFeedbackHandler(c *gin.Context) {
]
}`, description, email)

payloadField.Write([]byte(payloadJSON))
_, _ = payloadField.Write([]byte(payloadJSON))

imagePart, err := writer.CreateFormFile("files[0]", filepath.Base("temp-image"))
if err != nil {
Expand Down
3 changes: 1 addition & 2 deletions internal/api/v1/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ import (
"compress/gzip"
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
"strings"
Expand Down Expand Up @@ -3013,7 +3012,7 @@ func RestoreAsset(dir, name string) error {
if err != nil {
return err
}
err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode())
err = os.WriteFile(_filePath(dir, name), data, info.Mode())
if err != nil {
return err
}
Expand Down
5 changes: 2 additions & 3 deletions internal/config/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"errors"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
Expand Down Expand Up @@ -46,7 +45,7 @@ func loadConfigFromFile(path string) (*Config, error) {
return nil, fmt.Errorf("no such file %s", filename)
}

yamlFile, err := ioutil.ReadFile(filename)
yamlFile, err := os.ReadFile(filename)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -436,7 +435,7 @@ func Load(configPath string, telemetry bool, analytics utils.Analytics, db *bun.

accounts = append(accounts, cloudAccount)

data, err := ioutil.ReadFile(account.ServiceAccountKeyPath)
data, err := os.ReadFile(account.ServiceAccountKeyPath)
if err != nil {
log.Fatal(err)
}
Expand Down
2 changes: 1 addition & 1 deletion migrations/20230413100000_set_default_tags_in_resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ func init() {
// Set default value for tags in resources table, because sometimes it was 'null'
// The Resources model was updated to set the default value to []string{}, but all older instances
// of Komiser didn't have that default value set, so we need to update the database
db.NewUpdate().
_, _ = db.NewUpdate().
Table("resources").
Set("tags = ?", []string{}).
Where("tags = 'null'").
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ func init() {
`)

if err != nil {
db.ExecContext(ctx, `
_, _ = db.ExecContext(ctx, `
ALTER TABLE alerts
ADD COLUMN is_slack BOOLEAN DEFAULT 1;
`)

db.ExecContext(ctx, `
_, _ = db.ExecContext(ctx, `
ALTER TABLE alerts
ADD COLUMN endpoint TEXT;
`)

db.ExecContext(ctx, `
_, _ = db.ExecContext(ctx, `
ALTER TABLE alerts
ADD COLUMN secret TEXT;
`)
Expand Down
4 changes: 2 additions & 2 deletions migrations/20230619100000_add_new_relation_field.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ func init() {
Migrations.MustRegister(func(ctx context.Context, db *bun.DB) error {
// adding new column relation for migration
if db.Dialect().Name() == dialect.SQLite {
db.ExecContext(ctx, "ALTER TABLE resources ADD COLUMN relations TEXT DEFAULT '[]';")
_, _ = db.ExecContext(ctx, "ALTER TABLE resources ADD COLUMN relations TEXT DEFAULT '[]';")
} else {
db.ExecContext(ctx, "ALTER TABLE resources ADD COLUMN relations JSONB DEFAULT '[]'::jsonb;")
_, _ = db.ExecContext(ctx, "ALTER TABLE resources ADD COLUMN relations JSONB DEFAULT '[]'::jsonb;")
}
return nil
}, func(ctx context.Context, db *bun.DB) error {
Expand Down
2 changes: 1 addition & 1 deletion migrations/20231014100000_add_new_status_field.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
func init() {
Migrations.MustRegister(func(ctx context.Context, db *bun.DB) error {
// adding new column relation for migration
db.ExecContext(ctx, "ALTER TABLE accounts ADD COLUMN status TEXT;")
_, _ = db.ExecContext(ctx, "ALTER TABLE accounts ADD COLUMN status TEXT;")
return nil
}, func(ctx context.Context, db *bun.DB) error {
// No rollback needed
Expand Down
Loading

0 comments on commit f2da0a3

Please sign in to comment.