You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 8, 2024. It is now read-only.
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.
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
201instead of the usual202.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
201as a failure, which just feels wrong.Any chance we could return an error in this case?