Skip to content
This repository was archived by the owner on Feb 8, 2024. It is now read-only.
This repository was archived by the owner on Feb 8, 2024. It is now read-only.

POST /pipeline Returns 201 When No Actual Workflow Is Triggered #74

@TheMetalCode

Description

@TheMetalCode

Example: In my org for certain projects we have a special workflow that is API triggered (via the POST /pipeline endpoint with pipeline params) and reserved for only certain branches (filtered by regex in the .circleci/config.yml for affected projects).

Today we had an issue where somebody was trying to trigger that workflow for a branch that didn't match the filter, and my API wrapper didn't catch it because it wasn't an error response from the API, but rather a 201 instead of the usual 202.

Because the response code differs, we seem to have some ability to discern when the call actually launched a workflow and when it did not. My view: a reasonable API consumer expects a workflow to be actually launched when a successful response code is returned, and if it isn't, they would want an error response to alert them to potentially update their .circleci/config.yml.

Right now I'm in the somewhat uncomfortable position of needing to handle a 201 as a failure, which just feels wrong.

Any chance we could return an error in this case?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions