Closed zappy-shu closed 4 years ago
Merging #735 into master will increase coverage by
0.73%
. The diff coverage is41.17%
.
@@ Coverage Diff @@
## master #735 +/- ##
==========================================
+ Coverage 69.3% 70.03% +0.73%
==========================================
Files 63 64 +1
Lines 3388 3651 +263
==========================================
+ Hits 2348 2557 +209
- Misses 731 747 +16
- Partials 309 347 +38
Impacted Files | Coverage Δ | |
---|---|---|
internal/commands/root.go | 63.95% <0%> (-8.42%) |
:arrow_down: |
internal/commands/run.go | 61.95% <100%> (+0.41%) |
:arrow_up: |
internal/commands/validate.go | 75% <100%> (+0.8%) |
:arrow_up: |
internal/cliopts/installerContext.go | 27.58% <100%> (+2.58%) |
:arrow_up: |
internal/commands/inspect.go | 16.66% <0%> (-0.62%) |
:arrow_down: |
internal/packager/cnab.go | 97.67% <0%> (-0.28%) |
:arrow_down: |
internal/packager/custom.go | 61.29% <0%> (ø) |
|
internal/commands/image/rm.go | 65.21% <0%> (+2.71%) |
:arrow_up: |
internal/commands/image/list.go | 87.67% <0%> (+3.99%) |
:arrow_up: |
internal/commands/image/tag.go | 91.07% <0%> (+6.07%) |
:arrow_up: |
... and 3 more |
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 4e0989c...9fb9b2d. Read the comment docs.
- What I did
Added a created date field to the custom payload of the bundle.json which is used to display the time since the app image was built in human readable format on
docker app image ls
as theCREATED
column.- How I did it
Created a v1.0 struct for the custom payload in bundle.json that stores the creation date at build time. A constant is used to track which version of the custom payload is to be deserialized rather than using the
docker app version
. This is to make it easier to check which struct matches which versions.As the entire bundle.json is deserialized at once the custom payload needs to be re-serialized before deserializing into the concrete type as it is stored as a simple
map[string]interface{}
.The human readable output is done using the
github.com/docker/go-units
package, same as withdocker image ls
.- How to verify it
Run a
docker app build
. The resulting bundle.json should have a custom section similar to the following:Note that the
created
field should be in UTC.Running
docker app image ls
should print aCREATED
column showing the amount of time since the app image was built or blank if the image was built using an older version ofdocker app
.Example output:
- Description for the changelog
Added the creation date to the App bundle and prints the time since creation in the
docker app image ls
output- A picture of a cute animal (not mandatory)