Skip to content

Commit

Permalink
Merge pull request #496 from bruin-data/add-snapshot-field/BRU-1683
Browse files Browse the repository at this point in the history
pipeline: add `snapshot` field
  • Loading branch information
turtleDev authored Mar 6, 2025
2 parents f4135a1 + c5c07ba commit b063ca1
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 4 deletions.
8 changes: 4 additions & 4 deletions integration-tests/integration-test.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ func getTasks(binary string, currentFolder string) []e2e.Task {
Command: binary,
Args: []string{"internal", "parse-pipeline", filepath.Join(currentFolder, "test-pipelines/parse-whole-pipeline")},
Env: []string{},
SkipJSONNodes: []string{`"path"`, `"extends"`, `"commit"`},
SkipJSONNodes: []string{`"path"`, `"extends"`, `"commit"`, `"snapshot"`},
Expected: e2e.Output{
ExitCode: 0,
Output: helpers.ReadFile(filepath.Join(currentFolder, "test-pipelines/parse-whole-pipeline/expectations/pipeline.yml.json")),
Expand Down Expand Up @@ -598,7 +598,7 @@ func getTasks(binary string, currentFolder string) []e2e.Task {
Command: binary,
Args: []string{"internal", "parse-pipeline", "-c", filepath.Join(currentFolder, "test-pipelines/parse-lineage-pipeline")},
Env: []string{},
SkipJSONNodes: []string{`"path"`, `"extends"`, `"commit"`},
SkipJSONNodes: []string{`"path"`, `"extends"`, `"commit"`, `"snapshot"`},
Expected: e2e.Output{
ExitCode: 0,
Output: helpers.ReadFile(filepath.Join(currentFolder, "test-pipelines/parse-lineage-pipeline/expectations/lineage.json")),
Expand Down Expand Up @@ -671,7 +671,7 @@ func getTasks(binary string, currentFolder string) []e2e.Task {
Command: binary,
Args: []string{"internal", "parse-pipeline", filepath.Join(currentFolder, "test-pipelines/parse-default-option")},
Env: []string{},
SkipJSONNodes: []string{`"path"`, `"extends"`, `"commit"`},
SkipJSONNodes: []string{`"path"`, `"extends"`, `"commit"`, `"snapshot"`},
Expected: e2e.Output{
ExitCode: 0,
Output: helpers.ReadFile(filepath.Join(currentFolder, "test-pipelines/parse-default-option/expectations/pipeline.yml.json")),
Expand Down Expand Up @@ -716,7 +716,7 @@ func getTasks(binary string, currentFolder string) []e2e.Task {
Command: binary,
Args: []string{"internal", "parse-pipeline", filepath.Join(currentFolder, "test-pipelines/parse-asset-extends")},
Env: []string{},
SkipJSONNodes: []string{`"path"`, `"extends"`, `"commit"`},
SkipJSONNodes: []string{`"path"`, `"extends"`, `"commit"`, `"snapshot"`},
Expected: e2e.Output{
ExitCode: 0,
Output: helpers.ReadFile(filepath.Join(currentFolder, "test-pipelines/parse-asset-extends/expectations/pipeline.json")),
Expand Down
1 change: 1 addition & 0 deletions pkg/pipeline/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -992,6 +992,7 @@ type Pipeline struct {
Retries int `json:"retries" yaml:"retries" mapstructure:"retries"`
DefaultValues *DefaultValues `json:"default,omitempty" yaml:"default,omitempty" mapstructure:"default,omitempty"`
Commit string `json:"commit"`
Snapshot string `json:"snapshot"`
TasksByType map[AssetType][]*Asset `json:"-"`
tasksByName map[string]*Asset
}
Expand Down
1 change: 1 addition & 0 deletions pkg/pipeline/testdata/pipeline/first-pipeline_unix.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"legacy_id": "first-pipeline",
"name": "first-pipeline",
"schedule": "",
"snapshot": "",
"start_date": "",
"definition_file": {
"name": "pipeline.yml",
Expand Down
1 change: 1 addition & 0 deletions pkg/pipeline/testdata/pipeline/first-pipeline_windows.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"name": "first-pipeline",
"schedule": "",
"start_date": "",
"snapshot": "",
"definition_file": {
"name": "pipeline.yml",
"path": "__BASEDIR__\\testdata\\pipeline\\first-pipeline\\pipeline.yml"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"legacy_id": "",
"name": "pipeline-with-no-assets",
"schedule": "",
"snapshot": "",
"start_date": "",
"definition_file": {
"name": "pipeline.yml",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"legacy_id": "",
"name": "pipeline-with-no-assets",
"schedule": "",
"snapshot": "",
"start_date": "",
"definition_file": {
"name": "pipeline.yml",
Expand Down
1 change: 1 addition & 0 deletions pkg/pipeline/testdata/pipeline/second-pipeline_unix.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"name": "first-pipeline",
"schedule": "",
"start_date": "",
"snapshot": "",
"definition_file": {
"name": "pipeline.yml",
"path": "__BASEDIR__/testdata/pipeline/second-pipeline/pipeline.yml"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"legacy_id": "",
"name": "first-pipeline",
"schedule": "",
"snapshot": "",
"start_date": "",
"definition_file": {
"name": "pipeline.yml",
Expand Down

0 comments on commit b063ca1

Please sign in to comment.