Skip to content

Commit

Permalink
Merge branch 'main' into report-problems-with-listening-to-ports
Browse files Browse the repository at this point in the history
  • Loading branch information
qwerty287 authored Sep 18, 2023
2 parents 3a2080d + 1653a8e commit 8e74584
Show file tree
Hide file tree
Showing 188 changed files with 5,915 additions and 3,532 deletions.
40 changes: 40 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:recommended", ":maintainLockFilesWeekly"],
"prConcurrentLimit": 5,
"packageRules": [
{
"matchManagers": ["docker-compose"],
"matchFileNames": ["docker-compose.gitpod.yml"],
"labels": ["devx"]
},
{
"matchManagers": ["gomod", "npm", "dockerfile"],
"labels": ["dependencies"]
},
{
"matchManagers": ["woodpecker"],
"labels": ["build"]
},
{
"groupName": "golang deps non-major",
"matchManagers": ["gomod"],
"matchUpdateTypes": ["minor", "patch"],
"extends": ["schedule:daily"]
},
{
"groupName": "web npm deps non-major",
"matchManagers": ["npm"],
"matchUpdateTypes": ["minor", "patch"],
"matchFileNames": ["web/package.json"],
"extends": ["schedule:daily"]
},
{
"groupName": "docs npm deps non-major",
"matchManagers": ["npm"],
"matchUpdateTypes": ["minor", "patch"],
"matchFileNames": ["docs/**/package.json"],
"extends": ["schedule:daily"]
}
]
}
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"prettier.configPath": "./web/.prettierrc.js",
"prettier.ignorePath": "./web/.prettierignore",
"cSpell.words": [
"Curr",
"doublestar",
"multierr"
]
Expand Down
4 changes: 2 additions & 2 deletions .woodpecker/binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ when:
event: tag

variables:
- &golang_image 'golang:1.20.2'
- &node_image 'node:18-alpine'
- &golang_image 'golang:1.21.1'
- &node_image 'node:20-alpine'
- &xgo_image 'techknowlogick/xgo:go-1.20.2'
- &xgo_version 'go-1.20.2'

Expand Down
19 changes: 17 additions & 2 deletions .woodpecker/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ depends_on:
- web

variables:
- &golang_image 'golang:1.20.2'
- &node_image 'node:18-alpine'
- &golang_image 'golang:1.21.1'
- &node_image 'node:20-alpine'
- &xgo_image 'techknowlogick/xgo:go-1.20.2'
- &xgo_version 'go-1.20.2'
- &platforms_release 'linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/386,linux/amd64,linux/ppc64le,linux/riscv64,linux/s390x,freebsd/arm64,freebsd/amd64,openbsd/arm64,openbsd/amd64'
- &platforms_server 'linux/arm/v7,linux/arm64/v8,linux/amd64,linux/ppc64le,linux/riscv64'
- &platforms_preview 'linux/amd64'
- &platforms_alpine 'linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/amd64,linux/ppc64le'
- &build_args 'CI_COMMIT_SHA=${CI_COMMIT_SHA},CI_COMMIT_BRANCH=${CI_COMMIT_BRANCH},CI_COMMIT_TAG=${CI_COMMIT_TAG}'

# vars used on push / tag events only
- publish_logins: &publish_logins
Expand Down Expand Up @@ -201,6 +202,7 @@ steps:
dockerfile: docker/Dockerfile.agent.multiarch
platforms: *platforms_preview
tag: pull_${CI_COMMIT_PULL_REQUEST}
build_args: *build_args
when:
event: pull_request

