pre-commit fixes (#2669)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Anbraten <anton@ju60.de>
This commit is contained in:
Patrick Schratz 2023-10-31 09:14:09 +01:00 committed by GitHub
parent bd46c01a3e
commit 856b2ef8c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
49 changed files with 663 additions and 642 deletions

View file

@ -18,10 +18,12 @@ repos:
rev: v0.37.0
hooks:
- id: markdownlint
exclude: '^docs/versioned_docs/.*$'
- repo: https://github.com/mrtazz/checkmake
rev: 0.2.2
hooks:
- id: checkmake
exclude: '^docker/Dockerfile.make$' # actually a Dockerfile and not a makefile
- repo: https://github.com/hadolint/hadolint
rev: v2.12.0
hooks:
@ -36,5 +38,6 @@ ci:
autoupdate_branch: ''
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
autoupdate_schedule: monthly
skip: [check-hooks-apply, check-useless-excludes]
# NB: hadolint not included in pre-commit.ci
skip: [check-hooks-apply, check-useless-excludes, hadolint]
submodules: false

View file

@ -6,7 +6,7 @@ when:
- release/*
variables:
- &trivy_image aquasec/trivy:latest
- &trivy_image aquasec/trivy:0.46.1
- &trivy_plugin codeberg.org/woodpecker-plugins/trivy:1.0.1
steps:

File diff suppressed because it is too large Load diff

View file

@ -63,6 +63,7 @@ else
##@ General
.PHONY: all
all: help
.PHONY: version
@ -167,6 +168,7 @@ test-ui: ui-dependencies ## Test UI code
test-lib: ## Test lib code
go test -race -cover -coverprofile coverage.out -timeout 30s $(shell go list ./... | grep -v '/cmd\|/agent\|/cli\|/server')
.PHONY: test
test: test-agent test-server test-server-datastore test-cli test-lib test-ui ## Run all tests
##@ Build
@ -183,6 +185,7 @@ build-agent: ## Build agent
build-cli: ## Build cli
CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -ldflags '${LDFLAGS}' -o dist/woodpecker-cli${BIN_SUFFIX} github.com/woodpecker-ci/woodpecker/cmd/cli
.PHONY: build
build: build-agent build-server build-cli ## Build all binaries
release-frontend: build-frontend ## Build frontend
@ -250,6 +253,7 @@ release-checksums: ## Create checksums for all release files
# generate shas for tar files
(cd dist/; sha256sum *.* > checksums.txt)
.PHONY: release
release: release-frontend release-server release-agent release-cli ## Release all binaries
bundle-prepare: ## Prepare the bundles
@ -267,6 +271,7 @@ bundle-cli: bundle-prepare ## Create bundles for cli
VERSION_NUMBER=$(VERSION_NUMBER) nfpm package --config ./nfpm/nfpm-cli.yml --target ./dist --packager deb
VERSION_NUMBER=$(VERSION_NUMBER) nfpm package --config ./nfpm/nfpm-cli.yml --target ./dist --packager rpm
.PHONY: bundle
bundle: bundle-agent bundle-server bundle-cli ## Create all bundles
##@ Docs

View file

@ -1,3 +1,5 @@
# Woodpecker
<p align="center">
<a href="https://github.com/woodpecker-ci/woodpecker/">
<img alt="Woodpecker" src="docs/static/img/logo.svg" width="220"/>
@ -41,12 +43,13 @@
<a href="https://www.tickgit.com/browse?repo=github.com/woodpecker-ci/woodpecker" title="TODOs">
<img src="https://badgen.net/https/api.tickgit.com/badgen/github.com/woodpecker-ci/woodpecker">
</a>
<a href="https://github.com/pre-commit/pre-commit" title="TODOs">
<img src="https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit">
</a>
</p>
<br/>
# Woodpecker
> Woodpecker is a community fork of the Drone CI system.
Woodpecker is a community fork of the Drone CI system.
![woodpecker](docs/docs/woodpecker.png)
@ -58,7 +61,7 @@ Please consider to donate and become a backer. 🙏 [[Become a backer](https://o
## 📖 Documentation
https://woodpecker-ci.org/
<https://woodpecker-ci.org/>
## ✨ Contribute

View file

@ -3,7 +3,7 @@
We take security seriously.
If you discover a security issue, please bring it to their attention right away!
### Reporting a Vulnerability
## Reporting a Vulnerability
Please **DO NOT** file a public issue, instead send your report privately to [`security @ woodpecker-ci.org`](mailto:security@woodpecker-ci.org).

View file

@ -2,4 +2,4 @@
Command line client for the Woodpecker continuous integration server.
Please see the official documentation at https://woodpecker-ci.org/docs/cli
Please see the official documentation at <https://woodpecker-ci.org/docs/cli>

View file

@ -2,13 +2,13 @@
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
### Installation
## Installation
```bash
pnpm install
```
### Local Development
## Local Development
```bash
pnpm start
@ -16,7 +16,7 @@ pnpm start
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
### Build
## Build
```bash
pnpm build
@ -24,7 +24,7 @@ pnpm build
This command generates static content into the `build` directory and can be served using any static contents hosting service.
### Deployment
## Deployment
Deployment happen via [CI](https://github.com/woodpecker-ci/woodpecker/blob/d59fdb4602bfdd0d00078716ba61b05c02cbd1af/.woodpecker/docs.yml#L8-L30) to [woodpecker-ci.org](https://woodpecker-ci.org).

View file

@ -1,6 +1,6 @@
---
title: Welcome Woodpecker's blog
description: This our first post on Woodpecker.
description: This our first post on Woodpecker
slug: hello-blog
authors:
- name: Anbraten

View file

@ -21,7 +21,7 @@ Furthermore, a ton of bugs where addressed and various enhancements introduced,
With Woodpecker v1.0.0, you can now substantially improve and streamline your code pipelines,
empowering you to automate and optimize workflows like never before.
## Some picked highlights:
## Some picked highlights
### Add Support for Cron Jobs

View file

@ -8,11 +8,14 @@ Webhooks are used to trigger pipeline executions. When you push code to your rep
![repository list](repo-list.png)
> Required Permissions
>
> The user who enables a repo in Woodpecker must have `Admin` rights on that repo, so that Woodpecker can add the webhook.
>
> Note that manually creating webhooks yourself is not possible. This is because webhooks are signed using a per-repository secret key which is not exposed to end users.
## Required Permissions
The user who enables a repo in Woodpecker must have `Admin` rights on that repo, so that Woodpecker can add the webhook.
:::note
Note that manually creating webhooks yourself is not possible.
This is because webhooks are signed using a per-repository secret key which is not exposed to end users.
:::
## Configuration

View file

@ -40,7 +40,7 @@ steps:
Keep in mind the name is optional, if not added the steps will be numerated.
### Skip Commits
## Skip Commits
Woodpecker gives the ability to skip individual commits by adding `[SKIP CI]` or `[CI SKIP]` to the commit message. Note this is case-insensitive.

View file

@ -5,11 +5,12 @@ A Woodpecker deployment consists of two parts:
- A server which is the heart of Woodpecker and ships the web interface.
- Next to one server you can deploy any number of agents which will run the pipelines.
> Each agent is able to process one pipeline step by default.
>
> If you have 4 agents installed and connected to the Woodpecker server, your system will process 4 workflows in parallel.
>
> You can add more agents to increase the number of parallel workflows or set the agent's `WOODPECKER_MAX_WORKFLOWS=1` environment variable to increase the number of parallel workflows for that agent.
Each agent is able to process one pipeline step by default.
If you have 4 agents installed and connected to the Woodpecker server, your system will process 4 workflows in parallel.
:::tip
You can add more agents to increase the number of parallel workflows or set the agent's `WOODPECKER_MAX_WORKFLOWS=1` environment variable to increase the number of parallel workflows for that agent.
:::
## Which version of Woodpecker should I use?
@ -60,7 +61,7 @@ A [Prometheus endpoint](../90-prometheus.md) is exposed.
See the [proxy guide](../70-proxy.md) if you want to see a setup behind Apache, Nginx, Caddy or ngrok.
In the case you need to use Woodpecker with a URL path prefix (like: https://example.org/woodpecker/), you can use the option [`WOODPECKER_ROOT_PATH`](../10-server-config.md#woodpecker_root_path).
In the case you need to use Woodpecker with a URL path prefix (like: <https://example.org/woodpecker/>), you can use the option [`WOODPECKER_ROOT_PATH`](../10-server-config.md#woodpecker_root_path).
## Third-party installation methods

View file

@ -20,9 +20,9 @@ services:
+ - WOODPECKER_OPEN=true
```
You can **also restrict** registration, by keep registration closed and ...
... **adding** new **users manually** via the CLI: `woodpecker-cli user add`, or
... allowing specific **admin users** via the `WOODPECKER_ADMIN` setting, or
You can **also restrict** registration, by keep registration closed and ...\
... **adding** new **users manually** via the CLI: `woodpecker-cli user add`, or\
... allowing specific **admin users** via the `WOODPECKER_ADMIN` setting, or\
by open registration and **filter by organization** membership through the `WOODPECKER_ORGS` setting.
### To close registration, but allow specific admin users
@ -156,7 +156,7 @@ WOODPECKER_CUSTOM_CSS_FILE=/usr/local/www/woodpecker.js
The examples below show how to place a banner message in the top navigation bar of Woodpecker.
##### woodpecker.css
### woodpecker.css
```css
.banner-message {
@ -172,7 +172,7 @@ The examples below show how to place a banner message in the top navigation bar
}
```
##### woodpecker.js
### woodpecker.js
```javascript
// place/copy a minified version of jQuery or ZeptoJS here ...

View file

@ -21,7 +21,7 @@ Do not use a "GitHub App" instead of an Oauth2 app as the former will not work c
- Name: An arbitrary name for your App
- Homepage URL: The URL of your Woodpecker instance
- Callback URL: `https://<your-woodpecker-instance>/authorize`
- (optional) Upload the Woodpecker Logo: https://avatars.githubusercontent.com/u/84780935?s=200&v=4
- (optional) Upload the Woodpecker Logo: <https://avatars.githubusercontent.com/u/84780935?s=200&v=4>
## Client Secret Creation

View file

@ -5,8 +5,8 @@ Secrets encryption is currently broken and therefore disabled by default. It wil
Check:
- https://github.com/woodpecker-ci/woodpecker/issues/1541 and
- https://github.com/woodpecker-ci/woodpecker/pull/2300
- <https://github.com/woodpecker-ci/woodpecker/issues/1541> and
- <https://github.com/woodpecker-ci/woodpecker/pull/2300>
:::

View file

@ -46,13 +46,13 @@ scrape_configs:
## Unauthenticated Access
Alternatively, the unprotected `/metrics` endpoint might be exposed on the internal port. (Port is configurable via the `WOODPECKER_METRICS_SERVER_ADDR` environment variable, e.g. `:9001`.)
Alternatively, the unprotected `/metrics` endpoint might be exposed on the internal port (Port is configurable via the `WOODPECKER_METRICS_SERVER_ADDR` environment variable, e.g. `:9001`).
## Metric Reference
List of Prometheus metrics specific to Woodpecker:
```
```yaml
# HELP woodpecker_pipeline_count Pipeline count.
# TYPE woodpecker_pipeline_count counter
woodpecker_build_count{branch="main",pipeline="total",repo="woodpecker-ci/woodpecker",status="success"} 3

View file

@ -24,7 +24,7 @@ Install Golang (>=1.20) as described by [this guide](https://go.dev/doc/install)
### Install make
> GNU Make is a tool which controls the generation of executables and other non-source files of a program from the program's source files. (https://www.gnu.org/software/make/)
> GNU Make is a tool which controls the generation of executables and other non-source files of a program from the program's source files (<https://www.gnu.org/software/make/>).
Install make on:

View file

@ -11,23 +11,23 @@ Whenever you change, add or enhance an API endpoint, please update the godocs.
You don't require any extra tools on your machine, all Swagger tooling is automatically fetched by standard Go tools.
### Gin-Handler API documentation guideline
## Gin-Handler API documentation guideline
Here's a typical example of how annotations for Swagger documentation look like...
```text
--- server/api/user.go ---
// @Summary Get a user
// @Description Returns a user with the specified login name. Requires admin rights.
// @Router /users/{login} [get]
// @Produce json
// @Success 200 {object} User
// @Tags Users
// @Param Authorization header string true "Insert your personal access token" default(Bearer <personal access token>)
// @Param login path string true "the user's login name"
// @Summary Get a user
// @Description Returns a user with the specified login name. Requires admin rights.
// @Router /users/{login} [get]
// @Produce json
// @Success 200 {object} User
// @Tags Users
// @Param Authorization header string true "Insert your personal access token" default(Bearer <personal access token>)
// @Param login path string true "the user's login name"
// @Param foobar query string false "optional foobar parameter"
// @Param page query int false "for response pagination, page offset number" default(1)
// @Param perPage query int false "for response pagination, max items per page" default(50)
// @Param page query int false "for response pagination, page offset number" default(1)
// @Param perPage query int false "for response pagination, max items per page" default(50)
```
```text
@ -35,7 +35,7 @@ Here's a typical example of how annotations for Swagger documentation look like.
type User struct {
ID int64 `json:"id" xorm:"pk autoincr 'user_id'"`
// ...
} // @name User
} // @name User
```
These guidelines aim to have consistent wording in the swagger doc:
@ -48,11 +48,11 @@ These guidelines aim to have consistent wording in the swagger doc:
- `@Param Authorization` is almost always present, there are just a few un-protected endpoints
There are many examples in the server/api package, which you can use a blueprint.
More enhanced information you can find here https://github.com/swaggo/swag/blob/main/README.md#declarative-comments-format
More enhanced information you can find here <https://github.com/swaggo/swag/blob/main/README.md#declarative-comments-format>
### Manual code generation
##### generate the server's Go code containing the Swagger
#### generate the server's Go code containing the Swagger
```shell
make generate-swagger
@ -70,8 +70,12 @@ make docs
go run github.com/swaggo/swag/cmd/swag@latest fmt -g server/api/z.go
```
<!-- markdownlint-disable no-space-in-code -->
**WARNING, known issue**: using swag v1.18.12 , there's a bug when running the `fmt` command,
which makes the swagger generator failing, because it can't find the models/structs/types anymore.
To fix it, please replace `// @name\tModelName` with `// @name ModelName`,
which means, replace the tab (`\t`) with a space (` `).
See https://github.com/swaggo/swag/pull/1594 == once this is merged and released, the mentioned issue is obsolete.
See <https://github.com/swaggo/swag/pull/1594> == once this is merged and released, the mentioned issue is obsolete.
<!-- markdownlint-enable no-space-in-code -->

View file

@ -3,7 +3,7 @@
We take security seriously.
If you discover a security issue, please bring it to their attention right away!
### Reporting a Vulnerability
## Reporting a Vulnerability
Please **DO NOT** file a public issue, instead send your report privately to [`security @ woodpecker-ci.org`](mailto:security@woodpecker-ci.org).

View file

@ -33,4 +33,3 @@ You can change the visibility of your project by this setting. If a user has acc
## Timeout
After this timeout a pipeline has to finish or will be treated as timed out.

View file

@ -210,4 +210,3 @@ spec:
- name: sock-dir
emptyDir: {}
```

View file

@ -115,4 +115,3 @@ labels:
steps:
[...]
```

View file

@ -1,11 +1,13 @@
# Example
Compile the yaml to the intermediate representation:
```
```sh
pipec compile
```
Execute the intermediate representation:
```
```sh
pipec exec
```

View file

@ -1,11 +1,13 @@
# Example
Compile the yaml to the intermediate representation:
```
```sh
pipec compile --system-arch windows/amd64
```
Execute the intermediate representation:
```
```sh
pipec exec
```

View file

@ -1,12 +1,14 @@
# Example
Compile the yaml to the intermediate representation:
```
```sh
pipec compile
```
Execute the intermediate representation:
```
```sh
pipec exec
```
@ -15,4 +17,4 @@ by other container. This is useful for example to allow the CI to connect with s
behind a VPN.
Before to start you need to create a container that connects to the VPN (using one of
the openvpn client images like https://github.com/ekristen/docker-openvpn-client).
the openvpn client images like <https://github.com/ekristen/docker-openvpn-client>).

View file

@ -199,4 +199,3 @@ Apache License
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.