This repository has been archived by the owner on Jan 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 330
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/config: Remove redundant context append for parsing
Prior to this commit, if a config had many pipeline stanzas, say more than 6, each time we would parse a pipeline via the hcl EvalContext we would append that context to the current one to capture any additional parts of the config. Given that we are evaluating the entire config file and not parts of it, this action was redundant. Additionally, it made parsing many pipeline configs slow for each appended context. This fixes it by removing the append. We don't need to append this, given we have the full config context each time we parse pipelines.
- Loading branch information
Showing
3 changed files
with
98 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
internal/config/testdata/pipelines/pipelines_many_many_many.hcl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
project = "foo" | ||
|
||
pipeline "foo" { | ||
step "test" { | ||
image_url = "example.com/test" | ||
|
||
use "test" { | ||
foo = "bar" | ||
} | ||
} | ||
} | ||
|
||
|
||
pipeline "bar" { | ||
step "test2" { | ||
image_url = "example.com/test" | ||
|
||
use "test" { | ||
foo = "bar" | ||
} | ||
} | ||
} | ||
|
||
pipeline "foofoo" { | ||
step "test2" { | ||
image_url = "example.com/test" | ||
|
||
use "test" { | ||
foo = "bar" | ||
} | ||
} | ||
} | ||
|
||
pipeline "barbar" { | ||
step "test2" { | ||
image_url = "example.com/test" | ||
|
||
use "test" { | ||
foo = "bar" | ||
} | ||
} | ||
} | ||
|
||
pipeline "foobar" { | ||
step "test2" { | ||
image_url = "example.com/test" | ||
|
||
use "test" { | ||
foo = "bar" | ||
} | ||
} | ||
} | ||
|
||
pipeline "naming-is-hard" { | ||
step "test2" { | ||
image_url = "example.com/test" | ||
|
||
use "test" { | ||
foo = "bar" | ||
} | ||
} | ||
} | ||
|
||
pipeline "hey-we-made-it" { | ||
step "test2" { | ||
image_url = "example.com/test" | ||
|
||
use "test" { | ||
foo = "bar" | ||
} | ||
} | ||
} | ||
|
||
app "web" { | ||
config { | ||
env = { | ||
static = "hello" | ||
} | ||
} | ||
|
||
build {} | ||
|
||
deploy {} | ||
} |