woodpecker-ci / woodpecker

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

Steps with the same name #4385

Open zc-devs opened 5 days ago

zc-devs commented 5 days ago

Component

other

Describe the bug

Trying to use steps with the same name, pipeline fails or works wrong.

https://github.com/woodpecker-ci/woodpecker/pull/3411#issuecomment-2194567897:

be aware that steps now can have the same name

Steps to reproduce 1

  1. Make pipeline
    skip_clone: true
    steps:
    notification:
    depends_on:
      - build
    image: alpine
    commands:
      - echo 'Alright'
    build:
    image: alpine
    commands:
      - echo 'Build'
    build:
    image: alpine
    commands:
      - echo 'Test'
    package:
    image: alpine
    commands:
      - echo 'Package'
  2. Get error in editor Screenshot 2024-11-16 1
  3. Run pipeline
  4. Get error in UI Screenshot 2024-11-16 2

⬆️ pipeline with one build step works well.

server-same-name-map.log agent-same-name-map.log

Steps to reproduce 2

  1. Make pipeline
    skip_clone: true
    steps:
    - name: notification
    depends_on:
      - build
    image: alpine
    commands:
      - echo 'Alright'
    - name: build
    image: alpine
    commands:
      - echo 'Build'
    - name: build
    image: alpine
    commands:
      - echo 'Test'
    - name: package
    image: alpine
    commands:
      - echo 'Package'
  2. Run pipeline
  3. See that the only one build step was run (second one with echo Test) Screenshot 2024-11-16 3

server-same-name-array.log agent-same-name-array.log

Expected behavior

System Info

Woodpecker `next-75017ac7ca`, Gitea `1.22.3`, Postgres `16`, Kubernetes `v1.30.6+k3s1`

Additional context

https://github.com/woodpecker-ci/woodpecker/pull/3411#issuecomment-2194567897 https://github.com/woodpecker-ci/woodpecker/pull/3411#discussion_r1844941371

Validations

zc-devs commented 4 days ago

mkdir: can't create directory '/woodpecker/src/': Permission denied

The first pipeline on 2.7.1 works as second on next:

Screenshot 2024-11-17 1

The second pipeline on 2.7.1 works the same way as on next.