woodpecker-ci / woodpecker

Woodpecker is a simple yet powerful CI/CD engine with great extensibility.
https://woodpecker-ci.org
Apache License 2.0
3.89k stars 346 forks source link

Unable to start pipeline on CI agent with "complicated" label filter #3571

Open rockdrilla opened 3 months ago

rockdrilla commented 3 months ago

Component

server, agent

Describe the bug

I'm trying to setup CI agent with several labels but I suppose that filter accounts only last value for each label.

E.g. if WOODPECKER_FILTER_LABELS is set to test_selector=a,test_selector=b then only last part is in effect.

NB: "dedicated" CI agent (with WOODPECKER_FILTER_LABELS=test_selector=a) was shutdown before git push

"offending" pipeline commit: here pending pipeline: here

simplified .woodpecker.yml

when:
  event: [ push, tag, manual ]

steps:

  - name: env
    image: docker.io/library/debian:bookworm-slim
    commands:
      - cat /proc/self/environ | sort -zuV | xargs -0 -r -n 1 printf '%q\n'

labels:
  test_selector: a

simplified docker-compose.yml

services:

  woodpecker:
    image: docker.io/woodpeckerci/woodpecker-server:v2.4.1
    environment:
      WOODPECKER_HOST: https://ci.krd.sh
      WOODPECKER_GITEA: "true"
      WOODPECKER_GITEA_URL: https://git.krd.sh

  woodpecker-agent-test-a:
    image: docker.io/woodpeckerci/woodpecker-agent:v2.4.1
    environment:
      WOODPECKER_SERVER: ci.krd.sh:9000
      WOODPECKER_FILTER_LABELS: "test_selector=a"

  woodpecker-agent-test-b:
    image: docker.io/woodpeckerci/woodpecker-agent:v2.4.1
    environment:
      WOODPECKER_SERVER: ci.krd.sh:9000
      WOODPECKER_FILTER_LABELS: "test_selector=b"

  woodpecker-agent-test-ab:
    image: docker.io/woodpeckerci/woodpecker-agent:v2.4.1
    environment:
      WOODPECKER_SERVER: ci.krd.sh:9000
      WOODPECKER_FILTER_LABELS: "test_selector=a,test_selector=b"

Probably, this issue relates to #2634 and #3483

System Info

https://ci.krd.sh/version

{"source":"https://github.com/woodpecker-ci/woodpecker","version":"2.4.1"}

Additional context

No response

Validations

rockdrilla commented 3 months ago

Also, if I set label to "second" value then pipeline runs fine.

commit: here pipeline: here