-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: avoid incorrect cyclic error when two packages import each other on separate component chains #3460
Merged
Merged
fix: avoid incorrect cyclic error when two packages import each other on separate component chains #3460
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
e954a3e
inital example showing failure
AustinAbro321 0c98821
minimal example
AustinAbro321 42063dc
technically work, but very messy
AustinAbro321 6e6d983
tests passing
AustinAbro321 f5297d4
double got rid of components
AustinAbro321 a91c1d0
tests passing
AustinAbro321 da40ad6
update tests
AustinAbro321 a0f7fef
add test for variables
AustinAbro321 8995af6
add better tests cases
AustinAbro321 6b53759
forgot about skeleton packages
AustinAbro321 352a344
delete import example
AustinAbro321 06b130f
make comment more sensible
AustinAbro321 cb7b177
comment
AustinAbro321 91eeeea
stack
AustinAbro321 c015ac8
cleanup test
AustinAbro321 837f603
Merge branch 'main' into fix-import-false-positives
AustinAbro321 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
8 changes: 8 additions & 0 deletions
8
src/internal/packager2/layout/testdata/import/import-each-other/expected.yaml
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,8 @@ | ||
kind: ZarfPackageConfig | ||
metadata: | ||
name: parent-package | ||
components: | ||
- name: first-is-parent | ||
description: this component gets imported by second-package | ||
- name: second-is-parent | ||
description: this component gets imported by first-package |
12 changes: 12 additions & 0 deletions
12
src/internal/packager2/layout/testdata/import/import-each-other/first-import/zarf.yaml
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,12 @@ | ||
kind: ZarfPackageConfig | ||
metadata: | ||
name: first-package | ||
|
||
components: | ||
- name: first-is-parent | ||
description: "this component gets imported by second-package" | ||
|
||
- name: second-is-parent | ||
description: "this component imports second-package" | ||
import: | ||
path: ../second-import |
12 changes: 12 additions & 0 deletions
12
src/internal/packager2/layout/testdata/import/import-each-other/second-import/zarf.yaml
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,12 @@ | ||
kind: ZarfPackageConfig | ||
metadata: | ||
name: second-package | ||
|
||
components: | ||
- name: first-is-parent | ||
description: "this component imports first-package" | ||
import: | ||
path: ../first-import | ||
|
||
- name: second-is-parent | ||
description: "this component gets imported by first-package" |
13 changes: 13 additions & 0 deletions
13
src/internal/packager2/layout/testdata/import/import-each-other/zarf.yaml
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,13 @@ | ||
kind: ZarfPackageConfig | ||
|
||
metadata: | ||
name: parent-package | ||
|
||
components: | ||
- name: first-is-parent | ||
import: | ||
path: first-import | ||
|
||
- name: second-is-parent | ||
import: | ||
path: second-import |
16 changes: 16 additions & 0 deletions
16
src/internal/packager2/layout/testdata/import/variables/expected.yaml
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,16 @@ | ||
kind: ZarfPackageConfig | ||
metadata: | ||
name: parent-package | ||
constants: | ||
- name: PARENT_CONSTANT | ||
value: "value from parent" | ||
- name: CHILD_CONSTANT | ||
value: "value from child" | ||
variables: | ||
- name: PARENT_VAR | ||
value: "value from parent" | ||
- name: CHILD_VAR | ||
value: "value from child" | ||
components: | ||
- name: component-to-test-vars | ||
required: true |
17 changes: 17 additions & 0 deletions
17
src/internal/packager2/layout/testdata/import/variables/import/zarf.yaml
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,17 @@ | ||
kind: ZarfPackageConfig | ||
metadata: | ||
name: parent-package | ||
|
||
constants: | ||
- name: PARENT_CONSTANT | ||
value: "value from child" | ||
- name: CHILD_CONSTANT | ||
value: "value from child" | ||
variables: | ||
- name: PARENT_VAR | ||
value: "value from child" | ||
- name: CHILD_VAR | ||
value: "value from child" | ||
components: | ||
- name: component-to-test-vars | ||
required: true |
15 changes: 15 additions & 0 deletions
15
src/internal/packager2/layout/testdata/import/variables/zarf.yaml
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,15 @@ | ||
kind: ZarfPackageConfig | ||
metadata: | ||
name: parent-package | ||
|
||
constants: | ||
- name: PARENT_CONSTANT | ||
value: "value from parent" | ||
variables: | ||
- name: PARENT_VAR | ||
value: "value from parent" | ||
components: | ||
- name: component-to-test-vars | ||
required: true | ||
import: | ||
path: import |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