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

Using ObjectMeta.CreationTimestamp as AGE column #116

Merged
merged 1 commit into from
May 10, 2022

Conversation

otaviof
Copy link
Member

@otaviof otaviof commented May 10, 2022

Changes

Fixing #114 by checking if .Status.StartTime attribute is nil.

Submitter Checklist

  • Includes tests if functionality changed/was added
  • Includes docs if changes are user-facing
  • Set a kind label on this PR
  • Release notes block has been filled in, or marked NONE

Release Notes

NONE

@otaviof
Copy link
Member Author

otaviof commented May 10, 2022

/assign @HeavyWombat

@otaviof otaviof added the kind/bug Categorizes issue or PR as related to a bug. label May 10, 2022
Comment on lines 88 to 91
age := "0s"
if br.Status.StartTime != nil {
age = duration.ShortHumanDuration(time.Since((br.Status.StartTime).Time))
}
Copy link
Member

Choose a reason for hiding this comment

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

Given that we call it "age", should we maybe move to metadata.creationTimestamp which is always set?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it makes sense, @SaschaSchwarze0. Given the idea is to report the BuildRun age, we can adopt the resource metadata.

However, the "start time" information is also relevant, how about we employ the metadata field to fix the issue at hand (#114), and create another issue for adding the "start time" as a new column?

/cc @HeavyWombat

Copy link
Member

Choose a reason for hiding this comment

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

Sounds good. I think we can broaden the scope of the issue. We should generally check which columns we show in list calls and which data we show in get calls. I don't remember whether we thought about this in great detail initially. But since then we have some more data (like source details and output image digest) and we should revisit what we show.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, good idea to extend the scope and add more columns, @SaschaSchwarze0, I've created #117 to capture.

And amended this PR to use the ObjectMeta.CreationTimestamp instead, please consider.

@openshift-ci openshift-ci bot requested a review from HeavyWombat May 10, 2022 07:45
@otaviof
Copy link
Member Author

otaviof commented May 10, 2022

/retitle Using ObjectMeta.CreationTimestamp as AGE column

@openshift-ci openshift-ci bot changed the title Asserting StartTime to determine BuildRun age Using ObjectMeta.CreationTimestamp as AGE column May 10, 2022
Copy link
Member

@SaschaSchwarze0 SaschaSchwarze0 left a comment

Choose a reason for hiding this comment

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

/approve
/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label May 10, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented May 10, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: SaschaSchwarze0

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 10, 2022
@otaviof
Copy link
Member Author

otaviof commented May 10, 2022

/assign @gabemontero @coreydaley

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. release-note-none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants