Merge branch 'main' into renovate/eslint-9.x

This commit is contained in:
qwerty287 2024-04-25 08:28:55 +02:00
commit 263d759896
No known key found for this signature in database
GPG key ID: 1218A32A886A5002
22 changed files with 7065 additions and 4620 deletions

View file

@ -1,6 +1,6 @@
steps:
release-helper:
image: woodpeckerci/plugin-ready-release-go:1.1.0
image: woodpeckerci/plugin-ready-release-go:1.1.1
pull: true
settings:
release_branch: ${CI_REPO_DEFAULT_BRANCH}

View file

@ -26,7 +26,7 @@ import (
var logPurgeCmd = &cli.Command{
Name: "purge",
Usage: "purge a log",
ArgsUsage: "<repo-id|repo-full-name> <pipeline>",
ArgsUsage: "<repo-id|repo-full-name> <pipeline> [step]",
Action: logPurge,
}
@ -45,7 +45,21 @@ func logPurge(c *cli.Context) (err error) {
return err
}
err = client.LogsPurge(repoID, number)
stepArg := c.Args().Get(2) //nolint: gomnd
// TODO: Add lookup by name: stepID, err := internal.ParseStep(client, repoID, stepIDOrName)
var stepID int64
if len(stepArg) != 0 {
stepID, err = strconv.ParseInt(stepArg, 10, 64)
if err != nil {
return err
}
}
if stepID > 0 {
err = client.StepLogsPurge(repoID, number, stepID)
} else {
err = client.LogsPurge(repoID, number)
}
if err != nil {
return err
}

View file

@ -359,20 +359,6 @@ when:
- platform: [linux/*, windows/amd64]
```
<!-- markdownlint-disable no-duplicate-heading -->
#### `environment`
<!-- markdownlint-enable no-duplicate-heading -->
Execute a step for deployment events matching the target deployment environment:
```yaml
when:
- environment: production
- event: deployment
```
#### `matrix`
Execute a step for a single matrix permutation:
@ -758,7 +744,7 @@ Workflows that should run even on failure should set the `runs_on` tag. See [her
Woodpecker gives the ability to configure privileged mode in the YAML. You can use this parameter to launch containers with escalated capabilities.
:::info
Privileged mode is only available to trusted repositories and for security reasons should only be used in private environments. See [project settings](./71-project-settings.md#trusted) to enable trusted mode.
Privileged mode is only available to trusted repositories and for security reasons should only be used in private environments. See [project settings](./75-project-settings.md#trusted) to enable trusted mode.
:::
```diff

View file

@ -6,7 +6,7 @@ In case there is a single configuration in `.woodpecker.yaml` Woodpecker will cr
By placing the configurations in a folder which is by default named `.woodpecker/` Woodpecker will create a pipeline with multiple workflows each named by the file they are defined in. Only `.yml` and `.yaml` files will be used and files in any subfolders like `.woodpecker/sub-folder/test.yaml` will be ignored.
You can also set some custom path like `.my-ci/pipelines/` instead of `.woodpecker/` in the [project settings](./71-project-settings.md).
You can also set some custom path like `.my-ci/pipelines/` instead of `.woodpecker/` in the [project settings](./75-project-settings.md).
## Benefits of using workflows

View file

@ -3,7 +3,7 @@
Woodpecker gives the ability to define Docker volumes in the YAML. You can use this parameter to mount files or folders on the host machine into your containers.
:::note
Volumes are only available to trusted repositories and for security reasons should only be used in private environments. See [project settings](./71-project-settings.md#trusted) to enable trusted mode.
Volumes are only available to trusted repositories and for security reasons should only be used in private environments. See [project settings](./75-project-settings.md#trusted) to enable trusted mode.
:::
```diff

View file

@ -0,0 +1,62 @@
# Linter
Woodpecker automatically lints your workflow files for errors, deprecations and bad habits. Errors and warnings are shown in the UI for any pipelines.
![errors and warnings in UI](./linter-warnings-errors.png)
## Running the linter from CLI
You can run the linter also manually from the CLI:
```shell
woodpecker-cli lint <workflow files>
```
## Bad habit warnings
Woodpecker warns you if your configuration contains some bad habits.
### Event filter for all steps
All your items in `when` blocks should have an `event` filter, so no step runs on all events. This is recommended because if new events are added, your steps probably shouldn't run on those as well.
Examples of an **incorrect** config for this rule:
```yaml
when:
- branch: main
- event: tag
```
This will trigger the warning because the first item (`branch: main`) does not filter with an event.
```yaml
steps:
- name: test
when:
branch: main
- name: deploy
when:
event: tag
```
Examples of a **correct** config for this rule:
```yaml
when:
- branch: main
event: push
- event: tag
```
```yaml
steps:
- name: test
when:
event: [tag, push]
- name: deploy
when:
- event: tag
```

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

View file

@ -11,6 +11,7 @@ Some versions need some changes to the server configuration or the pipeline conf
- Deprecated uppercasing all secret env vars, instead, the value of the `secrets` property is used. [Read more](./20-usage/40-secrets.md#use-secrets-in-commands)
- Deprecated alternative names for secrets, use `environment` with `from_secret`
- Deprecated slice definition for env vars
- Deprecated `environment` filter, use `when.evaluate`
## 2.0.0
@ -66,7 +67,7 @@ Some versions need some changes to the server configuration or the pipeline conf
Only projects created after updating will have an empty value by default. Existing projects will stick to the current pipeline path which is `.drone.yml` in most cases.
Read more about it at the [Project Settings](./20-usage/71-project-settings.md#pipeline-path)
Read more about it at the [Project Settings](./20-usage/75-project-settings.md#pipeline-path)
- From version `0.15.0` ongoing there will be three types of docker images: `latest`, `next` and `x.x.x` with an alpine variant for each type like `latest-alpine`.
If you used `latest` before to try pre-release features you should switch to `next` after this release.

View file

@ -43,7 +43,7 @@
},
"devDependencies": {
"@docusaurus/module-type-aliases": "^3.1.0",
"@docusaurus/tsconfig": "3.1.1",
"@docusaurus/tsconfig": "3.2.1",
"@docusaurus/types": "^3.1.0",
"@types/node": "^20.11.30",
"@types/react": "^18.2.67",

File diff suppressed because it is too large Load diff

View file

@ -640,7 +640,7 @@ You can manually configure the clone step in your workflow for customization:
```diff
+clone:
+ git:
+ - name: git
+ image: woodpeckerci/plugin-git
steps:
@ -666,7 +666,7 @@ Example configuration to use a custom clone plugin:
```diff
clone:
git:
- name: git
+ image: octocat/custom-git-plugin
```

View file

@ -19,6 +19,12 @@ type DeprecationErrorData struct {
Docs string `json:"docs"`
}
type BadHabitErrorData struct {
File string `json:"file"`
Field string `json:"field"`
Docs string `json:"docs"`
}
func GetLinterData(e *types.PipelineError) *LinterErrorData {
if e.Type != types.PipelineErrorTypeLinter {
return nil

View file

@ -305,7 +305,39 @@ func (l *Linter) lintDeprecations(config *WorkflowConfig) (err error) {
Data: errors.DeprecationErrorData{
File: config.File,
Field: fmt.Sprintf("steps.%s.secrets[%d]", step.Name, i),
Docs: "https://woodpecker-ci.org/docs/usage/workflow-syntax#event",
Docs: "https://woodpecker-ci.org/docs/usage/secrets#use-secrets-in-settings-and-environment",
},
IsWarning: true,
})
}
}
}
for i, c := range parsed.When.Constraints {
if !c.Environment.IsEmpty() {
err = multierr.Append(err, &errorTypes.PipelineError{
Type: errorTypes.PipelineErrorTypeDeprecation,
Message: "environment filters are deprecated, use evaluate with CI_PIPELINE_DEPLOY_TARGET",
Data: errors.DeprecationErrorData{
File: config.File,
Field: fmt.Sprintf("when[%d].environment", i),
Docs: "https://woodpecker-ci.org/docs/usage/workflow-syntax#evaluate",
},
IsWarning: true,
})
}
}
for _, step := range parsed.Steps.ContainerList {
for i, c := range step.When.Constraints {
if !c.Environment.IsEmpty() {
err = multierr.Append(err, &errorTypes.PipelineError{
Type: errorTypes.PipelineErrorTypeDeprecation,
Message: "environment filters are deprecated, use evaluate with CI_PIPELINE_DEPLOY_TARGET",
Data: errors.DeprecationErrorData{
File: config.File,
Field: fmt.Sprintf("steps.%s.when[%d].environment", step.Name, i),
Docs: "https://woodpecker-ci.org/docs/usage/workflow-syntax#evaluate",
},
IsWarning: true,
})
@ -351,10 +383,11 @@ func (l *Linter) lintBadHabits(config *WorkflowConfig) (err error) {
if field != "" {
err = multierr.Append(err, &errorTypes.PipelineError{
Type: errorTypes.PipelineErrorTypeBadHabit,
Message: "Please set an event filter on all when branches",
Data: errors.LinterErrorData{
Message: "Please set an event filter for all steps or the whole workflow on all items of the when block",
Data: errors.BadHabitErrorData{
File: config.File,
Field: field,
Docs: "https://woodpecker-ci.org/docs/usage/linter#event-filter-for-all-steps",
},
IsWarning: true,
})

View file

@ -189,11 +189,11 @@ func TestBadHabits(t *testing.T) {
}{
{
from: "steps: { build: { image: golang } }",
want: "Please set an event filter on all when branches",
want: "Please set an event filter for all steps or the whole workflow on all items of the when block",
},
{
from: "when: [{branch: xyz}, {event: push}]\nsteps: { build: { image: golang } }",
want: "Please set an event filter on all when branches",
want: "Please set an event filter for all steps or the whole workflow on all items of the when block",
},
}

View file

@ -60,7 +60,7 @@
"prettier": "^3.2.4",
"replace-in-file": "^7.1.0",
"tinycolor2": "^1.6.0",
"typescript": "5.4.3",
"typescript": "5.4.5",
"typescript-eslint": "^7.6.0",
"unplugin-icons": "^0.18.2",
"unplugin-vue-components": "^0.26.0",

View file

@ -37,7 +37,7 @@ dependencies:
version: 2.1.3
pinia:
specifier: ^2.1.7
version: 2.1.7(typescript@5.4.3)(vue@3.4.21)
version: 2.1.7(typescript@5.4.5)(vue@3.4.21)
prismjs:
specifier: ^1.29.0
version: 1.29.0
@ -46,7 +46,7 @@ dependencies:
version: 7.6.0
vue:
specifier: ^3.4.15
version: 3.4.21(typescript@5.4.3)
version: 3.4.21(typescript@5.4.5)
vue-i18n:
specifier: ^9.9.0
version: 9.10.2(vue@3.4.21)
@ -78,10 +78,10 @@ devDependencies:
version: 7.5.8
'@typescript-eslint/eslint-plugin':
specifier: ^7.0.0
version: 7.4.0(@typescript-eslint/parser@7.4.0)(eslint@9.0.0)(typescript@5.4.3)
version: 7.4.0(@typescript-eslint/parser@7.4.0)(eslint@9.0.0)(typescript@5.4.5)
'@typescript-eslint/parser':
specifier: ^7.0.0
version: 7.4.0(eslint@9.0.0)(typescript@5.4.3)
version: 7.4.0(eslint@9.0.0)(typescript@5.4.5)
'@vitejs/plugin-vue':
specifier: ^5.0.3
version: 5.0.4(vite@5.2.7)(vue@3.4.21)
@ -131,11 +131,11 @@ devDependencies:
specifier: ^1.6.0
version: 1.6.0
typescript:
specifier: 5.4.3
version: 5.4.3
specifier: 5.4.5
version: 5.4.5
typescript-eslint:
specifier: ^7.6.0
version: 7.7.0(eslint@9.0.0)(typescript@5.4.3)
version: 7.7.0(eslint@9.0.0)(typescript@5.4.5)
unplugin-icons:
specifier: ^0.18.2
version: 0.18.5(@vue/compiler-sfc@3.4.21)
@ -159,7 +159,7 @@ devDependencies:
version: 9.4.2(eslint@9.0.0)
vue-tsc:
specifier: ^2.0.0
version: 2.0.7(typescript@5.4.3)
version: 2.0.7(typescript@5.4.5)
windicss:
specifier: ^3.5.6
version: 3.5.6
@ -785,7 +785,7 @@ packages:
peerDependencies:
vue: ^3.0.0
dependencies:
vue: 3.4.21(typescript@5.4.3)
vue: 3.4.21(typescript@5.4.5)
dev: false
/@nodelib/fs.scandir@2.1.5:
@ -993,7 +993,7 @@ packages:
resolution: {integrity: sha512-g9gZnnXVq7gM7v3tJCWV/qw7w+KeOlSHAhgF9RytFyifW6AF61hdT2ucrYhPq9hLs5JIryeupHV3qGk95dH9ow==}
dev: false
/@typescript-eslint/eslint-plugin@7.4.0(@typescript-eslint/parser@7.4.0)(eslint@9.0.0)(typescript@5.4.3):
/@typescript-eslint/eslint-plugin@7.4.0(@typescript-eslint/parser@7.4.0)(eslint@9.0.0)(typescript@5.4.5):
resolution: {integrity: sha512-yHMQ/oFaM7HZdVrVm/M2WHaNPgyuJH4WelkSVEWSSsir34kxW2kDJCxlXRhhGWEsMN0WAW/vLpKfKVcm8k+MPw==}
engines: {node: ^18.18.0 || >=20.0.0}
peerDependencies:
@ -1005,10 +1005,10 @@ packages:
optional: true
dependencies:
'@eslint-community/regexpp': 4.10.0
'@typescript-eslint/parser': 7.4.0(eslint@9.0.0)(typescript@5.4.3)
'@typescript-eslint/parser': 7.4.0(eslint@9.0.0)(typescript@5.4.5)
'@typescript-eslint/scope-manager': 7.4.0
'@typescript-eslint/type-utils': 7.4.0(eslint@9.0.0)(typescript@5.4.3)
'@typescript-eslint/utils': 7.4.0(eslint@9.0.0)(typescript@5.4.3)
'@typescript-eslint/type-utils': 7.4.0(eslint@9.0.0)(typescript@5.4.5)
'@typescript-eslint/utils': 7.4.0(eslint@9.0.0)(typescript@5.4.5)
'@typescript-eslint/visitor-keys': 7.4.0
debug: 4.3.4
eslint: 9.0.0
@ -1016,13 +1016,13 @@ packages:
ignore: 5.3.1
natural-compare: 1.4.0
semver: 7.6.0
ts-api-utils: 1.3.0(typescript@5.4.3)
typescript: 5.4.3
ts-api-utils: 1.3.0(typescript@5.4.5)
typescript: 5.4.5
transitivePeerDependencies:
- supports-color
dev: true
/@typescript-eslint/eslint-plugin@7.7.0(@typescript-eslint/parser@7.7.0)(eslint@9.0.0)(typescript@5.4.3):
/@typescript-eslint/eslint-plugin@7.7.0(@typescript-eslint/parser@7.7.0)(eslint@9.0.0)(typescript@5.4.5):
resolution: {integrity: sha512-GJWR0YnfrKnsRoluVO3PRb9r5aMZriiMMM/RHj5nnTrBy1/wIgk76XCtCKcnXGjpZQJQRFtGV9/0JJ6n30uwpQ==}
engines: {node: ^18.18.0 || >=20.0.0}
peerDependencies:
@ -1034,10 +1034,10 @@ packages:
optional: true
dependencies:
'@eslint-community/regexpp': 4.10.0
'@typescript-eslint/parser': 7.7.0(eslint@9.0.0)(typescript@5.4.3)
'@typescript-eslint/parser': 7.7.0(eslint@9.0.0)(typescript@5.4.5)
'@typescript-eslint/scope-manager': 7.7.0
'@typescript-eslint/type-utils': 7.7.0(eslint@9.0.0)(typescript@5.4.3)
'@typescript-eslint/utils': 7.7.0(eslint@9.0.0)(typescript@5.4.3)
'@typescript-eslint/type-utils': 7.7.0(eslint@9.0.0)(typescript@5.4.5)
'@typescript-eslint/utils': 7.7.0(eslint@9.0.0)(typescript@5.4.5)
'@typescript-eslint/visitor-keys': 7.7.0
debug: 4.3.4
eslint: 9.0.0
@ -1045,13 +1045,13 @@ packages:
ignore: 5.3.1
natural-compare: 1.4.0
semver: 7.6.0
ts-api-utils: 1.3.0(typescript@5.4.3)
typescript: 5.4.3
ts-api-utils: 1.3.0(typescript@5.4.5)
typescript: 5.4.5
transitivePeerDependencies:
- supports-color
dev: true
/@typescript-eslint/parser@7.4.0(eslint@9.0.0)(typescript@5.4.3):
/@typescript-eslint/parser@7.4.0(eslint@9.0.0)(typescript@5.4.5):
resolution: {integrity: sha512-ZvKHxHLusweEUVwrGRXXUVzFgnWhigo4JurEj0dGF1tbcGh6buL+ejDdjxOQxv6ytcY1uhun1p2sm8iWStlgLQ==}
engines: {node: ^18.18.0 || >=20.0.0}
peerDependencies:
@ -1063,16 +1063,16 @@ packages:
dependencies:
'@typescript-eslint/scope-manager': 7.4.0
'@typescript-eslint/types': 7.4.0
'@typescript-eslint/typescript-estree': 7.4.0(typescript@5.4.3)
'@typescript-eslint/typescript-estree': 7.4.0(typescript@5.4.5)
'@typescript-eslint/visitor-keys': 7.4.0
debug: 4.3.4
eslint: 9.0.0
typescript: 5.4.3
typescript: 5.4.5
transitivePeerDependencies:
- supports-color
dev: true
/@typescript-eslint/parser@7.7.0(eslint@9.0.0)(typescript@5.4.3):
/@typescript-eslint/parser@7.7.0(eslint@9.0.0)(typescript@5.4.5):
resolution: {integrity: sha512-fNcDm3wSwVM8QYL4HKVBggdIPAy9Q41vcvC/GtDobw3c4ndVT3K6cqudUmjHPw8EAp4ufax0o58/xvWaP2FmTg==}
engines: {node: ^18.18.0 || >=20.0.0}
peerDependencies:
@ -1084,11 +1084,11 @@ packages:
dependencies:
'@typescript-eslint/scope-manager': 7.7.0
'@typescript-eslint/types': 7.7.0
'@typescript-eslint/typescript-estree': 7.7.0(typescript@5.4.3)
'@typescript-eslint/typescript-estree': 7.7.0(typescript@5.4.5)
'@typescript-eslint/visitor-keys': 7.7.0
debug: 4.3.4
eslint: 9.0.0
typescript: 5.4.3
typescript: 5.4.5
transitivePeerDependencies:
- supports-color
dev: true
@ -1109,7 +1109,7 @@ packages:
'@typescript-eslint/visitor-keys': 7.7.0
dev: true
/@typescript-eslint/type-utils@7.4.0(eslint@9.0.0)(typescript@5.4.3):
/@typescript-eslint/type-utils@7.4.0(eslint@9.0.0)(typescript@5.4.5):
resolution: {integrity: sha512-247ETeHgr9WTRMqHbbQdzwzhuyaJ8dPTuyuUEMANqzMRB1rj/9qFIuIXK7l0FX9i9FXbHeBQl/4uz6mYuCE7Aw==}
engines: {node: ^18.18.0 || >=20.0.0}
peerDependencies:
@ -1119,17 +1119,17 @@ packages:
typescript:
optional: true
dependencies:
'@typescript-eslint/typescript-estree': 7.4.0(typescript@5.4.3)
'@typescript-eslint/utils': 7.4.0(eslint@9.0.0)(typescript@5.4.3)
'@typescript-eslint/typescript-estree': 7.4.0(typescript@5.4.5)
'@typescript-eslint/utils': 7.4.0(eslint@9.0.0)(typescript@5.4.5)
debug: 4.3.4
eslint: 9.0.0
ts-api-utils: 1.3.0(typescript@5.4.3)
typescript: 5.4.3
ts-api-utils: 1.3.0(typescript@5.4.5)
typescript: 5.4.5
transitivePeerDependencies:
- supports-color
dev: true
/@typescript-eslint/type-utils@7.7.0(eslint@9.0.0)(typescript@5.4.3):
/@typescript-eslint/type-utils@7.7.0(eslint@9.0.0)(typescript@5.4.5):
resolution: {integrity: sha512-bOp3ejoRYrhAlnT/bozNQi3nio9tIgv3U5C0mVDdZC7cpcQEDZXvq8inrHYghLVwuNABRqrMW5tzAv88Vy77Sg==}
engines: {node: ^18.18.0 || >=20.0.0}
peerDependencies:
@ -1139,12 +1139,12 @@ packages:
typescript:
optional: true
dependencies:
'@typescript-eslint/typescript-estree': 7.7.0(typescript@5.4.3)
'@typescript-eslint/utils': 7.7.0(eslint@9.0.0)(typescript@5.4.3)
'@typescript-eslint/typescript-estree': 7.7.0(typescript@5.4.5)
'@typescript-eslint/utils': 7.7.0(eslint@9.0.0)(typescript@5.4.5)
debug: 4.3.4
eslint: 9.0.0
ts-api-utils: 1.3.0(typescript@5.4.3)
typescript: 5.4.3
ts-api-utils: 1.3.0(typescript@5.4.5)
typescript: 5.4.5
transitivePeerDependencies:
- supports-color
dev: true
@ -1159,7 +1159,7 @@ packages:
engines: {node: ^18.18.0 || >=20.0.0}
dev: true
/@typescript-eslint/typescript-estree@7.4.0(typescript@5.4.3):
/@typescript-eslint/typescript-estree@7.4.0(typescript@5.4.5):
resolution: {integrity: sha512-A99j5AYoME/UBQ1ucEbbMEmGkN7SE0BvZFreSnTd1luq7yulcHdyGamZKizU7canpGDWGJ+Q6ZA9SyQobipePg==}
engines: {node: ^18.18.0 || >=20.0.0}
peerDependencies:
@ -1175,13 +1175,13 @@ packages:
is-glob: 4.0.3
minimatch: 9.0.3
semver: 7.6.0
ts-api-utils: 1.3.0(typescript@5.4.3)
typescript: 5.4.3
ts-api-utils: 1.3.0(typescript@5.4.5)
typescript: 5.4.5
transitivePeerDependencies:
- supports-color
dev: true
/@typescript-eslint/typescript-estree@7.7.0(typescript@5.4.3):
/@typescript-eslint/typescript-estree@7.7.0(typescript@5.4.5):
resolution: {integrity: sha512-8p71HQPE6CbxIBy2kWHqM1KGrC07pk6RJn40n0DSc6bMOBBREZxSDJ+BmRzc8B5OdaMh1ty3mkuWRg4sCFiDQQ==}
engines: {node: ^18.18.0 || >=20.0.0}
peerDependencies:
@ -1197,13 +1197,13 @@ packages:
is-glob: 4.0.3
minimatch: 9.0.4
semver: 7.6.0
ts-api-utils: 1.3.0(typescript@5.4.3)
typescript: 5.4.3
ts-api-utils: 1.3.0(typescript@5.4.5)
typescript: 5.4.5
transitivePeerDependencies:
- supports-color
dev: true
/@typescript-eslint/utils@7.4.0(eslint@9.0.0)(typescript@5.4.3):
/@typescript-eslint/utils@7.4.0(eslint@9.0.0)(typescript@5.4.5):
resolution: {integrity: sha512-NQt9QLM4Tt8qrlBVY9lkMYzfYtNz8/6qwZg8pI3cMGlPnj6mOpRxxAm7BMJN9K0AiY+1BwJ5lVC650YJqYOuNg==}
engines: {node: ^18.18.0 || >=20.0.0}
peerDependencies:
@ -1214,7 +1214,7 @@ packages:
'@types/semver': 7.5.8
'@typescript-eslint/scope-manager': 7.4.0
'@typescript-eslint/types': 7.4.0
'@typescript-eslint/typescript-estree': 7.4.0(typescript@5.4.3)
'@typescript-eslint/typescript-estree': 7.4.0(typescript@5.4.5)
eslint: 9.0.0
semver: 7.6.0
transitivePeerDependencies:
@ -1222,7 +1222,7 @@ packages:
- typescript
dev: true
/@typescript-eslint/utils@7.7.0(eslint@9.0.0)(typescript@5.4.3):
/@typescript-eslint/utils@7.7.0(eslint@9.0.0)(typescript@5.4.5):
resolution: {integrity: sha512-LKGAXMPQs8U/zMRFXDZOzmMKgFv3COlxUQ+2NMPhbqgVm6R1w+nU1i4836Pmxu9jZAuIeyySNrN/6Rc657ggig==}
engines: {node: ^18.18.0 || >=20.0.0}
peerDependencies:
@ -1233,7 +1233,7 @@ packages:
'@types/semver': 7.5.8
'@typescript-eslint/scope-manager': 7.7.0
'@typescript-eslint/types': 7.7.0
'@typescript-eslint/typescript-estree': 7.7.0(typescript@5.4.3)
'@typescript-eslint/typescript-estree': 7.7.0(typescript@5.4.5)
eslint: 9.0.0
semver: 7.6.0
transitivePeerDependencies:
@ -1265,7 +1265,7 @@ packages:
vue: ^3.2.25
dependencies:
vite: 5.2.7(@types/node@20.12.2)
vue: 3.4.21(typescript@5.4.3)
vue: 3.4.21(typescript@5.4.5)
dev: true
/@volar/language-core@2.1.5:
@ -1325,7 +1325,7 @@ packages:
resolution: {integrity: sha512-LgPscpE3Vs0x96PzSSB4IGVSZXZBZHpfxs+ZA1d+VEPwHdOXowy/Y2CsvCAIFrf+ssVU1pD1jidj505EpUnfbA==}
dev: false
/@vue/language-core@2.0.7(typescript@5.4.3):
/@vue/language-core@2.0.7(typescript@5.4.5):
resolution: {integrity: sha512-Vh1yZX3XmYjn9yYLkjU8DN6L0ceBtEcapqiyclHne8guG84IaTzqtvizZB1Yfxm3h6m7EIvjerLO5fvOZO6IIQ==}
peerDependencies:
typescript: '*'
@ -1339,7 +1339,7 @@ packages:
computeds: 0.0.1
minimatch: 9.0.3
path-browserify: 1.0.1
typescript: 5.4.3
typescript: 5.4.5
vue-template-compiler: 2.7.16
dev: true
@ -1368,7 +1368,7 @@ packages:
dependencies:
'@vue/compiler-ssr': 3.4.21
'@vue/shared': 3.4.21
vue: 3.4.21(typescript@5.4.3)
vue: 3.4.21(typescript@5.4.5)
/@vue/shared@3.4.21:
resolution: {integrity: sha512-PuJe7vDIi6VYSinuEbUIQgMIRZGgM8e4R+G+/dQTk0X1NEdvgvvgv7m+rfmDH1gZzyA1OjjoWskvHlfRNfQf3g==}
@ -2105,8 +2105,8 @@ packages:
'@typescript-eslint/parser': ^7.0.0
eslint: ^8.56.0
dependencies:
'@typescript-eslint/eslint-plugin': 7.4.0(@typescript-eslint/parser@7.4.0)(eslint@9.0.0)(typescript@5.4.3)
'@typescript-eslint/parser': 7.4.0(eslint@9.0.0)(typescript@5.4.3)
'@typescript-eslint/eslint-plugin': 7.4.0(@typescript-eslint/parser@7.4.0)(eslint@9.0.0)(typescript@5.4.5)
'@typescript-eslint/parser': 7.4.0(eslint@9.0.0)(typescript@5.4.5)
eslint: 9.0.0
eslint-config-airbnb-base: 15.0.0(eslint-plugin-import@2.29.1)(eslint@9.0.0)
transitivePeerDependencies:
@ -2153,7 +2153,7 @@ packages:
eslint-import-resolver-webpack:
optional: true
dependencies:
'@typescript-eslint/parser': 7.4.0(eslint@9.0.0)(typescript@5.4.3)
'@typescript-eslint/parser': 7.4.0(eslint@9.0.0)(typescript@5.4.5)
debug: 3.2.7
eslint: 9.0.0
eslint-import-resolver-node: 0.3.9
@ -2171,7 +2171,7 @@ packages:
'@typescript-eslint/parser':
optional: true
dependencies:
'@typescript-eslint/parser': 7.4.0(eslint@9.0.0)(typescript@5.4.3)
'@typescript-eslint/parser': 7.4.0(eslint@9.0.0)(typescript@5.4.5)
array-includes: 3.1.8
array.prototype.findlastindex: 1.2.5
array.prototype.flat: 1.3.2
@ -3306,7 +3306,7 @@ packages:
resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==}
engines: {node: '>=8.6'}
/pinia@2.1.7(typescript@5.4.3)(vue@3.4.21):
/pinia@2.1.7(typescript@5.4.5)(vue@3.4.21):
resolution: {integrity: sha512-+C2AHFtcFqjPih0zpYuvof37SFxMQ7OEG2zV9jRI12i9BOy3YQVAHwdKtyyc8pDcDyIc33WCIsZaCFWU7WWxGQ==}
peerDependencies:
'@vue/composition-api': ^1.4.0
@ -3319,8 +3319,8 @@ packages:
optional: true
dependencies:
'@vue/devtools-api': 6.6.1
typescript: 5.4.3
vue: 3.4.21(typescript@5.4.3)
typescript: 5.4.5
vue: 3.4.21(typescript@5.4.5)
vue-demi: 0.14.7(vue@3.4.21)
dev: false
@ -3747,13 +3747,13 @@ packages:
dependencies:
is-number: 7.0.0
/ts-api-utils@1.3.0(typescript@5.4.3):
/ts-api-utils@1.3.0(typescript@5.4.5):
resolution: {integrity: sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==}
engines: {node: '>=16'}
peerDependencies:
typescript: '>=4.2.0'
dependencies:
typescript: 5.4.3
typescript: 5.4.5
dev: true
/tsconfig-paths@3.15.0:
@ -3825,7 +3825,7 @@ packages:
possible-typed-array-names: 1.0.0
dev: true
/typescript-eslint@7.7.0(eslint@9.0.0)(typescript@5.4.3):
/typescript-eslint@7.7.0(eslint@9.0.0)(typescript@5.4.5):
resolution: {integrity: sha512-wZZ+7mTQJCn4mGAvzdERtL4vwKGM/mF9cMSMeKUllz3Hgbd1Mdd5L60Q+nJmCio9RB4OyMMr0EX4Ry2Q7jiAyw==}
engines: {node: ^18.18.0 || >=20.0.0}
peerDependencies:
@ -3835,17 +3835,17 @@ packages:
typescript:
optional: true
dependencies:
'@typescript-eslint/eslint-plugin': 7.7.0(@typescript-eslint/parser@7.7.0)(eslint@9.0.0)(typescript@5.4.3)
'@typescript-eslint/parser': 7.7.0(eslint@9.0.0)(typescript@5.4.3)
'@typescript-eslint/utils': 7.7.0(eslint@9.0.0)(typescript@5.4.3)
'@typescript-eslint/eslint-plugin': 7.7.0(@typescript-eslint/parser@7.7.0)(eslint@9.0.0)(typescript@5.4.5)
'@typescript-eslint/parser': 7.7.0(eslint@9.0.0)(typescript@5.4.5)
'@typescript-eslint/utils': 7.7.0(eslint@9.0.0)(typescript@5.4.5)
eslint: 9.0.0
typescript: 5.4.3
typescript: 5.4.5
transitivePeerDependencies:
- supports-color
dev: true
/typescript@5.4.3:
resolution: {integrity: sha512-KrPd3PKaCLr78MalgiwJnA25Nm8HAmdwN3mYUYZgG/wizIo9EainNVQI9/yDavtVFRN2h3k8uf3GLHuhDMgEHg==}
/typescript@5.4.5:
resolution: {integrity: sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==}
engines: {node: '>=14.17'}
hasBin: true
@ -3924,7 +3924,7 @@ packages:
minimatch: 9.0.3
resolve: 1.22.8
unplugin: 1.10.0
vue: 3.4.21(typescript@5.4.3)
vue: 3.4.21(typescript@5.4.5)
transitivePeerDependencies:
- rollup
- supports-color
@ -3991,7 +3991,7 @@ packages:
vue: '>=3.2.13'
dependencies:
svgo: 3.2.0
vue: 3.4.21(typescript@5.4.3)
vue: 3.4.21(typescript@5.4.5)
dev: true
/vite@5.2.7(@types/node@20.12.2):
@ -4042,7 +4042,7 @@ packages:
'@vue/composition-api':
optional: true
dependencies:
vue: 3.4.21(typescript@5.4.3)
vue: 3.4.21(typescript@5.4.5)
dev: false
/vue-eslint-parser@9.4.2(eslint@9.0.0):
@ -4072,7 +4072,7 @@ packages:
'@intlify/core-base': 9.10.2
'@intlify/shared': 9.10.2
'@vue/devtools-api': 6.6.1
vue: 3.4.21(typescript@5.4.3)
vue: 3.4.21(typescript@5.4.5)
dev: false
/vue-router@4.3.0(vue@3.4.21):
@ -4081,7 +4081,7 @@ packages:
vue: ^3.2.0
dependencies:
'@vue/devtools-api': 6.6.1
vue: 3.4.21(typescript@5.4.3)
vue: 3.4.21(typescript@5.4.5)
dev: false
/vue-template-compiler@2.7.16:
@ -4091,19 +4091,19 @@ packages:
he: 1.2.0
dev: true
/vue-tsc@2.0.7(typescript@5.4.3):
/vue-tsc@2.0.7(typescript@5.4.5):
resolution: {integrity: sha512-LYa0nInkfcDBB7y8jQ9FQ4riJTRNTdh98zK/hzt4gEpBZQmf30dPhP+odzCa+cedGz6B/guvJEd0BavZaRptjg==}
hasBin: true
peerDependencies:
typescript: '*'
dependencies:
'@volar/typescript': 2.1.5
'@vue/language-core': 2.0.7(typescript@5.4.3)
'@vue/language-core': 2.0.7(typescript@5.4.5)
semver: 7.6.0
typescript: 5.4.3
typescript: 5.4.5
dev: true
/vue@3.4.21(typescript@5.4.3):
/vue@3.4.21(typescript@5.4.5):
resolution: {integrity: sha512-5hjyV/jLEIKD/jYl4cavMcnzKwjMKohureP8ejn3hhEjwhWIhWeuzL2kJAjzl/WyVsgPY56Sy4Z40C3lVshxXA==}
peerDependencies:
typescript: '*'
@ -4116,7 +4116,7 @@ packages:
'@vue/runtime-dom': 3.4.21
'@vue/server-renderer': 3.4.21(vue@3.4.21)
'@vue/shared': 3.4.21
typescript: 5.4.3
typescript: 5.4.5
/webpack-sources@3.2.3:
resolution: {integrity: sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==}

View file

@ -43,10 +43,10 @@
},
"not_allowed": "Du darfst nicht auf die Server-Einstellungen zugreifen",
"orgs": {
"delete_confirm": "Möchtest du diese Organisation wirklich löschen? Das wird auch alle Repositories löschen, die dieser Organisation gehören.",
"delete_confirm": "Möchtest du diese Organisation wirklich löschen? Das wird auch alle Repositorys löschen, die dieser Organisation gehören.",
"delete_org": "Organisation löschen",
"deleted": "Organisation gelöscht",
"desc": "Organisationen mit Repositories auf diesem Server",
"desc": "Organisationen mit Repositorys auf diesem Server",
"none": "Es gibt noch keine Organisationen.",
"org_settings": "Organisations-Einstellungen",
"orgs": "Organisationen",
@ -74,14 +74,14 @@
"waiting_for": "wartet auf"
},
"repos": {
"desc": "Repositories, die auf dem Server aktiviert sind oder waren",
"desc": "Repositorys, die auf dem Server aktiviert sind oder waren",
"disabled": "Deaktiviert",
"none": "Es gibt noch keine Repositories.",
"none": "Es gibt noch keine Repositorys.",
"repair": {
"repair": "Alle reparieren",
"success": "Repositories repariert"
"success": "Repositorys repariert"
},
"repos": "Repositories",
"repos": "Repositorys",
"settings": "Repository-Einstellungen",
"view": "Repository anzeigen"
},
@ -89,7 +89,7 @@
"add": "Geheimnis hinzufügen",
"created": "Globales Geheimnis erstellt",
"deleted": "Globales Geheimnis gelöscht",
"desc": "Globale Geheimnisse können an alle Repositories als Umgebungsvariablen übergeben werden.",
"desc": "Globale Geheimnisse können an alle Repositorys als Umgebungsvariablen übergeben werden.",
"events": {
"events": "Verfügbar für folgende Ereignisse",
"pr_warning": "Bitte sei vorsichtig mit dieser Option, da eine böswillige Person über einen Pull-Request deine Geheimnisse erhalten könnte."
@ -118,7 +118,7 @@
"avatar_url": "URL des Profilbilds",
"cancel": "Abbrechen",
"created": "Benutzer erstellt",
"delete_confirm": "Möchtest du diesen Benutzer wirklich löschen? Das wird auch alle Repositories löschen, die diesem Benutzer gehören.",
"delete_confirm": "Möchtest du diesen Benutzer wirklich löschen? Das wird auch alle Repositorys löschen, die diesem Benutzer gehören.",
"delete_user": "Benutzer löschen",
"deleted": "Benutzer gelöscht",
"desc": "Auf diesem Server registrierte Benutzer",
@ -158,7 +158,7 @@
"add": "Geheimnis hinzufügen",
"created": "Organisations-Geheimnis erstellt",
"deleted": "Organisations-Geheimnis gelöscht",
"desc": "Organisation-Geheimnisse können an alle Repositories der Organisation als Umgebungsvariablen übergeben werden.",
"desc": "Organisation-Geheimnisse können an alle Repositorys der Organisation als Umgebungsvariablen übergeben werden.",
"events": {
"events": "Verfügbar für folgende Ereignisse",
"pr_warning": "Bitte sei vorsichtig mit dieser Option, da eine böswillige Person über einen Pull-Request deine Geheimnisse erhalten könnte."
@ -204,7 +204,7 @@
"enable": "Aktivieren",
"enabled": "Bereits aktiviert",
"list_reloaded": "Repository-Liste neu geladen",
"reload": "Repositories neu laden",
"reload": "Repositorys neu laden",
"success": "Repository aktiviert"
},
"manual_pipeline": {
@ -232,7 +232,8 @@
"log_auto_scroll_off": "Schalte automatisches folgen aus",
"log_download": "Herunterladen",
"restart": "Neustarten",
"restart_success": "Pipeline neu gestartet"
"restart_success": "Pipeline neu gestartet",
"log_delete": "Löschen"
},
"config": "Konfiguration",
"errors": "Fehler ({count})",
@ -282,7 +283,9 @@
"step_not_started": "Dieser Schritt hat noch nicht begonnen.",
"tasks": "Vorgänge",
"warnings": "Warnungen ({count})",
"we_got_some_errors": "Oh nein, es gab einige Fehler!"
"we_got_some_errors": "Oh nein, es gab einige Fehler!",
"log_delete_confirm": "Möchtest du die Logs diesen Schrittes wirklich löschen?",
"log_delete_error": "Es gab einen Fehler beim Löschen der Logs des Schrittes"
},
"pull_requests": "Pull-Requests",
"settings": {
@ -383,7 +386,7 @@
"internal": "Intern"
},
"private": {
"desc": "Nur du und andere Besitzer des Repositories können dieses Projekt sehen.",
"desc": "Nur du und andere Besitzer des Repositorys können dieses Projekt sehen.",
"private": "Privat"
},
"public": {
@ -397,7 +400,7 @@
"desc": "Deployments von erolgreichen Pipelines erlauben. Nur benutzen, wenn du allen Nutzern mit Push-Zugriff vertraust."
}
},
"not_allowed": "Zugriff auf die Einstellungen dieses Repositories nicht erlaubt",
"not_allowed": "Zugriff auf die Einstellungen dieses Repositorys nicht erlaubt",
"registries": {
"add": "Registry hinzufügen",
"address": {
@ -443,10 +446,10 @@
},
"settings": "Einstellungen"
},
"user_none": "Diese Organisation / dieser Benutzer hat noch keine Repositories."
"user_none": "Diese Organisation / dieser Benutzer hat noch keine Repositorys."
},
"repos": "Repos",
"repositories": "Repositories",
"repositories": "Repositorys",
"running_version": "Du verwendest Woodpecker {0}",
"search": "Suche…",
"time": {
@ -492,7 +495,7 @@
"add": "Geheimnis hinzufügen",
"created": "Benutzer-Geheimnis erstellt",
"deleted": "Benutzer-Geheimnis gelöscht",
"desc": "Benutzer-Geheimnisse können an alle Repositories des Benutzers als Umgebungsvariablen übergeben werden.",
"desc": "Benutzer-Geheimnisse können an alle Repositorys des Benutzers als Umgebungsvariablen übergeben werden.",
"events": {
"events": "Verfügbar für folgende Ereignisse",
"pr_warning": "Bitte sei vorsichtig mit dieser Option, da eine böswillige Person über einen Pull-Request deine Geheimnisse erhalten könnte."

View file

@ -11,13 +11,16 @@
}"
/>
<span>[{{ error.type }}]</span>
<span v-if="isLinterError(error) || isDeprecationError(error)" class="whitespace-nowrap">
<span
v-if="isLinterError(error) || isDeprecationError(error) || isBadHabitError(error)"
class="whitespace-nowrap"
>
<span v-if="error.data?.file" class="font-bold">{{ error.data?.file }}: </span>
<span>{{ error.data?.field }}</span>
</span>
<span v-else />
<a
v-if="isDeprecationError(error)"
v-if="isDeprecationError(error) || isBadHabitError(error)"
:href="error.data?.docs"
target="_blank"
class="underline col-span-full col-start-2 md:col-span-auto md:col-start-auto"
@ -52,6 +55,10 @@ function isDeprecationError(
): error is PipelineError<{ file: string; field: string; docs: string }> {
return error.type === 'deprecation';
}
function isBadHabitError(error: PipelineError): error is PipelineError<{ file?: string; field: string; docs: string }> {
return error.type === 'bad_habit';
}
</script>
<style scoped>

View file

@ -36,11 +36,11 @@ const (
pathRepair = "%s/api/repos/%d/repair"
pathPipelines = "%s/api/repos/%d/pipelines"
pathPipeline = "%s/api/repos/%d/pipelines/%v"
pathLogs = "%s/api/repos/%d/logs/%d/%d"
pathPipelineLogs = "%s/api/repos/%d/logs/%d"
pathStepLogs = "%s/api/repos/%d/logs/%d/%d"
pathApprove = "%s/api/repos/%d/pipelines/%d/approve"
pathDecline = "%s/api/repos/%d/pipelines/%d/decline"
pathStop = "%s/api/repos/%d/pipelines/%d/cancel"
pathLogPurge = "%s/api/repos/%d/logs/%d"
pathRepoSecrets = "%s/api/repos/%d/secrets"
pathRepoSecret = "%s/api/repos/%d/secrets/%s"
pathRepoRegistries = "%s/api/repos/%d/registry"
@ -297,14 +297,28 @@ func (c *client) PipelineKill(repoID, pipeline int64) error {
return err
}
// PipelineLogs returns the pipeline logs for the specified step.
// LogsPurge purges the pipeline all steps logs for the specified pipeline.
func (c *client) LogsPurge(repoID, pipeline int64) error {
uri := fmt.Sprintf(pathPipelineLogs, c.addr, repoID, pipeline)
err := c.delete(uri)
return err
}
// StepLogEntries returns the pipeline logs for the specified step.
func (c *client) StepLogEntries(repoID, num, step int64) ([]*LogEntry, error) {
uri := fmt.Sprintf(pathLogs, c.addr, repoID, num, step)
uri := fmt.Sprintf(pathStepLogs, c.addr, repoID, num, step)
var out []*LogEntry
err := c.get(uri, &out)
return out, err
}
// StepLogsPurge purges the pipeline logs for the specified step.
func (c *client) StepLogsPurge(repoID, pipelineNumber, stepID int64) error {
uri := fmt.Sprintf(pathStepLogs, c.addr, repoID, pipelineNumber, stepID)
err := c.delete(uri)
return err
}
// Deploy triggers a deployment for an existing pipeline using the
// specified target environment.
func (c *client) Deploy(repoID, pipeline int64, env string, params map[string]string) (*Pipeline, error) {
@ -317,13 +331,6 @@ func (c *client) Deploy(repoID, pipeline int64, env string, params map[string]st
return out, err
}
// LogsPurge purges the pipeline logs for the specified pipeline.
func (c *client) LogsPurge(repoID, pipeline int64) error {
uri := fmt.Sprintf(pathLogPurge, c.addr, repoID, pipeline)
err := c.delete(uri)
return err
}
// Registry returns a registry by hostname.
func (c *client) Registry(repoID int64, hostname string) (*Registry, error) {
out := new(Registry)

View file

@ -118,6 +118,9 @@ type Client interface {
// LogsPurge purges the pipeline logs for the specified pipeline.
LogsPurge(repoID, pipeline int64) error
// StepLogsPurge purges the pipeline logs for the specified step.
StepLogsPurge(repoID, pipelineNumber, stepID int64) error
// Registry returns a registry by hostname.
Registry(repoID int64, hostname string) (*Registry, error)

View file

@ -183,7 +183,10 @@ type (
// Info provides queue stats.
Info struct {
Stats struct {
Pending []Task `json:"pending"`
WaitingOnDeps []Task `json:"waiting_on_deps"`
Running []Task `json:"running"`
Stats struct {
Workers int `json:"worker_count"`
Pending int `json:"pending_count"`
WaitingOnDeps int `json:"waiting_on_deps_count"`