CircleCI Ideas

Support build_parameters for new "/build" endpoint

The new "trigger a build by project" endpoint in practice triggers entire workflows and not singular jobs. In other words, it does not support specifying a job to trigger via build_parameters the way the other API job trigger does.

It would be greatly appreciated if the new endpoint could be made to support build_parameters so as to target particular jobs and not entire workflows. Our primary use case for wanting to trigger jobs outside of a workflow context via the API is ad-hoc mobile app submissions via our Hubot app in Slack. I imagine there would be other uses - there are plenty of opportunities for CircleCI-powered automation outside of a workflow context.

This would be especially helpful given that the other API job triggering endpoint is not supported when using the 2.1 configuration.

  • Avatar32.5fb70cce7410889e661286fd7f1897de Guest
  • Nov 14 2018
  • On roadmap
API
  • Attach files
  • Avatar40.8f183f721a2c86cd98fddbbe6dc46ec9
    Guest commented
    November 16, 2018 08:32

    While I see the point of collecting use cases, in my world, a minor version upgrade which removes an existing capability (https://circleci.com/docs/2.0/api-job-trigger/#section=jobs) is called a regression, not a new idea...

  • Admin
    Nathan Dintenfass commented
    November 17, 2018 06:52

    There may have been a miscommunication because the endpoint in question was not removed. We added a new endpoint that behaves differently (and that we will be improving), but the old endpoint will work the same way they used to (with one important caveat -- the old endpoint cannot be used after you turn on build processing. The good news is that this is a temporary but unfortunate state because it forces a choice between sending these kinds of requests to CircleCI and using 2.1 config or the other features enabled by build processing. We are looking to provide an expanded build-triggering API that will be fully compatible with build processing and provide similar flexibility of the older endpoint for triggering individual jobs.

  • Avatar40.8f183f721a2c86cd98fddbbe6dc46ec9
    Guest commented
    November 19, 2018 18:56

    Nathan - while it's true that the older API job trigger was not removed, it was rendered non-functional when moving from a 2.0 to a 2.1 config. That is *functionally* a regression, at least as experienced by those of us attempting to use the 2.1 config. I believe that is what the guest commenter was driving at with "a minor version upgrade which removes an existing capability." That the endpoint still exists isn't really a meaningful distinction to make when the very problem this feature request stemmed from is the inability to actually use said endpoint.

    I understand and appreciate the explanation of why the older build trigger isn't yet supported with 2.1 configs. The experience would have been much less jarring on my end had that explanation been offered up-front, preferably as an addendum to existing API documentation.

  • Avatar40.8f183f721a2c86cd98fddbbe6dc46ec9
    Guest commented
    December 08, 2018 14:53

    the build_parameters is also useful if we want to inject additional env variables in a workflow build. we definitely need this

  • Avatar40.8f183f721a2c86cd98fddbbe6dc46ec9
    Guest commented
    15 Jan 19:12

    This such a huge oversight, i can't actually believe it. I spent so much time converting to 2.1 only to discover that the api doesn't work anymore. Now i have to decided if i'm willing to live without the triggers for a while or do i revert back to 2.0, i'm so irritated right now...

  • Avatar40.8f183f721a2c86cd98fddbbe6dc46ec9
    Guest commented
    21 Jan 14:28

    Migrating to 2.1 was a huge waste of time. Yes, it is clearly a regression.

  • Avatar40.8f183f721a2c86cd98fddbbe6dc46ec9
    Guest commented
    11 Feb 23:25

    100% need this for my specific use case

  • Avatar40.8f183f721a2c86cd98fddbbe6dc46ec9
    Guest commented
    15 Feb 08:52

    Also spent time migrating to 2.1 and had to move back to 2.0 because we need an API to trigger a single job (automated code review in our case).

  • Avatar40.8f183f721a2c86cd98fddbbe6dc46ec9
    Guest commented
    07 Mar 19:44

    This has been the state of affairs for nearly 4 months now, and it is not well documented or communicated. Can we get a timeline for when this will get resolved?

  • Avatar40.8f183f721a2c86cd98fddbbe6dc46ec9
    Guest commented
    16 Mar 23:37

    Really need this for hooking up downstream project builds; need to pass upstream information in such as tag, build number, etc.

  • Avatar40.8f183f721a2c86cd98fddbbe6dc46ec9
    Guest commented
    01 Apr 14:07

    Hello, we are also waiting for this functionality since november. Is it possible to have an ETA? Thank in advance.

  • Avatar40.8f183f721a2c86cd98fddbbe6dc46ec9
    Guest commented
    08 Apr 13:54

    Would love to hear an update on this. We build a white label app and would love to be able to supply build parameters to several instances to be able to update all of our white label apps. To do this we need to be able to pass in build_parameters. Any ETA? Or a different way to achieve our goal?

  • Admin
    Nathan Dintenfass commented
    08 Apr 17:56

    Our plan is to provide a slightly different mechanism for injecting variables. Now that our "build processing" is called "pipelines" we'll be launching a v2 of our API that allows triggering a pipeline with parameters. However, unlike the old job triggering endpoint, we won't be injecting those parameters directly into your job as environment variables. Instead, we'll make those variables available during config processing and force them to be declared in config. This is both safer and more deterministic. It will also let you use pipeline parameters in config structures such as working directory or to set the tag on an image, etc. You can view a preview of our plans on this front here: https://github.com/CircleCI-Public/api-preview-docs/blob/master/docs/pipeline-parameters.md 

  • Avatar40.8f183f721a2c86cd98fddbbe6dc46ec9
    Guest commented
    08 Apr 20:31

    Are there any timelines for when the API v2 will be released?

  • Admin
    Nathan Dintenfass commented
    09 Apr 01:45

    We'll be rolling out v2 one endpoint at a time, starting with `GET /workflows/:id` and `GET /workflows/:id/jobs`. We'll be updating this repo as we roll things out in preview: https://github.com/CircleCI-Public/api-preview-docs

  • Avatar40.8f183f721a2c86cd98fddbbe6dc46ec9
    Guest commented
    15 Apr 16:24

    I ended up again on the same "issue" after another 2.1 upgrade. I just forgot about it (or secretly hoped it was fixed).

    This "new idea" (considered by all your customers as a regression) has be raised in Nov 2018. There are multiple forum entries like https://discuss.circleci.com/t/circleci-2-1-is-it-possible-to-trigger-a-job-through-api/26294/3 and multiple of your customers are stuck (and frustrated) with their 2.1 upgrade.

    There is a "on roadmap" label on the idea, why are you not be able to provide a clear status and an ETA ?

    The public API documentation is still not clear about the real working 2.0 vs 2.1 capabilities while the git repo you shared does not contain anything useful.