mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-21 17:31:01 +00:00
Add spellcheck config (#3018)
Part of #738 ``` pnpx cspell lint --gitignore '{**,.*}/{*,.*}' ``` --------- Co-authored-by: Anbraten <anton@ju60.de> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
parent
0b5eef7d1e
commit
94b882fb95
58 changed files with 241 additions and 109 deletions
113
.cspell.json
Normal file
113
.cspell.json
Normal file
|
@ -0,0 +1,113 @@
|
|||
{
|
||||
"version": "0.2",
|
||||
"language": "en",
|
||||
"words": [
|
||||
"ciphertext",
|
||||
"evenodd",
|
||||
"gitea",
|
||||
"gonic",
|
||||
"Netrc",
|
||||
"prismjs",
|
||||
"rawurl",
|
||||
"Refspec",
|
||||
"securecookie",
|
||||
"sess",
|
||||
"techknowlogick",
|
||||
"vueuse",
|
||||
"windicss",
|
||||
"xorm",
|
||||
"xormigrate",
|
||||
"zerolog",
|
||||
"Msgf",
|
||||
"varchar",
|
||||
"autoincr",
|
||||
"stretchr",
|
||||
"bradrydzewski",
|
||||
"octocat",
|
||||
"brightbox",
|
||||
"anbraten",
|
||||
"Codeberg",
|
||||
"Fediverse",
|
||||
"Weblate",
|
||||
"Hetzner",
|
||||
"windi",
|
||||
"intlify",
|
||||
"unplugin",
|
||||
"Pinia",
|
||||
"woodpeckerci",
|
||||
"tinycolor",
|
||||
"favicons",
|
||||
"Laszlo",
|
||||
"Fogas",
|
||||
"Georgiana",
|
||||
"Ionescu",
|
||||
"typecheck",
|
||||
"HTTPFS",
|
||||
"Println",
|
||||
"ppid",
|
||||
"xlog",
|
||||
"Debugf",
|
||||
"Warnf",
|
||||
"Infof",
|
||||
"Wrapf",
|
||||
"urfave",
|
||||
"creativecommons",
|
||||
"compatiblelicenses",
|
||||
"sublicensable",
|
||||
"waivable",
|
||||
"kyvg",
|
||||
"iconify",
|
||||
"Upsert",
|
||||
"Rydzewski",
|
||||
"fsnotify",
|
||||
"tink",
|
||||
"desaturate",
|
||||
"golangci",
|
||||
"Kaniko",
|
||||
"Reviewdog",
|
||||
"DATASOURCE",
|
||||
"httpsig",
|
||||
"envsubst",
|
||||
"TARGETOS",
|
||||
"TARGETARCH",
|
||||
"GOARCH",
|
||||
"Curr",
|
||||
"doublestar",
|
||||
"multierr",
|
||||
"markdownlint",
|
||||
"buildx",
|
||||
"HEALTHCHECK",
|
||||
"devx",
|
||||
"gomod",
|
||||
"laszlocph"
|
||||
],
|
||||
"ignorePaths": [
|
||||
"**/node_modules/**/*",
|
||||
"pnpm-lock.yaml",
|
||||
".gitignore",
|
||||
".git/**/*",
|
||||
".cspell.json",
|
||||
".golangci.yaml",
|
||||
".vscode/extensions.json",
|
||||
"web/src/assets/locales/**/*",
|
||||
"web/components.d.ts",
|
||||
"server/store/datastore/migration/**/*",
|
||||
"go.mod",
|
||||
"go.sum",
|
||||
"*.excalidraw",
|
||||
"*.svg",
|
||||
"Makefile",
|
||||
// TODO: remove the following
|
||||
"CHANGELOG.md",
|
||||
".woodpecker/",
|
||||
"agent/",
|
||||
"cli/",
|
||||
"cmd/",
|
||||
"docker/",
|
||||
"docs/",
|
||||
"pipeline/",
|
||||
"shared/",
|
||||
"server/"
|
||||
],
|
||||
"enableFiletypes": ["dockercompose"]
|
||||
}
|
2
.ecrc
2
.ecrc
|
@ -6,7 +6,7 @@
|
|||
"fixtures",
|
||||
"LICENSE",
|
||||
"node_modules",
|
||||
"server/store/datastore/migration/testfiles/sqlite.db",
|
||||
"server/store/datastore/migration/test-files/sqlite.db",
|
||||
"server/store/datastore/feed.go",
|
||||
"cmd/server/docs/docs.go",
|
||||
"_test.go",
|
||||
|
|
|
@ -63,7 +63,7 @@ tasks:
|
|||
git checkout -b main
|
||||
git remote add origin http://woodpecker:${GITEA_TOKEN}@localhost:3000/woodpecker/woodpecker-test.git
|
||||
git add .
|
||||
git commit -m ":tada: Initial commit"
|
||||
git commit -m "Initial commit"
|
||||
git push -u origin main
|
||||
cd ../..
|
||||
gp sync-done gitea
|
||||
|
@ -105,6 +105,7 @@ ports:
|
|||
|
||||
vscode:
|
||||
extensions:
|
||||
# cSpell:disable
|
||||
- 'golang.go'
|
||||
- 'EditorConfig.EditorConfig'
|
||||
- 'dbaeumer.vscode-eslint'
|
||||
|
@ -114,3 +115,4 @@ vscode:
|
|||
- 'redhat.vscode-yaml'
|
||||
- 'davidanson.vscode-markdownlint'
|
||||
- 'streetsidesoftware.code-spell-checker'
|
||||
# cSpell:enable
|
||||
|
|
|
@ -139,5 +139,5 @@ MD046:
|
|||
|
||||
# MD048/code-fence-style - Code fence style
|
||||
MD048:
|
||||
# Code fence syle
|
||||
# Code fence style
|
||||
style: 'backtick'
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# cSpell:ignore checkmake hadolint autofix autoupdate
|
||||
repos:
|
||||
- repo: meta
|
||||
hooks:
|
||||
|
|
4
.vscode/settings.json
vendored
4
.vscode/settings.json
vendored
|
@ -9,7 +9,5 @@
|
|||
"go.lintTool": "golangci-lint",
|
||||
"go.lintFlags": ["--fast"],
|
||||
"eslint.workingDirectories": ["./web"],
|
||||
"prettier.configPath": "./web/.prettierrc.js",
|
||||
"prettier.ignorePath": "./web/.prettierignore",
|
||||
"cSpell.words": ["Curr", "doublestar", "ERRORLEVEL", "multierr"]
|
||||
"prettier.ignorePath": "./web/.prettierignore"
|
||||
}
|
||||
|
|
|
@ -91,6 +91,14 @@ steps:
|
|||
- event: push
|
||||
branch: renovate/*
|
||||
|
||||
spellcheck:
|
||||
image: docker.io/node:21-alpine
|
||||
group: test
|
||||
commands:
|
||||
- corepack enable
|
||||
- pnpx cspell lint --no-progress --gitignore '{**,.*}/{*,.*}'
|
||||
when: *when
|
||||
|
||||
test:
|
||||
depends_on:
|
||||
- vendor
|
||||
|
|
|
@ -4,7 +4,7 @@ ignore-from-file:
|
|||
- docs/.gitignore
|
||||
- docs/plugins/woodpecker-plugins/.gitignore
|
||||
- .gitignore
|
||||
- server/store/datastore/migration/testfiles/.gitignore
|
||||
- server/store/datastore/migration/test-files/.gitignore
|
||||
- web/.gitignore
|
||||
|
||||
rules:
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
<img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg" alt="License: Apache-2.0">
|
||||
</a>
|
||||
<a href="https://bestpractices.coreinfrastructure.org/projects/5309">
|
||||
<img src="https://bestpractices.coreinfrastructure.org/projects/5309/badge" alt="openssf best practices">
|
||||
<img src="https://bestpractices.coreinfrastructure.org/projects/5309/badge" alt="OpenSSF best practices">
|
||||
</a>
|
||||
<a href="https://results.pre-commit.ci/repo/github/179344069" title="pre-commit.ci">
|
||||
<img src="https://results.pre-commit.ci/badge/github/woodpecker-ci/woodpecker/main.svg" alt="pre-commit.ci">
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# cSpell:ignore pgdata pgsql localtime
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
|
|
|
@ -8,7 +8,7 @@ global:
|
|||
|
||||
scrape_configs:
|
||||
- job_name: 'woodpecker'
|
||||
bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
|
||||
bearer_token: dummyToken...
|
||||
|
||||
static_configs:
|
||||
- targets: ['woodpecker.domain.com']
|
||||
|
@ -24,7 +24,7 @@ An administrator will need to generate a user API token and configure in the Pro
|
|||
|
||||
scrape_configs:
|
||||
- job_name: 'woodpecker'
|
||||
+ bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
|
||||
+ bearer_token: dummyToken...
|
||||
|
||||
static_configs:
|
||||
- targets: ['woodpecker.domain.com']
|
||||
|
|
|
@ -8,7 +8,7 @@ global:
|
|||
|
||||
scrape_configs:
|
||||
- job_name: 'woodpecker'
|
||||
bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
|
||||
bearer_token: dummyToken...
|
||||
|
||||
static_configs:
|
||||
- targets: ['woodpecker.domain.com']
|
||||
|
@ -24,7 +24,7 @@ global:
|
|||
|
||||
scrape_configs:
|
||||
- job_name: 'woodpecker'
|
||||
+ bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
|
||||
+ bearer_token: dummyToken...
|
||||
|
||||
static_configs:
|
||||
- targets: ['woodpecker.domain.com']
|
||||
|
|
|
@ -8,7 +8,7 @@ global:
|
|||
|
||||
scrape_configs:
|
||||
- job_name: 'woodpecker'
|
||||
bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
|
||||
bearer_token: dummyToken...
|
||||
|
||||
static_configs:
|
||||
- targets: ['woodpecker.domain.com']
|
||||
|
@ -24,7 +24,7 @@ global:
|
|||
|
||||
scrape_configs:
|
||||
- job_name: 'woodpecker'
|
||||
+ bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
|
||||
+ bearer_token: dummyToken...
|
||||
|
||||
static_configs:
|
||||
- targets: ['woodpecker.domain.com']
|
||||
|
|
|
@ -8,7 +8,7 @@ global:
|
|||
|
||||
scrape_configs:
|
||||
- job_name: 'woodpecker'
|
||||
bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
|
||||
bearer_token: dummyToken...
|
||||
|
||||
static_configs:
|
||||
- targets: ['woodpecker.domain.com']
|
||||
|
@ -24,7 +24,7 @@ global:
|
|||
|
||||
scrape_configs:
|
||||
- job_name: 'woodpecker'
|
||||
+ bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
|
||||
+ bearer_token: dummyToken...
|
||||
|
||||
static_configs:
|
||||
- targets: ['woodpecker.domain.com']
|
||||
|
|
|
@ -8,7 +8,7 @@ global:
|
|||
|
||||
scrape_configs:
|
||||
- job_name: 'woodpecker'
|
||||
bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
|
||||
bearer_token: dummyToken...
|
||||
|
||||
static_configs:
|
||||
- targets: ['woodpecker.domain.com']
|
||||
|
@ -24,7 +24,7 @@ global:
|
|||
|
||||
scrape_configs:
|
||||
- job_name: 'woodpecker'
|
||||
+ bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
|
||||
+ bearer_token: dummyToken...
|
||||
|
||||
static_configs:
|
||||
- targets: ['woodpecker.domain.com']
|
||||
|
|
|
@ -8,7 +8,7 @@ global:
|
|||
|
||||
scrape_configs:
|
||||
- job_name: 'woodpecker'
|
||||
bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
|
||||
bearer_token: dummyToken...
|
||||
|
||||
static_configs:
|
||||
- targets: ['woodpecker.domain.com']
|
||||
|
@ -24,7 +24,7 @@ An administrator will need to generate a user API token and configure in the Pro
|
|||
|
||||
scrape_configs:
|
||||
- job_name: 'woodpecker'
|
||||
+ bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
|
||||
+ bearer_token: dummyToken...
|
||||
|
||||
static_configs:
|
||||
- targets: ['woodpecker.domain.com']
|
||||
|
|
|
@ -12,6 +12,8 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// cSpell:ignore ERRORLEVEL
|
||||
|
||||
package local
|
||||
|
||||
import (
|
||||
|
|
|
@ -209,7 +209,7 @@ func (l *Linter) lintDeprecations(config *WorkflowConfig) (err error) {
|
|||
return err
|
||||
}
|
||||
|
||||
if parsed.PipelineDontUseIt.ContainerList != nil {
|
||||
if parsed.PipelineDoNotUseIt.ContainerList != nil {
|
||||
err = multierr.Append(err, &errors.PipelineError{
|
||||
Type: errors.PipelineErrorTypeDeprecation,
|
||||
Message: "Please use 'steps:' instead of deprecated 'pipeline:' list",
|
||||
|
@ -222,7 +222,7 @@ func (l *Linter) lintDeprecations(config *WorkflowConfig) (err error) {
|
|||
})
|
||||
}
|
||||
|
||||
if parsed.PlatformDontUseIt != "" {
|
||||
if parsed.PlatformDoNotUseIt != "" {
|
||||
err = multierr.Append(err, &errors.PipelineError{
|
||||
Type: errors.PipelineErrorTypeDeprecation,
|
||||
Message: "Please use labels instead of deprecated 'platform' filters",
|
||||
|
@ -235,7 +235,7 @@ func (l *Linter) lintDeprecations(config *WorkflowConfig) (err error) {
|
|||
})
|
||||
}
|
||||
|
||||
if parsed.BranchesDontUseIt != nil {
|
||||
if parsed.BranchesDoNotUseIt != nil {
|
||||
err = multierr.Append(err, &errors.PipelineError{
|
||||
Type: errors.PipelineErrorTypeDeprecation,
|
||||
Message: "Please use global when instead of deprecated 'branches' filter",
|
||||
|
|
|
@ -33,34 +33,34 @@ func ParseBytes(b []byte) (*types.Workflow, error) {
|
|||
}
|
||||
|
||||
// support deprecated branch filter
|
||||
if out.BranchesDontUseIt != nil {
|
||||
if out.BranchesDoNotUseIt != nil {
|
||||
switch {
|
||||
case out.When.Constraints == nil:
|
||||
out.When.Constraints = []constraint.Constraint{{Branch: *out.BranchesDontUseIt}}
|
||||
out.When.Constraints = []constraint.Constraint{{Branch: *out.BranchesDoNotUseIt}}
|
||||
case len(out.When.Constraints) == 1 && out.When.Constraints[0].Branch.IsEmpty():
|
||||
out.When.Constraints[0].Branch = *out.BranchesDontUseIt
|
||||
out.When.Constraints[0].Branch = *out.BranchesDoNotUseIt
|
||||
default:
|
||||
return nil, fmt.Errorf("could not apply deprecated branches filter into global when filter")
|
||||
}
|
||||
out.BranchesDontUseIt = nil
|
||||
out.BranchesDoNotUseIt = nil
|
||||
}
|
||||
|
||||
// support deprecated pipeline keyword
|
||||
if len(out.PipelineDontUseIt.ContainerList) != 0 && len(out.Steps.ContainerList) == 0 {
|
||||
out.Steps.ContainerList = out.PipelineDontUseIt.ContainerList
|
||||
if len(out.PipelineDoNotUseIt.ContainerList) != 0 && len(out.Steps.ContainerList) == 0 {
|
||||
out.Steps.ContainerList = out.PipelineDoNotUseIt.ContainerList
|
||||
}
|
||||
|
||||
// support deprecated platform filter
|
||||
if out.PlatformDontUseIt != "" {
|
||||
if out.PlatformDoNotUseIt != "" {
|
||||
if out.Labels == nil {
|
||||
out.Labels = make(base.SliceOrMap)
|
||||
}
|
||||
if _, set := out.Labels["platform"]; !set {
|
||||
out.Labels["platform"] = out.PlatformDontUseIt
|
||||
out.Labels["platform"] = out.PlatformDoNotUseIt
|
||||
}
|
||||
out.PlatformDontUseIt = ""
|
||||
out.PlatformDoNotUseIt = ""
|
||||
}
|
||||
out.PipelineDontUseIt.ContainerList = nil
|
||||
out.PipelineDoNotUseIt.ContainerList = nil
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
|
|
@ -33,10 +33,10 @@ type (
|
|||
func (s *Secrets) UnmarshalYAML(value *yaml.Node) error {
|
||||
y, _ := yaml.Marshal(value)
|
||||
|
||||
var strslice []string
|
||||
err := yaml.Unmarshal(y, &strslice)
|
||||
var secrets []string
|
||||
err := yaml.Unmarshal(y, &secrets)
|
||||
if err == nil {
|
||||
for _, str := range strslice {
|
||||
for _, str := range secrets {
|
||||
s.Secrets = append(s.Secrets, &Secret{
|
||||
Source: str,
|
||||
Target: str,
|
||||
|
|
|
@ -38,11 +38,11 @@ type (
|
|||
Volumes WorkflowVolumes `yaml:"volumes,omitempty"`
|
||||
|
||||
// Deprecated
|
||||
PlatformDontUseIt string `yaml:"platform,omitempty"` // TODO: remove in next major version
|
||||
PlatformDoNotUseIt string `yaml:"platform,omitempty"` // TODO: remove in next major version
|
||||
// Deprecated
|
||||
BranchesDontUseIt *constraint.List `yaml:"branches,omitempty"` // TODO: remove in next major version
|
||||
BranchesDoNotUseIt *constraint.List `yaml:"branches,omitempty"` // TODO: remove in next major version
|
||||
// Deprecated
|
||||
PipelineDontUseIt ContainerList `yaml:"pipeline,omitempty"` // TODO: remove in next major version
|
||||
PipelineDoNotUseIt ContainerList `yaml:"pipeline,omitempty"` // TODO: remove in next major version
|
||||
}
|
||||
|
||||
// Workspace defines a pipeline workspace.
|
||||
|
|
|
@ -312,11 +312,11 @@ func PostApproval(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
newpipeline, err := pipeline.Approve(c, _store, pl, user, repo)
|
||||
newPipeline, err := pipeline.Approve(c, _store, pl, user, repo)
|
||||
if err != nil {
|
||||
handlePipelineErr(c, err)
|
||||
} else {
|
||||
c.JSON(http.StatusOK, newpipeline)
|
||||
c.JSON(http.StatusOK, newPipeline)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
2
server/forge/gitlab/testdata/hooks.go
vendored
2
server/forge/gitlab/testdata/hooks.go
vendored
|
@ -22,7 +22,7 @@ import (
|
|||
var (
|
||||
ServiceHookMethod = http.MethodPost
|
||||
ServiceHookURL, _ = url.Parse(
|
||||
"http://10.40.8.5:8000/hook?owner=test&name=woodpecker&access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9." +
|
||||
"http://10.40.8.5:8000/hook?owner=test&name=woodpecker&access_token=dummyToken." +
|
||||
"eyJ0ZXh0IjoidGVzdC93b29kcGVja2VyIiwidHlwZSI6Imhvb2sifQ.x3kPnmZtxZQ_9_eMhfQ1HSmj_SLhdT_Lu2hMczWjKh0")
|
||||
ServiceHookHeaders = http.Header{
|
||||
"Content-Type": []string{"application/json"},
|
||||
|
|
|
@ -75,7 +75,7 @@ const (
|
|||
RepoPerforce SCMKind = "perforce"
|
||||
)
|
||||
|
||||
// RepoVisibility represent to wat state a repo in woodpecker is visible to others
|
||||
// RepoVisibility represent to what state a repo in woodpecker is visible to others
|
||||
type RepoVisibility string // @name RepoVisibility
|
||||
|
||||
const (
|
||||
|
|
|
@ -39,9 +39,9 @@ func Send(ctx context.Context, method, path string, privateKey crypto.PrivateKey
|
|||
var buf io.ReadWriter
|
||||
if in != nil {
|
||||
buf = new(bytes.Buffer)
|
||||
jsonerr := json.NewEncoder(buf).Encode(in)
|
||||
if jsonerr != nil {
|
||||
return 0, jsonerr
|
||||
jsonErr := json.NewEncoder(buf).Encode(in)
|
||||
if jsonErr != nil {
|
||||
return 0, jsonErr
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -154,7 +154,7 @@ func TestFifoErrors(t *testing.T) {
|
|||
assert.NoError(t, err)
|
||||
assert.Equal(t, task1, got)
|
||||
|
||||
assert.NoError(t, q.Error(noContext, got.ID, fmt.Errorf("exitcode 1, there was an error")))
|
||||
assert.NoError(t, q.Error(noContext, got.ID, fmt.Errorf("exit code 1, there was an error")))
|
||||
|
||||
got, err = q.Poll(noContext, 1, func(*model.Task) bool { return true })
|
||||
assert.NoError(t, err)
|
||||
|
@ -194,7 +194,7 @@ func TestFifoErrors2(t *testing.T) {
|
|||
assert.NoError(t, q.Done(noContext, got.ID, model.StatusSuccess))
|
||||
}
|
||||
if got != task2 {
|
||||
assert.NoError(t, q.Error(noContext, got.ID, fmt.Errorf("exitcode 1, there was an error")))
|
||||
assert.NoError(t, q.Error(noContext, got.ID, fmt.Errorf("exit code 1, there was an error")))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -249,7 +249,7 @@ func TestFifoErrorsMultiThread(t *testing.T) {
|
|||
case !task1Processed:
|
||||
assert.Equal(t, task1, got)
|
||||
task1Processed = true
|
||||
assert.NoError(t, q.Error(noContext, got.ID, fmt.Errorf("exitcode 1, there was an error")))
|
||||
assert.NoError(t, q.Error(noContext, got.ID, fmt.Errorf("exit code 1, there was an error")))
|
||||
go func() {
|
||||
for {
|
||||
fmt.Printf("Worker spawned\n")
|
||||
|
@ -306,7 +306,7 @@ func TestFifoTransitiveErrors(t *testing.T) {
|
|||
got, err := q.Poll(noContext, 1, func(*model.Task) bool { return true })
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, task1, got)
|
||||
assert.NoError(t, q.Error(noContext, got.ID, fmt.Errorf("exitcode 1, there was an error")))
|
||||
assert.NoError(t, q.Error(noContext, got.ID, fmt.Errorf("exit code 1, there was an error")))
|
||||
|
||||
got, err = q.Poll(noContext, 1, func(*model.Task) bool { return true })
|
||||
assert.NoError(t, err)
|
||||
|
@ -419,7 +419,7 @@ func TestWaitingVsPending(t *testing.T) {
|
|||
info := q.Info(noContext)
|
||||
assert.Equal(t, 2, info.Stats.WaitingOnDeps)
|
||||
|
||||
assert.NoError(t, q.Error(noContext, got.ID, fmt.Errorf("exitcode 1, there was an error")))
|
||||
assert.NoError(t, q.Error(noContext, got.ID, fmt.Errorf("exit code 1, there was an error")))
|
||||
got, err := q.Poll(noContext, 1, func(*model.Task) bool { return true })
|
||||
assert.NoError(t, err)
|
||||
assert.EqualValues(t, task2, got)
|
||||
|
|
|
@ -77,8 +77,8 @@ func (q *persistentQueue) Poll(c context.Context, agentID int64, f FilterFn) (*m
|
|||
task, err := q.Queue.Poll(c, agentID, f)
|
||||
if task != nil {
|
||||
log.Debug().Msgf("pull queue item: %s: remove from backup", task.ID)
|
||||
if derr := q.store.TaskDelete(task.ID); derr != nil {
|
||||
log.Error().Err(derr).Msgf("pull queue item: %s: failed to remove from backup", task.ID)
|
||||
if deleteErr := q.store.TaskDelete(task.ID); deleteErr != nil {
|
||||
log.Error().Err(deleteErr).Msgf("pull queue item: %s: failed to remove from backup", task.ID)
|
||||
} else {
|
||||
log.Debug().Msgf("pull queue item: %s: successfully removed from backup", task.ID)
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
sqliteDB = "./testfiles/sqlite.db"
|
||||
sqliteDB = "./test-files/sqlite.db"
|
||||
)
|
||||
|
||||
func testDriver() string {
|
||||
|
@ -41,7 +41,7 @@ func testDriver() string {
|
|||
}
|
||||
|
||||
func createSQLiteDB(t *testing.T) string {
|
||||
tmpF, err := os.CreateTemp("./testfiles", "tmp_")
|
||||
tmpF, err := os.CreateTemp("./test-files", "tmp_")
|
||||
if !assert.NoError(t, err) {
|
||||
t.FailNow()
|
||||
}
|
||||
|
|
|
@ -52,11 +52,11 @@ func TestUsers(t *testing.T) {
|
|||
}
|
||||
err1 := store.CreateUser(&user)
|
||||
err2 := store.UpdateUser(&user)
|
||||
getuser, err3 := store.GetUser(user.ID)
|
||||
getUser, err3 := store.GetUser(user.ID)
|
||||
g.Assert(err1).IsNil()
|
||||
g.Assert(err2).IsNil()
|
||||
g.Assert(err3).IsNil()
|
||||
g.Assert(user.ID).Equal(getuser.ID)
|
||||
g.Assert(user.ID).Equal(getUser.ID)
|
||||
})
|
||||
|
||||
g.It("Should Add a new User", func() {
|
||||
|
@ -80,14 +80,14 @@ func TestUsers(t *testing.T) {
|
|||
}
|
||||
|
||||
g.Assert(store.CreateUser(user)).IsNil()
|
||||
getuser, err := store.GetUser(user.ID)
|
||||
getUser, err := store.GetUser(user.ID)
|
||||
g.Assert(err).IsNil()
|
||||
g.Assert(user.ID).Equal(getuser.ID)
|
||||
g.Assert(user.Login).Equal(getuser.Login)
|
||||
g.Assert(user.Token).Equal(getuser.Token)
|
||||
g.Assert(user.Secret).Equal(getuser.Secret)
|
||||
g.Assert(user.Email).Equal(getuser.Email)
|
||||
g.Assert(user.Avatar).Equal(getuser.Avatar)
|
||||
g.Assert(user.ID).Equal(getUser.ID)
|
||||
g.Assert(user.Login).Equal(getUser.Login)
|
||||
g.Assert(user.Token).Equal(getUser.Token)
|
||||
g.Assert(user.Secret).Equal(getUser.Secret)
|
||||
g.Assert(user.Email).Equal(getUser.Email)
|
||||
g.Assert(user.Avatar).Equal(getUser.Avatar)
|
||||
})
|
||||
|
||||
g.It("Should Get a User By Login", func() {
|
||||
|
@ -97,10 +97,10 @@ func TestUsers(t *testing.T) {
|
|||
Token: "e42080dddf012c718e476da161d21ad5",
|
||||
}
|
||||
g.Assert(store.CreateUser(user))
|
||||
getuser, err := store.GetUserLogin(user.Login)
|
||||
getUser, err := store.GetUserLogin(user.Login)
|
||||
g.Assert(err).IsNil()
|
||||
g.Assert(user.ID).Equal(getuser.ID)
|
||||
g.Assert(user.Login).Equal(getuser.Login)
|
||||
g.Assert(user.ID).Equal(getUser.ID)
|
||||
g.Assert(user.Login).Equal(getUser.Login)
|
||||
})
|
||||
|
||||
g.It("Should Enforce Unique User Login", func() {
|
||||
|
|
|
@ -12,6 +12,8 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// cSpell:ignore ldflags
|
||||
|
||||
package version
|
||||
|
||||
// Version of Woodpecker, set with ldflags, from Git tag
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// cSpell:ignore TSES
|
||||
// @ts-check
|
||||
/** @type {import('@typescript-eslint/experimental-utils').TSESLint.Linter.Config} */
|
||||
|
||||
|
|
|
@ -17,5 +17,5 @@ limitations under the License.
|
|||
---
|
||||
|
||||
Woodpecker icon by Georgiana Ionescu from the Noun Project
|
||||
Licensed as Creative Commons CCBY
|
||||
Licensed as Creative Commons CC BY
|
||||
https://thenounproject.com/term/woodpecker/1761314/
|
||||
|
|
|
@ -385,7 +385,7 @@
|
|||
"placeholder": "Adresa registru (např. docker.io)"
|
||||
},
|
||||
"created": "Vytvořená pověření k registru",
|
||||
"creds": "Pověření k registraci",
|
||||
"credentials": "Pověření k registraci",
|
||||
"delete": "Odstranění registru",
|
||||
"deleted": "Odstranění pověření registru",
|
||||
"desc": "Lze přidat pověření k registrům a používat soukromé obrazy pro potrubí.",
|
||||
|
@ -434,7 +434,7 @@
|
|||
"min_short": "min",
|
||||
"not_started": "zatím nezačal",
|
||||
"sec_short": "sek",
|
||||
"tmpl": "MMM D, RRRR, HH:mm z",
|
||||
"template": "MMM D, RRRR, HH:mm z",
|
||||
"weeks_short": "t"
|
||||
},
|
||||
"unknown_error": "Došlo k neznámé chybě",
|
||||
|
|
|
@ -398,7 +398,7 @@
|
|||
"placeholder": "Registry-Adresse (z. B. docker.io)"
|
||||
},
|
||||
"created": "Registry-Zugangsdaten erstellt",
|
||||
"creds": "Zugangsdaten für die Registry",
|
||||
"credentials": "Zugangsdaten für die Registry",
|
||||
"delete": "Registry löschen",
|
||||
"deleted": "Registry-Zugangsdaten gelöscht",
|
||||
"desc": "Zugangsdaten für die Registries können hinzugefügt werden, um private Images für deine Pipelines zu verwenden.",
|
||||
|
@ -448,7 +448,7 @@
|
|||
"min_short": "min",
|
||||
"not_started": "noch nicht gestartet",
|
||||
"sec_short": "sek",
|
||||
"tmpl": "DD.MM.YYYY, HH:mm z",
|
||||
"template": "DD.MM.YYYY, HH:mm z",
|
||||
"weeks_short": "w"
|
||||
},
|
||||
"unknown_error": "Ein unbekannter Fehler ist aufgetreten",
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
"not_found": "Server could not find requested object"
|
||||
},
|
||||
"time": {
|
||||
"tmpl": "MMM D, YYYY, HH:mm z",
|
||||
"template": "MMM D, YYYY, HH:mm z",
|
||||
"weeks_short": "w",
|
||||
"days_short": "d",
|
||||
"hours_short": "h",
|
||||
|
@ -153,7 +153,7 @@
|
|||
},
|
||||
"registries": {
|
||||
"registries": "Registries",
|
||||
"creds": "Registry credentials",
|
||||
"credentials": "Registry credentials",
|
||||
"desc": "Registries credentials can be added to use private images for your pipeline.",
|
||||
"show": "Show registries",
|
||||
"add": "Add registry",
|
||||
|
|
|
@ -395,7 +395,7 @@
|
|||
"placeholder": "Dirección del registry (por ejemplo, docker.io)"
|
||||
},
|
||||
"created": "Credenciales del registry creadas",
|
||||
"creds": "Credenciales del registry",
|
||||
"credentials": "Credenciales del registry",
|
||||
"delete": "Eliminar registry",
|
||||
"deleted": "Credenciales del registry eliminadas",
|
||||
"desc": "Se pueden añadir credenciales de registries para utilizar imágenes privadas para su pipeline.",
|
||||
|
@ -445,7 +445,7 @@
|
|||
"min_short": "min",
|
||||
"not_started": "no iniciado aún",
|
||||
"sec_short": "s",
|
||||
"tmpl": "MMM D, YYYY, HH:mm z",
|
||||
"template": "MMM D, YYYY, HH:mm z",
|
||||
"weeks_short": "w"
|
||||
},
|
||||
"unknown_error": "Se ha producido un error desconocido",
|
||||
|
|
|
@ -397,7 +397,7 @@
|
|||
"placeholder": "Adresse du registre (e.g. docker.io)"
|
||||
},
|
||||
"created": "Authentifiant de connexion à un registre crée",
|
||||
"creds": "Authentifiants de connexion à un registre",
|
||||
"credentials": "Authentifiants de connexion à un registre",
|
||||
"delete": "Effacer le registre",
|
||||
"deleted": "Authentifiant de connexion à un registre effacé",
|
||||
"desc": "Des authentifiants de connexion pour les registres peuvent être ajouté pour permettre d'utiliser des images privées pour vos pipelines.",
|
||||
|
@ -447,7 +447,7 @@
|
|||
"min_short": "min",
|
||||
"not_started": "pas encore démarré",
|
||||
"sec_short": "sec",
|
||||
"tmpl": "D MMM, YYYY, HH:mm z",
|
||||
"template": "D MMM, YYYY, HH:mm z",
|
||||
"weeks_short": "s"
|
||||
},
|
||||
"unknown_error": "Une erreur inconnue est survenue",
|
||||
|
|
|
@ -398,7 +398,7 @@
|
|||
"placeholder": "Alamat registri (mis. docker.io)"
|
||||
},
|
||||
"created": "Kredensial registri dibuat",
|
||||
"creds": "Kredensial registri",
|
||||
"credentials": "Kredensial registri",
|
||||
"delete": "Hapus registri",
|
||||
"deleted": "Kredensial registri dihapus",
|
||||
"desc": "Kredensial registri dapat ditambahkan untuk menggunakan citra pribadi untuk jalur pipa Anda.",
|
||||
|
@ -448,7 +448,7 @@
|
|||
"min_short": "mnt",
|
||||
"not_started": "belum dimulai",
|
||||
"sec_short": "dtk",
|
||||
"tmpl": "BBB H, TTTT, JJ:mm z",
|
||||
"template": "BBB H, TTTT, JJ:mm z",
|
||||
"weeks_short": "m"
|
||||
},
|
||||
"unknown_error": "Terjadi sebuah kesalahan yang tidak diketahui",
|
||||
|
|
|
@ -395,7 +395,7 @@
|
|||
"placeholder": "Reģistra adrese, piemēram, docker.io"
|
||||
},
|
||||
"created": "Reģistra autorizācijas dati pievienoti",
|
||||
"creds": "Reģistru autorizācijas dati",
|
||||
"credentials": "Reģistru autorizācijas dati",
|
||||
"delete": "Dzēst reģistra autorizācijas datus",
|
||||
"deleted": "Reģistra autorizācijas dati dzēsti",
|
||||
"desc": "Reģistru autorizācijas dati var tikt izmantoti, lai izmantotu attēlos no privātiem reģistriem, konvjerdarbu soļos.",
|
||||
|
@ -445,7 +445,7 @@
|
|||
"min_short": "min.",
|
||||
"not_started": "nav uzsākts",
|
||||
"sec_short": "sek.",
|
||||
"tmpl": "YYYY. [gada] D. MMMM, HH:mm z",
|
||||
"template": "YYYY. [gada] D. MMMM, HH:mm z",
|
||||
"weeks_short": "ned."
|
||||
},
|
||||
"unknown_error": "Notika neparedzēta kļūda",
|
||||
|
|
|
@ -103,7 +103,7 @@
|
|||
"min_short": "min",
|
||||
"not_started": "nog niet gestart",
|
||||
"sec_short": "sec",
|
||||
"tmpl": "DD.MM.YYYY, HH:mm z",
|
||||
"template": "DD.MM.YYYY, HH:mm z",
|
||||
"weeks_short": "w"
|
||||
},
|
||||
"unknown_error": "Er is een onbekende fout opgetreden",
|
||||
|
|
|
@ -362,7 +362,7 @@
|
|||
"placeholder": "Adres rejestru (np. docker.io)"
|
||||
},
|
||||
"created": "Utworzono dane rejestru",
|
||||
"creds": "Dane rejestrów",
|
||||
"credentials": "Dane rejestrów",
|
||||
"delete": "Usuń rejestr",
|
||||
"deleted": "Usunięto dane rejestru",
|
||||
"desc": "Możesz dodać dane rejestrów aby używać prywatnych obrazów w twoim potoku.",
|
||||
|
@ -411,7 +411,7 @@
|
|||
"min_short": "min",
|
||||
"not_started": "jeszcze nie rozpoczęto",
|
||||
"sec_short": "sek",
|
||||
"tmpl": "DD.MM.YYYY, HH:mm z",
|
||||
"template": "DD.MM.YYYY, HH:mm z",
|
||||
"weeks_short": "tyg"
|
||||
},
|
||||
"unknown_error": "Wystąpił nieznany błąd",
|
||||
|
|
|
@ -397,7 +397,7 @@
|
|||
"placeholder": "Адрес реестра (например: docker.io)"
|
||||
},
|
||||
"created": "Данные для доступа к реестру добавлены",
|
||||
"creds": "Учётные данные для авторизации в реестре",
|
||||
"credentials": "Учётные данные для авторизации в реестре",
|
||||
"delete": "Удалить реестр",
|
||||
"deleted": "Данные для доступа к реестру удалены",
|
||||
"desc": "Можно добавить учетные данные для доступа к реестру, чтобы использовать приветные образы из этого реестра в конвейере.",
|
||||
|
@ -447,7 +447,7 @@
|
|||
"min_short": "мин.",
|
||||
"not_started": "не запускался ни разу",
|
||||
"sec_short": "сек.",
|
||||
"tmpl": "D MMM, YYYY, HH:mm z",
|
||||
"template": "D MMM, YYYY, HH:mm z",
|
||||
"weeks_short": "нед."
|
||||
},
|
||||
"unknown_error": "Произошла неизвестная ошибка",
|
||||
|
|
|
@ -247,7 +247,7 @@
|
|||
"placeholder": "Адреса реєстру (наприклад, docker.io)"
|
||||
},
|
||||
"created": "Створено облікові дані реєстру",
|
||||
"creds": "Реквізити реєстру",
|
||||
"credentials": "Реквізити реєстру",
|
||||
"delete": "Видалення реєстру",
|
||||
"deleted": "Видалено облікові дані реєстру",
|
||||
"desc": "Облікові дані реєстрів можуть бути додані для використання приватних зображень для вашого конвеєра.",
|
||||
|
@ -294,7 +294,7 @@
|
|||
"min_short": "хв",
|
||||
"not_started": "ще не розпочато",
|
||||
"sec_short": "сек",
|
||||
"tmpl": "MMM D, РРРР, ГГ:п z",
|
||||
"template": "MMM D, РРРР, ГГ:п z",
|
||||
"weeks_short": "т"
|
||||
},
|
||||
"unknown_error": "Виникла невідома помилка",
|
||||
|
|
|
@ -395,7 +395,7 @@
|
|||
"placeholder": "Registry 地址(如 docker.io)"
|
||||
},
|
||||
"created": "Registry 密码已创建",
|
||||
"creds": "注册表凭据",
|
||||
"credentials": "注册表凭据",
|
||||
"delete": "删除 registry",
|
||||
"deleted": "Registry 密码已删除",
|
||||
"desc": "可以添加 Registry 密码,以在流水线中使用私有镜像。",
|
||||
|
@ -445,7 +445,7 @@
|
|||
"min_short": "分钟",
|
||||
"not_started": "还没有运行过",
|
||||
"sec_short": "秒",
|
||||
"tmpl": "YYYY 年 MM 月 D 日 HH:mm z",
|
||||
"template": "YYYY 年 MM 月 D 日 HH:mm z",
|
||||
"weeks_short": "周"
|
||||
},
|
||||
"unknown_error": "发生了未知错误",
|
||||
|
|
|
@ -92,7 +92,7 @@
|
|||
<InputField
|
||||
v-slot="{ id }"
|
||||
:label="$t('admin.settings.agents.capacity.capacity')"
|
||||
docs-url="docs/next/administration/agent-config#woodpecker_max_procs"
|
||||
docs-url="docs/next/administration/agent-config#woodpecker_max_workflows"
|
||||
>
|
||||
<span class="text-wp-text-alt-100">{{ $t('admin.settings.agents.capacity.desc') }}</span>
|
||||
<TextField :id="id" :model-value="selectedAgent.capacity?.toString()" disabled />
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
:key="item.key"
|
||||
class="h-full"
|
||||
:class="`${item.color}`"
|
||||
:style="{ width: `${item.perc}%` }"
|
||||
:style="{ width: `${item.percentage}%` }"
|
||||
>
|
||||
|
||||
</div>
|
||||
|
@ -82,28 +82,28 @@ const data = computed(() => {
|
|||
key: 'worker_count',
|
||||
label: t('admin.settings.queue.stats.worker_count'),
|
||||
value: props.stats.worker_count,
|
||||
perc: total.value > 0 ? (props.stats.worker_count / total.value) * 100 : 0,
|
||||
percentage: total.value > 0 ? (props.stats.worker_count / total.value) * 100 : 0,
|
||||
color: 'bg-wp-state-ok-100',
|
||||
},
|
||||
{
|
||||
key: 'running_count',
|
||||
label: t('admin.settings.queue.stats.running_count'),
|
||||
value: props.stats.running_count,
|
||||
perc: total.value > 0 ? (props.stats.running_count / total.value) * 100 : 100,
|
||||
percentage: total.value > 0 ? (props.stats.running_count / total.value) * 100 : 100,
|
||||
color: 'bg-wp-state-info-100',
|
||||
},
|
||||
{
|
||||
key: 'pending_count',
|
||||
label: t('admin.settings.queue.stats.pending_count'),
|
||||
value: props.stats.pending_count,
|
||||
perc: total.value > 0 ? (props.stats.pending_count / total.value) * 100 : 0,
|
||||
percentage: total.value > 0 ? (props.stats.pending_count / total.value) * 100 : 0,
|
||||
color: 'bg-wp-state-neutral-100',
|
||||
},
|
||||
{
|
||||
key: 'waiting_on_deps_count',
|
||||
label: t('admin.settings.queue.stats.waiting_on_deps_count'),
|
||||
value: props.stats.waiting_on_deps_count,
|
||||
perc: total.value > 0 ? (props.stats.waiting_on_deps_count / total.value) * 100 : 0,
|
||||
percentage: total.value > 0 ? (props.stats.waiting_on_deps_count / total.value) * 100 : 0,
|
||||
color: 'bg-wp-state-error-100',
|
||||
},
|
||||
];
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
<!-- cSpell:ignore teenyicons radiobox vaadin twotone iconoir timelapse -->
|
||||
<template>
|
||||
<i-ic-sharp-timelapse v-if="name === 'duration'" class="h-6 w-6" />
|
||||
<i-mdi-clock-time-eight-outline v-else-if="name === 'since'" class="h-6 w-6" />
|
||||
|
@ -7,7 +8,7 @@
|
|||
<i-mdi-gesture-tap v-else-if="name === 'manual-pipeline'" class="h-6 w-6" />
|
||||
<i-mdi-tag-outline v-else-if="name === 'tag'" class="h-6 w-6" />
|
||||
<i-clarity-deploy-line v-else-if="name === 'deployment'" class="h-6 w-6" />
|
||||
<i-mdisource-commit v-else-if="name === 'commit'" class="h-6 w-6" />
|
||||
<i-mdi-source-commit v-else-if="name === 'commit'" class="h-6 w-6" />
|
||||
<i-iconoir-arrow-left v-else-if="name === 'back'" class="w-8 h-8" />
|
||||
<i-mdi-github v-else-if="name === 'github'" class="h-8 w-8" />
|
||||
<i-teenyicons-git-solid v-else-if="name === 'repo'" class="h-8 w-8" />
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<Settings
|
||||
:title="$t('repo.settings.registries.creds')"
|
||||
:title="$t('repo.settings.registries.credentials')"
|
||||
:desc="$t('repo.settings.registries.desc')"
|
||||
docs-url="docs/usage/registries"
|
||||
>
|
||||
|
|
|
@ -14,7 +14,7 @@ dayjs.extend(duration);
|
|||
|
||||
export function useDate() {
|
||||
function toLocaleString(date: Date) {
|
||||
return dayjs(date).format(useI18n().t('time.tmpl'));
|
||||
return dayjs(date).format(useI18n().t('time.template'));
|
||||
}
|
||||
|
||||
function timeAgo(date: Date | string | number) {
|
||||
|
|
|
@ -34,7 +34,7 @@ export default (pipeline: Ref<Pipeline | undefined>) => {
|
|||
return null;
|
||||
}
|
||||
|
||||
// TODO check whetehr elapsed works
|
||||
// TODO check whether elapsed works
|
||||
return timeAgo(sinceElapsed.value);
|
||||
});
|
||||
|
||||
|
|
|
@ -31,13 +31,13 @@ async function fetchVersion(): Promise<VersionInfo | undefined> {
|
|||
}
|
||||
}
|
||||
|
||||
const isInitialised = ref(false);
|
||||
const isInitialized = ref(false);
|
||||
|
||||
export function useVersion() {
|
||||
if (isInitialised.value) {
|
||||
if (isInitialized.value) {
|
||||
return version;
|
||||
}
|
||||
isInitialised.value = true;
|
||||
isInitialized.value = true;
|
||||
|
||||
const config = useConfig();
|
||||
const current = config.version as string;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* cSpell:ignore atrule hexcode */
|
||||
.token.atrule {
|
||||
color: #7c4dff;
|
||||
}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// cSpell:ignore emojify
|
||||
import { emojify } from 'node-emoji';
|
||||
|
||||
export function convertEmojis(input: string): string {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// cSpell:ignore Segoe Roboto Neue Noto
|
||||
/* eslint-disable import/no-extraneous-dependencies */
|
||||
import tinycolor from 'tinycolor2';
|
||||
import colors from 'windicss/colors';
|
||||
|
|
|
@ -7,7 +7,7 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9"
|
||||
token = "dummyToken"
|
||||
host = "http://woodpecker.company.tld"
|
||||
)
|
||||
|
||||
|
|
|
@ -408,7 +408,7 @@ func (c *client) Org(orgID int64) (*Org, error) {
|
|||
return out, err
|
||||
}
|
||||
|
||||
// OrgLookup returns a organsization by its name.
|
||||
// OrgLookup returns a organization by its name.
|
||||
func (c *client) OrgLookup(name string) (*Org, error) {
|
||||
out := new(Org)
|
||||
uri := fmt.Sprintf(pathOrgLookup, c.addr, name)
|
||||
|
@ -629,9 +629,9 @@ func (c *client) open(rawurl, method string, in any) (io.ReadCloser, error) {
|
|||
return nil, err
|
||||
}
|
||||
if in != nil {
|
||||
decoded, derr := json.Marshal(in)
|
||||
if derr != nil {
|
||||
return nil, derr
|
||||
decoded, decodeErr := json.Marshal(in)
|
||||
if decodeErr != nil {
|
||||
return nil, decodeErr
|
||||
}
|
||||
buf := bytes.NewBuffer(decoded)
|
||||
req.Body = io.NopCloser(buf)
|
||||
|
|
Loading…
Reference in a new issue