drone / drone/go-convert

[bitbucket] parallel steps without the explicit 'steps' property fail to convert

Open
#2 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bitbucket bug
Dominant language
Go
Stars
16
Forks
31
Avg merge
2d 23h
Merged PRs (30d)
5

Description

This is a valid bitbucket-pipelines.yaml file:

image: atlassian/default-image:3

pipelines:
  default:
    - parallel:
      - step:
          name: 'Build and Test'
          script:
            - echo "Your build and test goes here..."
      - step:
          name: 'Lint'
          script:
            - echo "Your linting goes here..."
      - step:
          name: 'Security scan'
          script:
            - echo "Your security scan goes here..."

Conversion fails with this error:

./go-convert bitbucket bitbucket-pipelines.yml
2023/03/06 14:46:36 yaml: unmarshal errors:
  line 6: cannot unmarshal !!seq into yaml.Parallel

The current conversion logic requires a steps property beneath the parallel property.

This yaml converts successfully:

image: atlassian/default-image:3

pipelines:
  default:
    - parallel:
        steps:
        - step:
            name: 'Build and Test'
            script:
              - echo "Your build and test goes here..."
        - step:
            name: 'Lint'
            script:
              - echo "Your linting goes here..."
        - step:
            name: 'Security scan'
            script:
              - echo "Your security scan goes here..."
./go-convert bitbucket bitbucket-pipelines.yml 
stages:
- name: build
  spec:
    steps:
    - name: parallel
      spec:
        steps:
        - name: Build and Test
          spec:
            image: atlassian/default-image:3
            run: echo "Your build and test goes here..."
          type: script
        - name: Lint
          spec:
            image: atlassian/default-image:3
            run: echo "Your linting goes here..."
          type: script
        - name: Security scan
          spec:
            image: atlassian/default-image:3
            run: echo "Your security scan goes here..."
          type: script
      type: parallel
  type: ci
version: 1

We should update the logic to allow steps to be optional.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the go-convert bitbucket bitbucket-pipelines.yml entry point and locate the Bitbucket parallel-step parsing and conversion logic. Use the first YAML example as a regression case; done means both parallel forms, with and without an explicit steps property, convert successfully to the expected Drone format.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.