Skip to content

Support for building arbitrary git branches based off regex for branch name (without requiring a GitHub pull request) #239

Closed

Description

@thewoolleyman

E.g. like Circle CI, [Travis CI](https://docs.travis-ci.com/user/customizing-the-build/#sts=Building Specific Branches), and Jenkins (although GoCD apparently still doesn't)

This is necessary for our workflows (on the Pivotal Tracker sub-teams), because we often work on feature branches, and want these branches to automatically build, run tests, deploy to a test PWS instance for acceptance, etc., without having to manually add the branches/jobs/etc to the concourse config and redeploy.

As an example, we already have this working, implemented as a reusable resource and a reusable job than can perform any arbitrary build tasks for any arbitrary branches:

https://github.com/pivotaltracker/git-branches-resource
https://github.com/pivotaltracker/concourse-branch-manager

This is all well tested, documented, standalone, and open source. We would be glad to contribute this back to the Concourse community as soon as there's a official place to do that.

Thanks,
-- Chad

Activity

  1. concourse-bot commented on Dec 21, 2015

    @concourse-bot

    Hi there!

    We use Pivotal Tracker to provide visibility into what our team is working on. A story for this issue has been automatically created.

    The current status is as follows:

    • #110526796 Support for building arbitrary git branches based off regex for branch name (without requiring a GitHub pull request)

    This comment, as well as the labels on the issue, will be automatically updated as the status in Tracker changes.

  2. thewoolleyman commented on Apr 13, 2016

    @thewoolleyman
    Author

    Post-1.0 ping as requested @vito

  3. thewoolleyman commented on Apr 13, 2016

    @thewoolleyman
    Author

    Ideally, this should not be tied to Pull Requests, because many teams do not use PRs for branches.

  4. jkamenik commented on Apr 29, 2016

    @jkamenik

    👍

  5. muv commented on Jun 28, 2016

    @muv

    @thewoolleyman Haven't seen the ability to build from pull requests in the official docs. Are you refering to https://github.com/jtarchie/pullrequest-resource?

  6. muv commented on Jun 28, 2016

    @muv

    For implementation, I'd like to have jobs with parameters that are passed to fly instead of generating and destroying pipelines. So that I could fly trigger-job mypipeline/build myrepo/test-branch and so.

  7. thewoolleyman commented on Jun 28, 2016

    @thewoolleyman
    Author

    @muv yes, the PR resource works, and is a simpler approach, but it has some UX drawbacks compared to the branch-manager approach (aside from requiring the use of PRs, it's difficult to find and re-run builds for specific branches/PRs).

    However, it is also much more efficient and less resource intensive (many containers are created with the branch-manager approach), so the PR resource may be a good choice for teams with
    many active branches and sensitivity to resource cost (read: are running on AWS).

    Everything considered, the lack of official support for building feature branches in an efficient way with a reasonable UX is still a significant barrier to concourse adoption for any team which actively uses feature branches, whether they are via PRs or not.

  8. muv commented on Jun 28, 2016

    @muv

    Exactly. Reading official docs I wondered for awhile how to build feature branches. Until I finally realized how to compose a proper google request and found this.

  9. vito commented on Jul 13, 2016

    @vito
    Contributor

    There are two approaches made possible by version: every without the need for a separate server.

    Travis-style: see #525 (comment)

    Pipeline per branch: you could use a git-branches resource (which I'd forgotten you already wrote, but mine's a bit different) and a concourse-pipeline resource (which just needs support for deleting pipelines: see concourse/concourse-pipeline-resource#10).

    I also want to put together a plan for having pipeline hierarchies, so you don't end up with a flat set of pipelines with generated names for each branch: #532

  10. 10 remaining items

  11. thewoolleyman commented on Jul 15, 2016

    @thewoolleyman
    Author

    @vito So, how exactly do you envision the git-branch-heads-resource being used?

    It doesn't seem necessary for the pipeline-per-branch approach, right? All that needs is a list of branches which changed via the git-branches-resource, and the the concourse-pipeline-resource would then create/delete pipelines based on existing branches which match the regex. Then, each created per-branch pipeline would just use the standard git-resource pointing to the branch (which is exactly what concourse-branch-manager does).

  12. vito commented on Jul 15, 2016

    @vito
    Contributor

    @thewoolleyman It's not necessary but is much simpler for less complicated projects where you just want assistance from CI to give you a feedback loop at the unit level.

  13. thewoolleyman commented on Jul 15, 2016

    @thewoolleyman
    Author

    @vito Makes sense. I'd like to see an example of it used in an actual pipeline/job, though (once it's written), to see how it could be used to manage the build of multiple branches.

  14. vito commented on Sep 25, 2016

    @vito
    Contributor
  15. vito commented on Dec 30, 2016

    @vito
    Contributor

    I think enough has come out of this discussion to warrant closing the issue; there are a few approaches that work to varying levels, and what's left isn't very actionable as it's kind of open-ended.

  16. mzelinsky commented on Jun 2, 2017

    @mzelinsky

    can we reopen this issue as concourse-pipeline-resource is not really suitable for the task (due to concourse/concourse-pipeline-resource#10 which is not yet implemented)? it seems the concourse is the only CI/CD that doesn't have a proper support for multiple branches, in terms of UX and overall workflow experience.

  17. vito commented on Nov 3, 2017

    @vito
    Contributor

    For all those keeping up with this issue, please see #1707 and the stories it led to. :)

    See also our post announcing it (which...basically just links to that issue).

  18. thewoolleyman commented on Nov 4, 2017

    @thewoolleyman
    Author

    @vito Awesome, thanks for putting in the hard work to come up with a good solution to this.

  19. added a commit that references this issue on Jan 11, 2018
  20. added a commit that references this issue on Jan 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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