-
-
Notifications
You must be signed in to change notification settings - Fork 751
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
Pants: Add pack_metadata
targets to BUILD files
#5871
Merged
Merged
Changes from 13 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
e5d4f18
pants: add pack_metadata targets
cognifloyd f18e1a0
add packs_metadata and related targets
cognifloyd 8aebc18
Add pack_metadata dependencies
cognifloyd d995003
Add pack_metadata for more fixtures
cognifloyd e1614fc
Allow pants to detect packs fixture usage
cognifloyd e2bef63
Cleanup fixtures BUILD files
cognifloyd 0f2c7cc
add BUILD metadata for st2tests/testpacks
cognifloyd adf97fa
depend on pack_metadata in st2tests.fixtures.packs.core.fixture
cognifloyd 521397b
Add pack_metadata targets in st2reactor pack fixtures
cognifloyd d864817
Enable pants-plugins/pack_metadata
cognifloyd 26132d1
update changelog entry
cognifloyd f4062f7
disable spurious pack_metadata target where there is no metadata
cognifloyd e18e3ae
add pack_metadata to contrib/debug with `./pants tailor ::`
cognifloyd 54012ec
oops. executable bit should not be set on BUILD files
cognifloyd 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
pack_metadata( | ||
name="metadata", | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
pack_metadata( | ||
name="metadata", | ||
) |
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,3 @@ | ||
pack_metadata( | ||
name="metadata", | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
pack_metadata( | ||
name="metadata", | ||
) |
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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
pack_metadata( | ||
name="metadata", | ||
) | ||
|
||
python_requirements( | ||
name="reqs", | ||
) |
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,3 @@ | ||
pack_metadata( | ||
name="metadata", | ||
) |
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 |
---|---|---|
@@ -1 +1,8 @@ | ||
python_sources() | ||
python_sources( | ||
dependencies=[ | ||
"./stackstorm-test:metadata", | ||
"./stackstorm-test2:metadata", | ||
"./stackstorm-test3:metadata", | ||
"./stackstorm-test4:metadata", | ||
], | ||
) |
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,3 @@ | ||
pack_metadata( | ||
name="metadata", | ||
) |
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,3 @@ | ||
pack_metadata( | ||
name="metadata", | ||
) |
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,3 @@ | ||
pack_metadata( | ||
name="metadata", | ||
) |
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,3 @@ | ||
pack_metadata( | ||
name="metadata", | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,7 @@ | ||
python_sources() | ||
pack_metadata( | ||
name="metadata", | ||
) | ||
|
||
python_sources( | ||
dependencies=[":metadata"], | ||
) |
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 |
---|---|---|
@@ -1 +1,7 @@ | ||
python_sources() | ||
pack_metadata( | ||
name="metadata", | ||
) | ||
|
||
python_sources( | ||
dependencies=[":metadata"], | ||
) |
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 | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1 +1,7 @@ | ||||||||||||||||
python_sources() | ||||||||||||||||
pack_metadata( | ||||||||||||||||
name="metadata", | ||||||||||||||||
) | ||||||||||||||||
Comment on lines
+1
to
+3
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This would be functionally equivalent without using the
Suggested change
|
||||||||||||||||
|
||||||||||||||||
python_sources( | ||||||||||||||||
dependencies=[":metadata"], | ||||||||||||||||
) |
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 |
---|---|---|
@@ -1 +1,7 @@ | ||
python_sources() | ||
pack_metadata( | ||
name="metadata", | ||
) | ||
|
||
python_sources( | ||
dependencies=[":metadata"], | ||
) |
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 |
---|---|---|
@@ -1 +1,7 @@ | ||
python_sources() | ||
pack_metadata( | ||
name="metadata", | ||
) | ||
|
||
python_sources( | ||
dependencies=[":metadata"], | ||
) |
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 |
---|---|---|
@@ -1 +1,7 @@ | ||
python_sources() | ||
pack_metadata( | ||
name="metadata", | ||
) | ||
|
||
python_sources( | ||
dependencies=[":metadata"], | ||
) |
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 |
---|---|---|
@@ -1 +1,7 @@ | ||
python_sources() | ||
pack_metadata( | ||
name="metadata", | ||
) | ||
|
||
python_sources( | ||
dependencies=[":metadata"], | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,7 @@ | ||
python_sources() | ||
pack_metadata( | ||
name="metadata", | ||
) | ||
|
||
python_sources( | ||
dependencies=[":metadata"], | ||
) |
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 |
---|---|---|
@@ -1,5 +1,10 @@ | ||
pack_metadata( | ||
name="metadata", | ||
) | ||
|
||
python_sources( | ||
dependencies=[ | ||
":metadata", | ||
"st2tests/st2tests/fixtures/packs/configs/dummy_pack_1.yaml", | ||
], | ||
) |
8 changes: 7 additions & 1 deletion
8
st2tests/st2tests/fixtures/packs/dummy_pack_10/BUILD
100644 → 100755
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 |
---|---|---|
@@ -1 +1,7 @@ | ||
python_sources() | ||
pack_metadata( | ||
name="metadata", | ||
) | ||
|
||
python_sources( | ||
dependencies=[":metadata"], | ||
) |
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 |
---|---|---|
@@ -1,5 +1,10 @@ | ||
pack_metadata( | ||
name="metadata", | ||
) | ||
|
||
python_sources( | ||
dependencies=[ | ||
":metadata", | ||
"st2tests/st2tests/fixtures/packs/configs/dummy_pack_11.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 |
---|---|---|
@@ -1 +1,7 @@ | ||
python_sources() | ||
pack_metadata( | ||
name="metadata", | ||
) | ||
|
||
python_sources( | ||
dependencies=[":metadata"], | ||
) |
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 |
---|---|---|
@@ -1 +1,7 @@ | ||
python_sources() | ||
pack_metadata( | ||
name="metadata", | ||
) | ||
|
||
python_sources( | ||
dependencies=[":metadata"], | ||
) |
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 |
---|---|---|
@@ -1 +1,7 @@ | ||
python_sources() | ||
pack_metadata( | ||
name="metadata", | ||
) | ||
|
||
python_sources( | ||
dependencies=[":metadata"], | ||
) |
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 |
---|---|---|
@@ -1 +1,7 @@ | ||
python_sources() | ||
pack_metadata( | ||
name="metadata", | ||
) | ||
|
||
python_sources( | ||
dependencies=[":metadata"], | ||
) |
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 |
---|---|---|
@@ -1 +1,7 @@ | ||
python_sources() | ||
pack_metadata( | ||
name="metadata", | ||
) | ||
|
||
python_sources( | ||
dependencies=[":metadata"], | ||
) |
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 |
---|---|---|
@@ -1 +1,7 @@ | ||
python_sources() | ||
pack_metadata( | ||
name="metadata", | ||
) | ||
|
||
python_sources( | ||
dependencies=[":metadata"], | ||
) |
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 |
---|---|---|
@@ -1 +1,7 @@ | ||
python_sources() | ||
pack_metadata( | ||
name="metadata", | ||
) | ||
|
||
python_sources( | ||
dependencies=[":metadata"], | ||
) |
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 |
---|---|---|
@@ -1,5 +1,10 @@ | ||
pack_metadata( | ||
name="metadata", | ||
) | ||
|
||
python_sources( | ||
dependencies=[ | ||
":metadata", | ||
"st2tests/st2tests/fixtures/packs/configs/dummy_pack_19.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 |
---|---|---|
@@ -1,6 +1,12 @@ | ||
pack_metadata( | ||
name="metadata", | ||
) | ||
|
||
resource( | ||
name="pack_requirements", | ||
source="requirements.txt", | ||
) | ||
|
||
python_sources() | ||
python_sources( | ||
dependencies=[":metadata"], | ||
) |
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 |
---|---|---|
@@ -1 +1,7 @@ | ||
python_sources() | ||
pack_metadata( | ||
name="metadata", | ||
) | ||
|
||
python_sources( | ||
dependencies=[":metadata"], | ||
) |
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 |
---|---|---|
@@ -1 +1,7 @@ | ||
python_sources() | ||
pack_metadata( | ||
name="metadata", | ||
) | ||
|
||
python_sources( | ||
dependencies=[":metadata"], | ||
) |
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 |
---|---|---|
@@ -1,5 +1,10 @@ | ||
pack_metadata( | ||
name="metadata", | ||
) | ||
|
||
python_sources( | ||
dependencies=[ | ||
":metadata", | ||
"st2tests/st2tests/fixtures/packs/configs/dummy_pack_22.yaml", | ||
], | ||
) |
10 changes: 9 additions & 1 deletion
10
st2tests/st2tests/fixtures/packs/dummy_pack_23/BUILD
100644 → 100755
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 |
---|---|---|
@@ -1 +1,9 @@ | ||
python_sources() | ||
# There are no metadata files in dummy_pack_23 yet. | ||
# It is used in the pack copy tests. | ||
# pack_metadata( | ||
# name="metadata", | ||
# ) | ||
|
||
python_sources( | ||
# dependencies=[":metadata"], | ||
) |
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 |
---|---|---|
@@ -1 +1,7 @@ | ||
python_sources() | ||
pack_metadata( | ||
name="metadata", | ||
) | ||
|
||
python_sources( | ||
dependencies=[":metadata"], | ||
) |
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 |
---|---|---|
@@ -1 +1,7 @@ | ||
python_sources() | ||
pack_metadata( | ||
name="metadata", | ||
) | ||
|
||
python_sources( | ||
dependencies=[":metadata"], | ||
) |
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 |
---|---|---|
@@ -1,5 +1,10 @@ | ||
pack_metadata( | ||
name="metadata", | ||
) | ||
|
||
python_sources( | ||
dependencies=[ | ||
":metadata", | ||
"st2tests/st2tests/fixtures/packs/configs/dummy_pack_5.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 |
---|---|---|
@@ -1,5 +1,10 @@ | ||
pack_metadata( | ||
name="metadata", | ||
) | ||
|
||
python_sources( | ||
dependencies=[ | ||
":metadata", | ||
"st2tests/st2tests/fixtures/packs/configs/dummy_pack_6.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 |
---|---|---|
@@ -1,5 +1,10 @@ | ||
pack_metadata( | ||
name="metadata", | ||
) | ||
|
||
python_sources( | ||
dependencies=[ | ||
":metadata", | ||
"st2tests/st2tests/fixtures/packs/configs/dummy_pack_7.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 |
---|---|---|
@@ -1 +1,7 @@ | ||
python_sources() | ||
pack_metadata( | ||
name="metadata", | ||
) | ||
|
||
python_sources( | ||
dependencies=[":metadata"], | ||
) |
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.
Slightly confused. In the dummy_pack_23 we don't include the pack_metadata as there is no pack.yaml in that pack.
For things like this BUILD file and others at this level in the hierarchy, why do they have the pack_metatdata?
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.
pack_metadata
includes more than justpack.yaml
.st2/pants-plugins/pack_metadata/target_types.py
Lines 27 to 40 in a73225c
It also includes metadata yaml files for resources that go in packs: actions, aliases, sensors, etc.
Several of the directories at this level do not have
pack.yaml
, but they do have the other metadata yaml files. Examples:Then the other fixtures do similar things. They all seem to have mongo docs in the form of yaml files (after-all the db effectively just holds all of the metadata files in json format, so going in the reverse makes sense).
We need
resources
for all of these yaml files.PackMetadata
subclassesResources
, so everything in thepack_metadata
target also counts as a resource. So, we either need to:resources(sources=...)
targets that encompass all of the yaml files, and make the python fixture.py depend on thempack_metadata
and make the python fixture.py depend on itIt was quick and easy to just treat these as packs using
pack_metadata
so that's what I did. Would it make more sense to you if we usedresources()
instead for these?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.
Oh. And one more clarification,
dummy_pack_23
does not have ANY yaml files, not just pack.yaml. So, including the pack_metadata target there results in warnings because none of the sources globs match anything. All of these other fixtures do have yaml files, so the**/*.yaml
glob matches.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.
It's fine - thanks for clarification.
My point for not reading the resource correctly / I did go and look and must have not scrolled past the pack example yaml line.
All good!