Closed rumpl closed 4 years ago
Merging #760 into master will increase coverage by
1.2%
. The diff coverage isn/a
.
@@ Coverage Diff @@
## master #760 +/- ##
=========================================
+ Coverage 70.07% 71.27% +1.2%
=========================================
Files 64 67 +3
Lines 3519 3837 +318
=========================================
+ Hits 2466 2735 +269
- Misses 727 768 +41
- Partials 326 334 +8
Impacted Files | Coverage Δ | |
---|---|---|
internal/commands/inspect.go | 18.03% <0%> (-32.79%) |
:arrow_down: |
internal/validator/rules/relativepath.go | 100% <0%> (ø) |
|
internal/validator/rules/externalsecrets.go | 100% <0%> (ø) |
|
internal/validator/validator.go | 70.49% <0%> (ø) |
|
internal/store/bundle.go | 82.39% <0%> (+5.98%) |
:arrow_up: |
internal/commands/build/compose.go | 86.66% <0%> (+8.09%) |
:arrow_up: |
internal/packager/extract.go | 32.2% <0%> (+8.39%) |
:arrow_up: |
internal/packager/init.go | 73.24% <0%> (+8.6%) |
:arrow_up: |
internal/commands/image/rm.go | 69.76% <0%> (+11.14%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update b621499...582f377. Read the comment docs.
- What I did
Created a "framework" to help write validation rules for a compose file, the
Validator
will do the heavy lifting of traversing all the properties in the compose file.The validator works in two phases:
relativepathrule
needs the top levelvolumes
to check if the volume exists.A rule has 3 parts:
The
Collect
method is called in the first phase, rules collect dependent data if needed here. TheAccept
method is used to filter out only thing that a rule needs to validate TheValidate
method does the actual validation and returns a list of errors for a given value.The PR introduces two rules:
externalsecretrule
to force all secrets to be externalrelativepathrule
to ban relative paths in volumesIn a followup we should:
validate
commandI won't do them here since the changeset is starting to get big.
- How to verify it Unit and e2e tests were added for the two rules
- A picture of a cute animal (not mandatory)![image](https://user-images.githubusercontent.com/99933/69356691-2be70c00-0c84-11ea-82c2-e701a96f596b.png)