Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spellcheck "server/*" #3753

Merged
merged 12 commits into from
Jun 4, 2024
104 changes: 61 additions & 43 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,142 +12,161 @@
],
"words": [
"abool",
"BUILDPLATFORM",
"Codeberg",
"Curr",
"DATASOURCE",
"Debugf",
"Fediverse",
"Fogas",
"GOARCH",
"GOBIN",
"GODEBUG",
"GOPATH",
"Georgiana",
"HEALTHCHECK",
"HTTPFS",
"Hetzner",
"Infof",
"Ionescu",
"Kaniko",
"Keyfunc",
"LASTEXITCODE",
"Laszlo",
"Msgf",
"Netrc",
"PROTOC",
"Pinia",
"Println",
"pwsh",
"Refspec",
"Reviewdog",
"Rydzewski",
"SSHURL",
"TARGETARCH",
"TARGETOS",
"Typeflag",
"Upsert",
"WORKDIR",
"Warnf",
"Weblate",
"Wrapf",
"anbraten",
"apimachinery",
"autoincr",
"autoscaler",
"binutils",
"bitbucketdatacenter",
"Boguslawski",
"bradrydzewski",
"BUILDPLATFORM",
"buildx",
"ccmenu",
"certmagic",
"charmbracelet",
"ciphertext",
"Codeberg",
"compatiblelicenses",
"corepack",
"cpuset",
"creativecommons",
"Curr",
"datacenter",
"DATASOURCE",
"Debugf",
"desaturate",
"devx",
"doublestar",
"envsubst",
"estree",
"errgroup",
"estree",
"evenodd",
"excalidraw",
"favicons",
"Fediverse",
"Fogas",
"forbidigo",
"Forgejo",
"fsnotify",
"Georgiana",
"gitea",
"GOARCH",
"GOBIN",
"gocritic",
"GODEBUG",
"golangci",
"gomod",
"gonic",
"GOPATH",
"HEALTHCHECK",
"healthz",
"Hetzner",
"HTMLURL",
"HTTPFS",
"httpsig",
"HTTPURL",
"httputil",
"iconify",
"Infof",
"Informatyka",
"intlify",
"Ionescu",
"Kaniko",
"Keyfunc",
"kyvg",
"LASTEXITCODE",
"Laszlo",
"laszlocph",
"logfile",
"loglevel",
"LONGBLOB",
"LONGTEXT",
"mapstructure",
"markdownlint",
"memswap",
"Metas",
"mhmxs",
"moby",
"Msgf",
"multiarch",
"multierr",
"netdns",
"Netrc",
"nfpm",
"nixos",
"nocolor",
"nolint",
"norunningpipelines",
"nosniff",
"octocat",
"Pinia",
"pkce",
"posix",
"ppid",
"Println",
"prismjs",
"proto",
"protobuf",
"protoc",
"PROTOC",
"protoimpl",
"protoreflect",
"rawurl",
"pullrequest",
"pullrequests",
"pwsh",
"Redirections",
"Refspec",
"regcred",
"repology",
"reslimit",
"Reviewdog",
"riscv",
"rundll32",
"Rydzewski",
"seccomp",
"secprofile",
"securecookie",
"sess",
"shellescape",
"SSHURL",
"stepbuilder",
"stretchr",
"sublicensable",
"swaggo",
"TARGETARCH",
"TARGETOS",
"techknowlogick",
"testdata",
"threadcreate",
"tink",
"tinycolor",
"tmpfs",
"tmpl",
"tolerations",
"ttlcache",
"typecheck",
"Typeflag",
"unplugin",
"Upsert",
"urfave",
"varchar",
"varz",
"vueuse",
"waivable",
"Warnf",
"Weblate",
"windi",
"windicss",
"woodpeckerci",
"WORKDIR",
"Wrapf",
"xlink",
"xlog",
"xorm",
"xormigrate",
"xyaml",
"yamls",
"zerolog",
"zerologger"
],
Expand Down Expand Up @@ -175,8 +194,7 @@
"**/fixtures/**",
"**/testdata/**",
// TODO: remove the following
"docs/",
"server/"
"docs/"
],
// Exclude imports, because they are also strings.
"ignoreRegExpList": [
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ test-server-datastore: ## Test server datastore
go test -race -timeout 30s -skip TestMigrate go.woodpecker-ci.org/woodpecker/v2/server/store/...

test-server-datastore-coverage: ## Test server datastore with coverage report
go test -race -cover -coverprofile datastore-coverage.out -timeout 120s go.woodpecker-ci.org/woodpecker/v2/server/store/...
go test -race -cover -coverprofile datastore-coverage.out -timeout 180s go.woodpecker-ci.org/woodpecker/v2/server/store/...

test-ui: ui-dependencies ## Test UI code
(cd web/; pnpm run lint)
Expand Down
4 changes: 2 additions & 2 deletions cmd/agent/core/health.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ import (
// https://github.com/mozilla-services/Dockerflow

func initHealth() {
http.HandleFunc("/varz", handleStats) // cspell:words varz
http.HandleFunc("/healthz", handleHeartbeat) // cspell:words healthz
http.HandleFunc("/varz", handleStats)
http.HandleFunc("/healthz", handleHeartbeat)
http.HandleFunc("/version", handleVersion)
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/server/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ const docTemplate = `{
},
{
"type": "string",
"description": "the organziation's id",
"description": "the organization's id",
"name": "org_id",
"in": "path",
"required": true
Expand Down Expand Up @@ -913,7 +913,7 @@ const docTemplate = `{
},
{
"type": "string",
"description": "the organziation's id",
"description": "the organization's id",
"name": "org_id",
"in": "path",
"required": true
Expand Down
12 changes: 6 additions & 6 deletions cmd/server/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var flags = append([]cli.Flag{
&cli.StringFlag{
EnvVars: []string{"WOODPECKER_HOST"},
Name: "server-host",
Usage: "server fully qualified url. Format: <scheme>://<host>[/<prefixpath>]",
Usage: "server fully qualified url. Format: <scheme>://<host>[/<prefix path>]",
},
&cli.StringFlag{
EnvVars: []string{"WOODPECKER_SERVER_ADDR"},
Expand Down Expand Up @@ -114,7 +114,7 @@ var flags = append([]cli.Flag{
&cli.StringSliceFlag{
EnvVars: []string{"WOODPECKER_REPO_OWNERS"},
Name: "repo-owners",
Usage: "List of syncable repo owners",
Usage: "Repositories by those owners will be allowed to be used in woodpecker",
},
&cli.BoolFlag{
EnvVars: []string{"WOODPECKER_OPEN"},
Expand Down Expand Up @@ -277,7 +277,7 @@ var flags = append([]cli.Flag{
&cli.Int64Flag{
EnvVars: []string{"WOODPECKER_LIMIT_MEM_SWAP"},
Name: "limit-mem-swap",
Usage: "maximum swappable memory allowed in bytes",
Usage: "maximum memory used for swap in bytes",
},
&cli.Int64Flag{
EnvVars: []string{"WOODPECKER_LIMIT_MEM"},
Expand Down Expand Up @@ -330,7 +330,7 @@ var flags = append([]cli.Flag{
&cli.StringFlag{
EnvVars: []string{"WOODPECKER_EXPERT_FORGE_OAUTH_HOST", "WOODPECKER_DEV_GITEA_OAUTH_URL"}, // TODO: remove WOODPECKER_DEV_GITEA_OAUTH_URL in next major release
Name: "forge-oauth-host",
Usage: "!!!for experts!!! fully qualified public forge url. Use it if your forge url WOODPECKER_FORGE_URL or WOODPECKER_GITEA_URL, ... isn't a public url. Format: <scheme>://<host>[/<prefixpath>]",
Usage: "!!!for experts!!! fully qualified public forge url. Use it if your forge url WOODPECKER_FORGE_URL or WOODPECKER_GITEA_URL, ... isn't a public url. Format: <scheme>://<host>[/<prefix path>]",
},
//
// Addon
Expand Down Expand Up @@ -427,13 +427,13 @@ var flags = append([]cli.Flag{
&cli.StringFlag{
EnvVars: []string{"WOODPECKER_EXPERT_WEBHOOK_HOST", "WOODPECKER_WEBHOOK_HOST"}, // TODO: remove WOODPECKER_WEBHOOK_HOST in next major release
Name: "server-webhook-host",
Usage: "!!!for experts!!! fully qualified woodpecker server url called by forge's webhooks. Format: <scheme>://<host>[/<prefixpath>]",
Usage: "!!!for experts!!! fully qualified woodpecker server url called by forge's webhooks. Format: <scheme>://<host>[/<prefix path>]",
},
// TODO: remove in next major release
&cli.StringFlag{
EnvVars: []string{"WOODPECKER_DEV_OAUTH_HOST"},
Name: "server-dev-oauth-host-deprecated",
Usage: "DEPRECATED: use WOODPECKER_EXPERT_FORGE_OAUTH_HOST instead\nfully qualified url used for oauth redirects. Format: <scheme>://<host>[/<prefixpath>]",
Usage: "DEPRECATED: use WOODPECKER_EXPERT_FORGE_OAUTH_HOST instead\nfully qualified url used for oauth redirects. Format: <scheme>://<host>[/<prefix path>]",
Value: "",
Hidden: true,
},
Expand Down
8 changes: 4 additions & 4 deletions cmd/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

"github.com/caddyserver/certmagic"
"github.com/gin-gonic/gin"
"github.com/prometheus/client_golang/prometheus/promhttp"
prometheus_http "github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"github.com/urfave/cli/v2"
Expand Down Expand Up @@ -250,7 +250,7 @@
if metricsServerAddr := c.String("metrics-server-addr"); metricsServerAddr != "" {
g.Go(func() error {
metricsRouter := gin.New()
metricsRouter.GET("/metrics", gin.WrapH(promhttp.Handler()))
metricsRouter.GET("/metrics", gin.WrapH(prometheus_http.Handler()))

Check warning on line 253 in cmd/server/server.go

View check run for this annotation

Codecov / codecov/patch

cmd/server/server.go#L253

Added line #L253 was not covered by tests
err := http.ListenAndServe(metricsServerAddr, metricsRouter)
if err != nil && !errors.Is(err, http.ErrServerClosed) {
log.Fatal().Err(err).Msg("could not start metrics server") //nolint:forbidigo
Expand All @@ -270,11 +270,11 @@
server.Config.Services.Logs = logging.New()
server.Config.Services.Pubsub = pubsub.New()
server.Config.Services.Membership = setupMembershipService(c, s)
serviceMangager, err := services.NewManager(c, s, setup.Forge)
serviceManager, err := services.NewManager(c, s, setup.Forge)

Check warning on line 273 in cmd/server/server.go

View check run for this annotation

Codecov / codecov/patch

cmd/server/server.go#L273

Added line #L273 was not covered by tests
if err != nil {
return fmt.Errorf("could not setup service manager: %w", err)
}
server.Config.Services.Manager = serviceMangager
server.Config.Services.Manager = serviceManager

Check warning on line 277 in cmd/server/server.go

View check run for this annotation

Codecov / codecov/patch

cmd/server/server.go#L277

Added line #L277 was not covered by tests

// authentication
server.Config.Pipeline.AuthenticatePublicRepos = c.Bool("authenticate-public-repos")
Expand Down
16 changes: 8 additions & 8 deletions cmd/server/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"time"

"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
prometheus_auto "github.com/prometheus/client_golang/prometheus/promauto"
"github.com/rs/zerolog/log"
"github.com/urfave/cli/v2"
"golang.org/x/sync/errgroup"
Expand Down Expand Up @@ -96,37 +96,37 @@
}

func setupMetrics(g *errgroup.Group, _store store.Store) {
pendingSteps := promauto.NewGauge(prometheus.GaugeOpts{
pendingSteps := prometheus_auto.NewGauge(prometheus.GaugeOpts{

Check warning on line 99 in cmd/server/setup.go

View check run for this annotation

Codecov / codecov/patch

cmd/server/setup.go#L99

Added line #L99 was not covered by tests
Namespace: "woodpecker",
Name: "pending_steps",
Help: "Total number of pending pipeline steps.",
})
waitingSteps := promauto.NewGauge(prometheus.GaugeOpts{
waitingSteps := prometheus_auto.NewGauge(prometheus.GaugeOpts{

Check warning on line 104 in cmd/server/setup.go

View check run for this annotation

Codecov / codecov/patch

cmd/server/setup.go#L104

Added line #L104 was not covered by tests
Namespace: "woodpecker",
Name: "waiting_steps",
Help: "Total number of pipeline waiting on deps.",
})
runningSteps := promauto.NewGauge(prometheus.GaugeOpts{
runningSteps := prometheus_auto.NewGauge(prometheus.GaugeOpts{

Check warning on line 109 in cmd/server/setup.go

View check run for this annotation

Codecov / codecov/patch

cmd/server/setup.go#L109

Added line #L109 was not covered by tests
Namespace: "woodpecker",
Name: "running_steps",
Help: "Total number of running pipeline steps.",
})
workers := promauto.NewGauge(prometheus.GaugeOpts{
workers := prometheus_auto.NewGauge(prometheus.GaugeOpts{

Check warning on line 114 in cmd/server/setup.go

View check run for this annotation

Codecov / codecov/patch

cmd/server/setup.go#L114

Added line #L114 was not covered by tests
Namespace: "woodpecker",
Name: "worker_count",
Help: "Total number of workers.",
})
pipelines := promauto.NewGauge(prometheus.GaugeOpts{
pipelines := prometheus_auto.NewGauge(prometheus.GaugeOpts{

Check warning on line 119 in cmd/server/setup.go

View check run for this annotation

Codecov / codecov/patch

cmd/server/setup.go#L119

Added line #L119 was not covered by tests
Namespace: "woodpecker",
Name: "pipeline_total_count",
Help: "Total number of pipelines.",
})
users := promauto.NewGauge(prometheus.GaugeOpts{
users := prometheus_auto.NewGauge(prometheus.GaugeOpts{

Check warning on line 124 in cmd/server/setup.go

View check run for this annotation

Codecov / codecov/patch

cmd/server/setup.go#L124

Added line #L124 was not covered by tests
Namespace: "woodpecker",
Name: "user_count",
Help: "Total number of users.",
})
repos := promauto.NewGauge(prometheus.GaugeOpts{
repos := prometheus_auto.NewGauge(prometheus.GaugeOpts{

Check warning on line 129 in cmd/server/setup.go

View check run for this annotation

Codecov / codecov/patch

cmd/server/setup.go#L129

Added line #L129 was not covered by tests
Namespace: "woodpecker",
Name: "repo_count",
Help: "Total number of repos.",
Expand Down
Loading