Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
b396e38
ref(pipedream): Adding grouping support
IanWoodard Dec 19, 2025
b7f83e8
cascade pipeline and stage level environment variables down to the jo…
mchen-sentry Jan 6, 2026
fc8e0c4
ref(pipedream): env var optimization, s4s2 alignment, and test coverage
mchen-sentry Mar 25, 2026
80f55b9
ref(pipedream): add build-time validation for conflicting stage prope…
mchen-sentry Apr 9, 2026
c113d47
ref(pipedream): add single-key stage object assertion
mchen-sentry Apr 9, 2026
54a9589
update repo readme to reflect grouping
mchen-sentry Mar 3, 2026
768b0cb
ref(pipedream): remove s4s group
mchen-sentry Apr 9, 2026
d526218
fix(pipedream): restore s4s2 as a prod group
mchen-sentry Apr 15, 2026
9a0fa40
chore: remove working notes from branch
mchen-sentry Apr 15, 2026
5954fc9
fix(pipedream): restore fetch_materials on pipeline-complete stages, …
mchen-sentry Apr 15, 2026
395e72b
chore: fix prettier formatting in test/pipedream.js
mchen-sentry Apr 15, 2026
c1cd572
fix(getsentry): update is_st to match s4s2 and fix jsonnetfmt formatting
mchen-sentry Apr 15, 2026
ecff2a6
fix(getsentry): remove dead s4s check from is_st
mchen-sentry Apr 15, 2026
60e6f40
fix(pipedream): improve stage props conflict error message
mchen-sentry Apr 15, 2026
f730e65
chore: add clarifying comments for test_groups and stage collection
mchen-sentry Apr 15, 2026
3465d94
ref(pipedream): add pipeline-level attribute validation across regions
mchen-sentry Apr 15, 2026
f471ace
feat(pipedream): per-region targeting via PIPEDREAM_GROUP_REGIONS
mchen-sentry Apr 27, 2026
1d56a8c
Merge remote-tracking branch 'origin/main' into iw/grouped-pipedream
mchen-sentry Apr 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 36 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ When `output-files=true` it'll output pipelines in the format:
```

This is useful when you build using the `-m` flag in jsonnet as it'll output
multiple files which makes reviewing pipeliens easier.
multiple files which makes reviewing pipelines easier.

```bash
jsonnet --ext-code output-files=true -m ./generated-pipelines ./example.jsonnet
```

The GoCD plugin that can process jsonnet files directly doesn't support
outputting multiple files, so GoCD is configured to have
`--ext-code output-filaes=false` which will output the pipelines in a flattened
`--ext-code output-files=false` which will output the pipelines in a flattened
format:

```json
Expand Down Expand Up @@ -87,8 +87,40 @@ Pipedream will name the returned pipeline, add an upstream pipeline material and
a final stage. The upstream material and final stage is needed to make GoCD
chain the pipelines together.

The end result will be a pipeline `deploy-<service name>` that starts the run of
each pipeline, and a pipeline for each region.
Regions are organized into **groups** (defined in `getsentry.libsonnet`). Each
group produces a single GoCD pipeline where regions within the group run as
parallel jobs. Groups are chained sequentially by default, or can fan out in
parallel via `pipedream.render(config, pipeline_fn, parallel=true)`.

The end result is a trigger pipeline `deploy-<service name>` and a pipeline per
group (e.g. `deploy-example-s4s2`, `deploy-example-st`).

`control` and `snty-tools` are excluded by default; use `include_regions` to
opt in.

Environment variables set at the pipeline or stage level in `pipeline_fn` are
handled automatically: variables identical across all regions in a group stay at
the stage level, while region-specific variables are cascaded to the job level.
GoCD resolves precedence as job > stage > pipeline.

### Targeting a subset of regions

By default, triggering a group pipeline deploys to every region in the group.
To deploy to a subset, override `PIPEDREAM_GROUP_REGIONS` on the Environment
Variables tab in GoCD's "Trigger with options".

For example, on `deploy-foo-st` whose default is
`customer-1,customer-2,customer-4,customer-7`:

| Override value | Result |
| ----------------------- | ------------------------------------- |
| (no override) | All four regions deploy |
| `customer-1` | Only customer-1 deploys |
| `customer-1,customer-2` | Only customer-1 and customer-2 deploy |

Setting a value that doesn't include any of the group's regions makes every
job skip and the pipeline goes green having done nothing. If that happens,
retrigger with a valid value.

### Example Usage

Expand Down
40 changes: 22 additions & 18 deletions libs/getsentry.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,27 @@
*/

{
// These regions are user facing deployments
prod_regions: [
's4s2',
'de',
'us',
// 'control' is excluded by default and must be explicitly included
'control',
'prod-control',
// 'snty-tools' is excluded by default and must be explicitly included
'snty-tools',
'customer-1',
'customer-2',
'customer-4',
'customer-7',
],
// Test regions will deploy in parallel to the regions above
test_regions: [
],
group_order: ['s4s2', 'de', 'us', 'control', 'prod-control', 'snty-tools', 'st'],
// Empty for now — add future test groups here
test_group_order: [],
// These groupings consist of user facing deployments
pipeline_groups: {
s4s2: ['s4s2'],
de: ['de'],
us: ['us'],
control: ['control'],
'prod-control': ['prod-control'],
'snty-tools': ['snty-tools'],
st: ['customer-1', 'customer-2', 'customer-4', 'customer-7'],
},
// Test groups will deploy in parallel to the groups above
test_groups: {
},

group_names:: self.group_order,
test_group_names:: self.test_group_order,
get_targets(group)::
if std.objectHas(self.pipeline_groups, group) then self.pipeline_groups[group]
else self.test_groups[group],
Comment thread
mchen-sentry marked this conversation as resolved.
is_st(region):: std.startsWith(region, 'customer-'),
}
Loading
Loading