Expand All @@ -213,6 +215,7 @@ steps:
platforms: *platforms_release
tag: [next, "next-${CI_COMMIT_SHA:0:10}"]
logins: *publish_logins
build_args: *build_args
when:
branch: ${CI_REPO_DEFAULT_BRANCH}
event: push
Expand All @@ -226,6 +229,7 @@ steps:
platforms: *platforms_alpine
tag: [next-alpine, "next-${CI_COMMIT_SHA:0:10}-alpine"]
logins: *publish_logins
build_args: *build_args
when:
branch: ${CI_REPO_DEFAULT_BRANCH}
event: push
Expand All @@ -239,6 +243,7 @@ steps:
platforms: *platforms_release
tag: ${CI_COMMIT_BRANCH##release/}
logins: *publish_logins
build_args: *build_args
when:
branch: release/*
event: push
Expand All @@ -252,6 +257,7 @@ steps:
platforms: *platforms_alpine
tag: ${CI_COMMIT_BRANCH##release/}
logins: *publish_logins
build_args: *build_args
when:
branch: release/*
event: push
Expand All @@ -266,6 +272,7 @@ steps:
# remove 'latest' on older version branches to avoid accidental downgrade
tag: [latest, "${CI_COMMIT_TAG}"]
logins: *publish_logins
build_args: *build_args
when:
event: tag

Expand All @@ -279,6 +286,7 @@ steps:
# remove 'latest-alpine' on older version branches to avoid accidental downgrade
tag: [latest-alpine, "${CI_COMMIT_TAG}-alpine"]
logins: *publish_logins
build_args: *build_args
when:
event: tag

Expand All @@ -295,6 +303,7 @@ steps:
dockerfile: docker/Dockerfile.cli.multiarch
platforms: *platforms_preview
tag: pull_${CI_COMMIT_PULL_REQUEST}
build_args: *build_args
when:
event: pull_request

Expand All @@ -307,6 +316,7 @@ steps:
platforms: *platforms_release
tag: [next, "next-${CI_COMMIT_SHA:0:10}"]
logins: *publish_logins
build_args: *build_args
when:
branch: ${CI_REPO_DEFAULT_BRANCH}
event: push
Expand All @@ -320,6 +330,7 @@ steps:
platforms: *platforms_alpine
tag: [next-alpine, "next-${CI_COMMIT_SHA:0:10}-alpine"]
logins: *publish_logins
build_args: *build_args
when:
branch: ${CI_REPO_DEFAULT_BRANCH}
event: push
Expand All @@ -333,6 +344,7 @@ steps:
platforms: *platforms_release
tag: ${CI_COMMIT_BRANCH##release/}
logins: *publish_logins
build_args: *build_args
when:
branch: release/*
event: push
Expand All @@ -346,6 +358,7 @@ steps:
platforms: *platforms_alpine
tag: ${CI_COMMIT_BRANCH##release/}
logins: *publish_logins
build_args: *build_args
when:
branch: release/*
event: push
Expand All @@ -360,6 +373,7 @@ steps:
# remove 'latest' on older version branches to avoid accidental downgrade
tag: [latest, "${CI_COMMIT_TAG}"]
logins: *publish_logins
build_args: *build_args
when:
event: tag

Expand All @@ -373,5 +387,6 @@ steps:
# remove 'latest-alpine' on older version branches to avoid accidental downgrade
tag: [latest-alpine, "${CI_COMMIT_TAG}-alpine"]
logins: *publish_logins
build_args: *build_args
when:
event: tag
4 changes: 2 additions & 2 deletions .woodpecker/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ when:
event: cron

variables:
- &golang_image 'golang:1.20.2'
- &node_image 'node:18-alpine'
- &golang_image 'golang:1.21.1'
- &node_image 'node:20-alpine'

steps:
build-cli:
Expand Down
14 changes: 14 additions & 0 deletions .woodpecker/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
steps:
release:
image: woodpeckerci/plugin-ready-release-go
pull: true
settings:
release_branch: ${CI_REPO_DEFAULT_BRANCH}
forge_type: github
git_email: woodpecker-bot@obermui.de
github_token:
from_secret: GITHUB_TOKEN

when:
event: push
branch: ${CI_REPO_DEFAULT_BRANCH}
2 changes: 1 addition & 1 deletion .woodpecker/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ when:
- release/*

variables:
- &golang_image 'golang:1.20.2'
- &golang_image 'golang:1.21.1'
- &when
- path: &when_path
# related config files
Expand Down
2 changes: 1 addition & 1 deletion .woodpecker/web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ when:
- release/*

variables:
- &node_image 'node:18-alpine'
- &node_image 'node:20-alpine'
- &when
path:
# related config files
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## [1.0.2](https://github.com/woodpecker-ci/woodpecker/releases/tag/v1.0.2) - 2023-08-16

* SECURITY
* Validate webhook before change any data (#2221) (#2222)
* BUGFIXES
* Bump default git clone plugin (#2215) (#2220)
* Show all steps (#2190) (#2191)

## [1.0.1](https://github.com/woodpecker-ci/woodpecker/releases/tag/v1.0.1) - 2023-08-08

* SECURITY
Expand Down
34 changes: 19 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GO_PACKAGES ?= $(shell go list ./... | grep -v /vendor/)

TARGETOS ?= linux
TARGETARCH ?= amd64
TARGETOS ?= $(shell go env GOOS)
TARGETARCH ?= $(shell go env GOARCH)

BIN_SUFFIX :=
ifeq ($(TARGETOS),windows)
Expand All @@ -10,19 +10,24 @@ endif

VERSION ?= next
VERSION_NUMBER ?= 0.0.0
CI_COMMIT_SHA ?= $(shell git rev-parse HEAD)

# it's a tagged release
ifneq ($(CI_COMMIT_TAG),)
VERSION := $(CI_COMMIT_TAG:v%=%)
VERSION_NUMBER := ${VERSION}
endif

# append commit-sha to next version
BUILD_VERSION ?= $(VERSION)
ifeq ($(BUILD_VERSION),next)
CI_COMMIT_SHA ?= $(shell git rev-parse HEAD)
BUILD_VERSION := $(shell echo "next-$(shell echo ${CI_COMMIT_SHA} | head -c 8)")
VERSION_NUMBER := ${CI_COMMIT_TAG:v%=%}
else
# append commit-sha to next version
ifeq ($(VERSION),next)
VERSION := $(shell echo "next-$(shell echo ${CI_COMMIT_SHA} | cut -c -10)")
endif
# append commit-sha to release branch version
ifeq ($(shell echo ${CI_COMMIT_BRANCH} | cut -c -9),release/v)
VERSION := $(shell echo "$(shell echo ${CI_COMMIT_BRANCH} | cut -c 10-)-$(shell echo ${CI_COMMIT_SHA} | cut -c -10)")
endif
endif

LDFLAGS := -s -w -extldflags "-static" -X github.com/woodpecker-ci/woodpecker/version.Version=${BUILD_VERSION}
LDFLAGS := -s -w -extldflags "-static" -X github.com/woodpecker-ci/woodpecker/version.Version=${VERSION}
CGO_ENABLED ?= 1 # only used to compile server

HAS_GO = $(shell hash go > /dev/null 2>&1 && echo "GO" || echo "NOGO" )
Expand All @@ -45,7 +50,6 @@ ifeq (in_docker,$(firstword $(MAKECMDGOALS)))
@docker run -it \
--user $(shell id -u):$(shell id -g) \
-e VERSION="$(VERSION)" \
-e BUILD_VERSION="$(BUILD_VERSION)" \
-e CI_COMMIT_SHA="$(CI_COMMIT_SHA)" \
-e TARGETOS="$(TARGETOS)" \
-e TARGETARCH="$(TARGETARCH)" \
Expand All @@ -63,7 +67,7 @@ all: help

.PHONY: version
version: ## Print the current version
@echo ${BUILD_VERSION}
@echo ${VERSION}

# The help target prints out all targets with their descriptions organized
# beneath their categories. The categories are represented by '##@' and the
Expand Down Expand Up @@ -134,7 +138,7 @@ ui-dependencies: ## Install UI dependencies
.PHONY: lint
lint: install-tools ## Lint code
@echo "Running golangci-lint"
golangci-lint run --timeout 10m
golangci-lint run --timeout 15m
@echo "Running zerolog linter"
lint github.com/woodpecker-ci/woodpecker/cmd/agent
lint github.com/woodpecker-ci/woodpecker/cmd/cli
Expand Down Expand Up @@ -163,7 +167,7 @@ test-server-datastore-coverage: ## Test server datastore with coverage report

test-ui: ui-dependencies ## Test UI code
(cd web/; pnpm run lint)
(cd web/; pnpm run formatcheck)
(cd web/; pnpm run format:check)
(cd web/; pnpm run typecheck)
(cd web/; pnpm run test)

Expand Down
4 changes: 2 additions & 2 deletions agent/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"github.com/woodpecker-ci/woodpecker/pipeline/rpc"
)

func (r *Runner) createLogger(logger zerolog.Logger, uploads *sync.WaitGroup, work *rpc.Pipeline) pipeline.LogFunc {
func (r *Runner) createLogger(logger zerolog.Logger, uploads *sync.WaitGroup, workflow *rpc.Workflow) pipeline.LogFunc {
return func(step *backend.Step, rc multipart.Reader) error {
loglogger := logger.With().
Str("image", step.Image).
Expand All @@ -41,7 +41,7 @@ func (r *Runner) createLogger(logger zerolog.Logger, uploads *sync.WaitGroup, wo
uploads.Add(1)

var secrets []string
for _, secret := range work.Config.Secrets {
for _, secret := range workflow.Config.Secrets {
if secret.Mask {
secrets = append(secrets, secret.Value)
}
Expand Down
2 changes: 1 addition & 1 deletion agent/rpc/auth_interceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func (interceptor *AuthInterceptor) refreshToken() error {
}

interceptor.accessToken = accessToken
log.Debug().Msgf("Token refreshed: %v", accessToken)
log.Trace().Msg("token refreshed")

return nil
}
Loading

0 comments on commit 8e74584

Please sign in to comment.