# Anatomy of a Pull Request Generator

DevFeed: [Anatomy of a Pull Request Generator](<https://devfeed.tech/articles/anatomy-of-a-pull-request-generator-17671.md>)

Original publisher: [Read original article](<https://codefresh.io/blog/anatomy-of-a-pull-request-generator/>)

Author: Shawn Sesna

Published: 2025-10-02T14:48:57Z

Content type: tutorial

Language: en

Sources: [Codefresh](<https://devfeed.tech/sources/codefresh.md>)

Topics: [Argo CD](<https://devfeed.tech/topics/argo-cd.md>), [Pull Request](<https://devfeed.tech/topics/pull-request.md>), [GitOps](<https://devfeed.tech/topics/gitops.md>), [API](<https://devfeed.tech/topics/api.md>), [hosting](<https://devfeed.tech/topics/hosting.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [applicationset](<https://devfeed.tech/tags/applicationset.md>), [argo-cd](<https://devfeed.tech/tags/argo-cd.md>), [bearer-token](<https://devfeed.tech/tags/bearer-token.md>), [bitbucket](<https://devfeed.tech/tags/bitbucket.md>), [branch](<https://devfeed.tech/tags/branch.md>), [configuration](<https://devfeed.tech/tags/configuration.md>), [credentials](<https://devfeed.tech/tags/credentials.md>), [environment](<https://devfeed.tech/tags/environment.md>), [ephemeral](<https://devfeed.tech/tags/ephemeral.md>), [filter](<https://devfeed.tech/tags/filter.md>), [generator](<https://devfeed.tech/tags/generator.md>), [git](<https://devfeed.tech/tags/git.md>), [gitops](<https://devfeed.tech/tags/gitops.md>), [kubernetes](<https://devfeed.tech/tags/kubernetes.md>), [pull-request](<https://devfeed.tech/tags/pull-request.md>), [pull-requests](<https://devfeed.tech/tags/pull-requests.md>), [repository](<https://devfeed.tech/tags/repository.md>), [technical-guides](<https://devfeed.tech/tags/technical-guides.md>)

## AI overview

Argo CD's Pull Request Generator uses an ApplicationSet to watch a repository and deploy matching pull requests into separate ephemeral environments, then removes their resources when the PR closes. The Bitbucket Server setup requires a project key, repository name, API URL, and either BasicAuth or a bearer token stored in a Kubernetes Secret. The example polls every 120 seconds (the default is 30 minutes), filters by source branch with a regular expression, and uses the PR head SHA and branch/number to select the revision and create a unique namespace. Bitbucket Server does not support label filtering in this configuration; frequent polling may hit cloud provider API rate limits.

## Source excerpt

Argo CD has built a number of Generators to support various scenarios that developers need when using Argo CD and Kubernetes. In this post, I'll be discussing the Pull Request Generator. A Pull Request Generator is an Argo CD Application Set deployment type that is configured to "watch" a Git repository for Pull Requests (PRs). [...] The post Anatomy of a Pull Request Generator appeared first on Codefresh.