Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add head_branches and ignore_head_branches to filter PRs based on head branch name #185

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ctreatma
Copy link

@ctreatma ctreatma commented Jan 13, 2020

For some workflows, it can be useful to treat pull requests differently
depending on the name of the head branch for the pull request.

For example, a team following scaled trunk-based development might use
the release/* naming convention for release branches, and may have
different build/deploy processes for those release branches.

This adds a head_branches option and an ignore_head_branches option
to this resource, specified as a glob pattern to align with similar filters on the
Concourse git resource, as well as with the paths and ignore_paths
options on this resource.

See: https://trunkbaseddevelopment.com/#scaled-trunk-based-development

@ctreatma ctreatma requested a review from a team as a code owner January 13, 2020 15:27
@ctreatma ctreatma changed the title Add head_branch_filter to filter PRs based on head branch name Add head_branches and `ignore_head_branches to filter PRs based on head branch name Feb 12, 2020
@ctreatma ctreatma changed the title Add head_branches and `ignore_head_branches to filter PRs based on head branch name Add head_branches and ignore_head_branches to filter PRs based on head branch name Feb 12, 2020
@ctreatma ctreatma force-pushed the feature/head_branch_filter branch from b273669 to 889c714 Compare May 6, 2020 14:04
@ctreatma ctreatma force-pushed the feature/head_branch_filter branch from 889c714 to a732c70 Compare June 3, 2020 15:25
@ctreatma
Copy link
Author

Any thoughts on this? We've been using it for a while now to allow us to define separate workflows for release branches and feature development branches; using the pr resource in this manner allows our Concourse pipelines to pick up arbitrary release branches without having to reconfigure the pipeline (which we would have to do in order to run against new branches using the git resource).

For some workflows, it can be useful to treat pull requests differently
depending on the name of the head branch for the pull request.

For example, a team following scaled trunk-based development might use
the `release/*` naming convention for release branches, and may have
different build/deploy processes for those release branches.

This adds `head_branches` and `ignore_head_branches` settings to this
resource, specified as a glob pattern to align with similar filters on
the Concourse git resource, so that teams can run different jobs based
on the head branch of a PR.

See: https://trunkbaseddevelopment.com/#scaled-trunk-based-development
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant