Skip to content

Commit af21da6

Browse files
committed
fix(export): add id of rollouts/constraints to export
Signed-off-by: crossy-l <[email protected]>
1 parent e0b2521 commit af21da6

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

internal/ext/common.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ type Distribution struct {
4545
}
4646

4747
type Rollout struct {
48+
Id string `yaml:"id,omitempty" json:"id,omitempty"`
4849
Description string `yaml:"description,omitempty" json:"description,omitempty"`
4950
Segment *SegmentRule `yaml:"segment,omitempty" json:"segment,omitempty"`
5051
Threshold *ThresholdRule `yaml:"threshold,omitempty" json:"threshold,omitempty"`
@@ -71,6 +72,7 @@ type Segment struct {
7172
}
7273

7374
type Constraint struct {
75+
Id string `yaml:"id,omitempty" json:"id,omitempty"`
7476
Type string `yaml:"type,omitempty" json:"type,omitempty"`
7577
Property string `yaml:"property,omitempty" json:"property,omitempty"`
7678
Operator string `yaml:"operator,omitempty" json:"operator,omitempty"`

internal/ext/exporter.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ func (e *Exporter) Export(ctx context.Context, encoding Encoding, w io.Writer) e
258258

259259
for _, r := range rollouts.Rules {
260260
rollout := Rollout{
261+
Id: r.Id,
261262
Description: r.Description,
262263
}
263264

@@ -321,6 +322,7 @@ func (e *Exporter) Export(ctx context.Context, encoding Encoding, w io.Writer) e
321322

322323
for _, c := range s.Constraints {
323324
segment.Constraints = append(segment.Constraints, &Constraint{
325+
Id: c.Id,
324326
Type: c.Type.String(),
325327
Property: c.Property,
326328
Operator: c.Operator,

0 commit comments

Comments
 (0)