Skip to content

refactor revision lifecycle status markers - #5804

Merged
knative-prow-robot merged 1 commit into
knative:masterfrom
nimakaviani:refactor-rev-status-markers
Oct 17, 2019
Merged

knative-prow-robot merged 1 commit into
knative:masterfrom
nimakaviani:refactor-rev-status-markers

Conversation

@nimakaviani

Copy link
Copy Markdown
Contributor

Fixes #5780

@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Oct 14, 2019
@knative-prow-robot knative-prow-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. area/API API objects and controllers area/networking area/test-and-release It flags unit/e2e/conformance/perf test issues for product features labels Oct 14, 2019
@knative-prow-robot

Copy link
Copy Markdown
Contributor

Hi @nimakaviani. Thanks for your PR.

I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@knative-prow-robot knative-prow-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Oct 14, 2019
@nimakaviani

Copy link
Copy Markdown
Contributor Author

/assign @dgerd

@vagababov

Copy link
Copy Markdown
Contributor

/ok-to-test

@knative-prow-robot knative-prow-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 14, 2019

@vagababov vagababov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

/lint

@knative-prow-robot knative-prow-robot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@vagababov: 12 warnings.

Details

In response to this:

/lint

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@nimakaviani

Copy link
Copy Markdown
Contributor Author

wrt lint issues, I believe the names are pretty self explanatory. I am willing to ignore linter warnings unless you all feel otherwise.

@nimakaviani

Copy link
Copy Markdown
Contributor Author

/retest

@vagababov

Copy link
Copy Markdown
Contributor

I do believe in 0 linter warnings :-)

@knative-test-reporter-robot

Copy link
Copy Markdown

The following jobs failed:

Test name Triggers Retries
pull-knative-serving-integration-tests pull-knative-serving-integration-tests
pull-knative-serving-integration-tests
2/3

Automatically retrying due to test flakiness...
/test pull-knative-serving-integration-tests

@nimakaviani
nimakaviani force-pushed the refactor-rev-status-markers branch from 68cefa9 to 3a007c3 Compare October 15, 2019 22:58
@nimakaviani

Copy link
Copy Markdown
Contributor Author

/lint

@knative-prow-robot knative-prow-robot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@nimakaviani: 0 warnings.

Details

In response to this:

/lint

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@knative-metrics-robot

Copy link
Copy Markdown

The following is the coverage report on the affected files.
Say /test pull-knative-serving-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/serving/v1alpha1/revision_lifecycle.go 88.5% 88.2% -0.3
pkg/reconciler/revision/reconcile_resources.go 92.7% 92.8% 0.1

// MarkActive calls .Status.MarkActive on the Revision.
func MarkActive(r *v1alpha1.Revision) {
r.Status.MarkActive()
r.Status.MarkActiveTrue()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there a reason that we are deviating the names of MarkXxx functions from their respective revision status methods?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We tied the function names to the ConditionType plus the status they can have (True, False or Unknown) and decided to keep the naming verbose (so MarkActiveTrue() rather than MarkActive()). see this #5804 (comment)

func MarkDeploying(reason string) RevisionOption {
return func(r *v1alpha1.Revision) {
r.Status.MarkDeploying(reason)
r.Status.MarkResourcesAvailableUnknown(reason, "")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there a reason we are removing some of the MarkXxx methods off of revision status?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

MarkDeploying() is not a ConditionType but a helper function that alters two condition types. No longer needed if we explicitly set condition types.

func (rs *RevisionStatus) MarkDeploying(reason string) {
revCondSet.Manage(rs).MarkUnknown(RevisionConditionResourcesAvailable, reason, "")
revCondSet.Manage(rs).MarkUnknown(RevisionConditionContainerHealthy, reason, "")
}

@taragu

taragu commented Oct 16, 2019

Copy link
Copy Markdown
Contributor

There's an outstanding issue with consistent naming convention for the MarkXxx functions #5076 (comment) I wonder if we should follow the pattern here proposed by @jonjohnsonjr

MarkFooReady -> Ready=True
MarkFooNotReady -> Ready=Unknown
MarkFooFailed -> Ready=False

@dgerd

dgerd commented Oct 16, 2019

Copy link
Copy Markdown

This is very similar to the pattern proposed in the other issue.

It follows Mark<ConditionType><State> rather than Mark<ConditionType><Ready|NotReady|Failed>.

I don't see a benefit in having to map a set of states to another set of states (i.e. NotReady == Unknown). In addition Ready is also a special root ConditionType and overloading it as a state can be potentially confusing.

@nimakaviani

Copy link
Copy Markdown
Contributor Author

@dgerd @vagababov if you all are happy with comments on functions and constants, I think the PR is ready to go.

@dgerd

dgerd commented Oct 17, 2019

Copy link
Copy Markdown

/lgtm
/approve

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 17, 2019
@knative-prow-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dgerd, nimakaviani

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

The pull request process is described here

Details 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

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 17, 2019
@knative-prow-robot
knative-prow-robot merged commit 3336b1e into knative:master Oct 17, 2019
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. area/API API objects and controllers area/networking area/test-and-release It flags unit/e2e/conformance/perf test issues for product features cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor Revision lifecycle functions

8 participants