drone / go-convert

Package convert provides tools for converting pipeline configuration files to the Drone format.
Apache License 2.0
11 stars 12 forks source link

[circle] pipeline should not require workflow #123

Open jimsheldon opened 1 year ago

jimsheldon commented 1 year ago

This is a valid circle pipeline:

version: 2.1
orbs:
  browser-tools: circleci/browser-tools@1.2.3
jobs:
  build:
    docker:
      - image: cimg/node:16.19.1-browsers

    working_directory: ~/repo

    steps:
      - browser-tools/install-chrome
      - checkout
      - run: npm ci
      - run: |
          node bin/transifex/restructure.js
          git diff --exit-code -- transifex/strings_en.json
      - run: npm run lint
      - run: npm run test

Conversion fails with no workflows defined.

Our conversion shouldn't require a workflow.

bradrydzewski commented 1 year ago

How does Circle behave when there are 2+ jobs, but no workflows?

The reason I ask is that in yaml, the order of map keys are not guaranteed. This has me wondering how Circle handles a scenario where multiple jobs are defined given the lack of guaranteed job ordering (at least per the yaml spec). For example, given the below yaml with build and test jobs, the yaml spec makes no guarantees that ordering is preserved.


jobs:
  build:
  test:
``
jimsheldon commented 1 year ago

I just tried with this pipeline

version: 2.1

jobs:
  build:
    docker:
      - image: cimg/base:2023.03
    steps:
      - checkout
      - run:
          name: build
          command: echo "this is the build job"
  test:
    docker:
      - image: cimg/base:2023.03
    steps:
      - checkout
      - run:
          name: test
          command: echo "this is the test job"

This is the result https://app.circleci.com/pipelines/github/jimsheldon/sandbox/9/workflows/e4870d97-9c21-47af-8211-c2a83844b889/jobs/10

It appears only the first job ran.

I opened this issue after trying to convert this pipeline https://github.com/getodk/central-frontend/blob/master/.circleci/config.yml, which only has one job.

Perhaps we should support converting the first job when there are no workflows?