Skip to content
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

enhance(library): update Duration() return values #227

Merged
merged 6 commits into from
Jan 20, 2022

Conversation

jbrockopp
Copy link
Contributor

Based off feedback from #222 (comment)

This updates the value returned from Duration() for resources in the github.com/go-vela/types/library package.

The following resources have this function:

Previously, we were returning 0s if the started or finished timestamps weren't set for the resource.

Now, If a resource doesn't have a started timestamp, then an indeterminate value of ... is returned.

Otherwise, if a resource doesn't have a finished timestamp, then the time since the started timestamp is returned.

Otherwise, we return the finished timestamp subtracted by the started timestamp.

@jbrockopp jbrockopp added the enhancement Indicates an improvement to a feature label Jan 12, 2022
@jbrockopp jbrockopp self-assigned this Jan 12, 2022
@jbrockopp jbrockopp requested a review from a team as a code owner January 12, 2022 19:21
@codecov
Copy link

codecov bot commented Jan 12, 2022

Codecov Report

Merging #227 (366253d) into master (0787a67) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #227      +/-   ##
==========================================
+ Coverage   97.05%   97.06%   +0.01%     
==========================================
  Files          53       53              
  Lines        5772     5794      +22     
==========================================
+ Hits         5602     5624      +22     
  Misses        125      125              
  Partials       45       45              
Impacted Files Coverage Δ
library/build.go 100.00% <100.00%> (ø)
library/service.go 87.10% <100.00%> (+0.26%) ⬆️
library/step.go 100.00% <100.00%> (ø)

library/service.go Outdated Show resolved Hide resolved
library/step.go Outdated Show resolved Hide resolved
@jbrockopp jbrockopp requested a review from a team January 19, 2022 17:55
Copy link
Contributor

@ecrupper ecrupper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Indicates an improvement to a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants