← Back to Pull requests

Update condition code documentation #637

Merged
yiqigao217 merged 2 files (48 lines) on Apr 09, 2020 19:05 UTC
View on GitHub
yiqigao217 yiqigao217 commented on Apr 09, 2020 16:01 UTC
Author

Add documentation on new codes and delete the obsolete codes.

Tested with "make test".

Fixes #622

Diff: 48 lines (+30 / -18) across 2 files Reviewer: sophieliu15 Review duration: 184m
All Vouch review confidence checks passed
Residual risk 0.02 = Change Risk (0.28) × (1 − Review Confidence (0.92)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.28 · 48 lines diff across 2 files
0.28
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.93 · 5 substantive comment(s)
0.93
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
92%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.233
Real PR Conversation Timeline
11 items
yiqigao217 yiqigao217 commented on Apr 09, 2020 16:04 UTC
Author

@sophieliu15 @adrianchung please feel free to take a look and lmk if anything's not clear in the condition code documentation. Thank you Sophie for bringing this up!

sophieliu15 sophieliu15 commented on code on Apr 09, 2020 17:05 UTC
Code Review
incubator/hnc/api/v1alpha1/hierarchy_types.go:1
@@ -116,17 +116,22 @@ type Condition struct {
 	//
 	// Currently, the supported values are:
 	//
-	// - "CRIT_PARENT_MISSING": the specified parent is missing
+	// - "CritParentMissing": the specified parent is missing
 	//
-	// - "CRIT_PARENT_INVALID": the specified parent is invalid (e.g., would cause a cycle)
+	// - "CritParentInvalid": the specified parent is invalid (e.g., would cause a cycle)
 	//
-	// - "CRIT_ANCESTOR": a critical error exists in an ancestor namespace, so this namespace is no
+	// - "CritAncestor": a critical error exists in an ancestor namespace, so this namespace is no
 	// longer being updated either.
 	//
-	// - "REQUIRED_CHILD_CONFLICT": this namespace has a required child, but a namespace of the same
-	// name already exists and is not a child of this namespace. Note that the condition is _not_
-	// annotated onto the other namespace; it is considered an error _only_ for the would-be parent
-	// namespace.
+	// - "HNSMissing": this namespace is an owned namespace (created by reconciling an hns instance),
+	// but the hns instance is missing in its owner (referenced in its owner annotation) or the owner

Will there be more information about which case (i.e., hns instance missing or owner namespace missing) causes this problem when a namespace has this error condition?

sophieliu15 sophieliu15 commented on code on Apr 09, 2020 17:14 UTC
Code Review
incubator/hnc/api/v1alpha1/hierarchy_types.go:1
@@ -116,17 +116,22 @@ type Condition struct {
 	//
 	// Currently, the supported values are:
 	//
-	// - "CRIT_PARENT_MISSING": the specified parent is missing
+	// - "CritParentMissing": the specified parent is missing
 	//
-	// - "CRIT_PARENT_INVALID": the specified parent is invalid (e.g., would cause a cycle)
+	// - "CritParentInvalid": the specified parent is invalid (e.g., would cause a cycle)
 	//
-	// - "CRIT_ANCESTOR": a critical error exists in an ancestor namespace, so this namespace is no
+	// - "CritAncestor": a critical error exists in an ancestor namespace, so this namespace is no
 	// longer being updated either.
 	//
-	// - "REQUIRED_CHILD_CONFLICT": this namespace has a required child, but a namespace of the same
-	// name already exists and is not a child of this namespace. Note that the condition is _not_
-	// annotated onto the other namespace; it is considered an error _only_ for the would-be parent
-	// namespace.
+	// - "HNSMissing": this namespace is an owned namespace (created by reconciling an hns instance),
+	// but the hns instance is missing in its owner (referenced in its owner annotation) or the owner
+	// namespace is missing.
+	//
+	// - "CannotUpdateObject": this namespace has an error when updating a propagated object. The
+	// affected object will point to the source object.
+	//
+	// - "CannotPropagateObject": this namespace has an error when propagating a source object. The
+	// affected objects will point to all the propagated objects that have an error to update.

all the propagated objects that have an error to update.

I am wondering what's the difference between this code and the CannotUpdateObject above? From the documentation, they seem to be both about problems when updating propagated objects?

sophieliu15 sophieliu15 commented on Apr 09, 2020 17:14 UTC
Reviewer

Thanks so much for the fix. :)

yiqigao217 yiqigao217 commented on code on Apr 09, 2020 17:24 UTC
Code Review
incubator/hnc/api/v1alpha1/hierarchy_types.go:1
@@ -116,17 +116,22 @@ type Condition struct {
 	//
 	// Currently, the supported values are:
 	//
-	// - "CRIT_PARENT_MISSING": the specified parent is missing
+	// - "CritParentMissing": the specified parent is missing
 	//
-	// - "CRIT_PARENT_INVALID": the specified parent is invalid (e.g., would cause a cycle)
+	// - "CritParentInvalid": the specified parent is invalid (e.g., would cause a cycle)
 	//
-	// - "CRIT_ANCESTOR": a critical error exists in an ancestor namespace, so this namespace is no
+	// - "CritAncestor": a critical error exists in an ancestor namespace, so this namespace is no
 	// longer being updated either.
 	//
-	// - "REQUIRED_CHILD_CONFLICT": this namespace has a required child, but a namespace of the same
-	// name already exists and is not a child of this namespace. Note that the condition is _not_
-	// annotated onto the other namespace; it is considered an error _only_ for the would-be parent
-	// namespace.
+	// - "HNSMissing": this namespace is an owned namespace (created by reconciling an hns instance),
+	// but the hns instance is missing in its owner (referenced in its owner annotation) or the owner

No, we only look for the hns instance. If it doesn't exist, this condition will be set, no matter the owner namespace exists or not. The two cases here are actually the two possible cases of a missing hns instance.

yiqigao217 yiqigao217 commented on code on Apr 09, 2020 17:26 UTC
Code Review
incubator/hnc/api/v1alpha1/hierarchy_types.go:1
@@ -116,17 +116,22 @@ type Condition struct {
 	//
 	// Currently, the supported values are:
 	//
-	// - "CRIT_PARENT_MISSING": the specified parent is missing
+	// - "CritParentMissing": the specified parent is missing
 	//
-	// - "CRIT_PARENT_INVALID": the specified parent is invalid (e.g., would cause a cycle)
+	// - "CritParentInvalid": the specified parent is invalid (e.g., would cause a cycle)
 	//
-	// - "CRIT_ANCESTOR": a critical error exists in an ancestor namespace, so this namespace is no
+	// - "CritAncestor": a critical error exists in an ancestor namespace, so this namespace is no
 	// longer being updated either.
 	//
-	// - "REQUIRED_CHILD_CONFLICT": this namespace has a required child, but a namespace of the same
-	// name already exists and is not a child of this namespace. Note that the condition is _not_
-	// annotated onto the other namespace; it is considered an error _only_ for the would-be parent
-	// namespace.
+	// - "HNSMissing": this namespace is an owned namespace (created by reconciling an hns instance),
+	// but the hns instance is missing in its owner (referenced in its owner annotation) or the owner
+	// namespace is missing.
+	//
+	// - "CannotUpdateObject": this namespace has an error when updating a propagated object. The
+	// affected object will point to the source object.
+	//
+	// - "CannotPropagateObject": this namespace has an error when propagating a source object. The
+	// affected objects will point to all the propagated objects that have an error to update.

Yes, they are two conditions triggered by the same error. However, CannotPropagateObject is set on the namespace with the source object and CannotUpdateObject is set on the namespace with the propagated object.

adrianludwin adrianludwin commented on code on Apr 09, 2020 18:47 UTC
Code Review
incubator/hnc/api/v1alpha1/hierarchy_types.go:1
@@ -116,17 +116,22 @@ type Condition struct {
 	//
 	// Currently, the supported values are:
 	//
-	// - "CRIT_PARENT_MISSING": the specified parent is missing
+	// - "CritParentMissing": the specified parent is missing
 	//
-	// - "CRIT_PARENT_INVALID": the specified parent is invalid (e.g., would cause a cycle)
+	// - "CritParentInvalid": the specified parent is invalid (e.g., would cause a cycle)
 	//
-	// - "CRIT_ANCESTOR": a critical error exists in an ancestor namespace, so this namespace is no
+	// - "CritAncestor": a critical error exists in an ancestor namespace, so this namespace is no
 	// longer being updated either.
 	//
-	// - "REQUIRED_CHILD_CONFLICT": this namespace has a required child, but a namespace of the same
-	// name already exists and is not a child of this namespace. Note that the condition is _not_
-	// annotated onto the other namespace; it is considered an error _only_ for the would-be parent
-	// namespace.
+	// - "HNSMissing": this namespace is an owned namespace (created by reconciling an hns instance),
+	// but the hns instance is missing in its owner (referenced in its owner annotation) or the owner
+	// namespace is missing.
+	//
+	// - "CannotUpdateObject": this namespace has an error when updating a propagated object. The
+	// affected object will point to the source object.
+	//
+	// - "CannotPropagateObject": this namespace has an error when propagating a source object. The
+	// affected objects will point to all the propagated objects that have an error to update.

Maybe: "This object contains an object that couldn't be propagated to one or more of its descendants. The condition's affect objects will include a list of the copies that couldn't be updated."

adrianludwin adrianludwin commented on Apr 09, 2020 19:03 UTC
Reviewer

/lgtm
/approve

k8s-ci-robot k8s-ci-robot commented on Apr 09, 2020 19:03 UTC
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: <a href="https://github.com/kubernetes-sigs/multi-tenancy/pull/637#pullrequestreview-391055818" title="Approved">adrianludwin</a>, <a href="https://github.com/kubernetes-sigs/multi-tenancy/pull/637#" title="Author self-approved">yiqigao217</a>

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:

  • ~~OWNERS~~ [adrianludwin]
  • Approvers can indicate their approval by writing /approve in a comment
    Approvers can cancel approval by writing /approve cancel in a comment
    </details>
    <!-- META={"approvers":[]} -->

    yiqigao217 yiqigao217 commented on code on Apr 09, 2020 19:04 UTC
    Code Review
    incubator/hnc/api/v1alpha1/hierarchy_types.go:1
    @@ -116,17 +116,22 @@ type Condition struct {
     	//
     	// Currently, the supported values are:
     	//
    -	// - "CRIT_PARENT_MISSING": the specified parent is missing
    +	// - "CritParentMissing": the specified parent is missing
     	//
    -	// - "CRIT_PARENT_INVALID": the specified parent is invalid (e.g., would cause a cycle)
    +	// - "CritParentInvalid": the specified parent is invalid (e.g., would cause a cycle)
     	//
    -	// - "CRIT_ANCESTOR": a critical error exists in an ancestor namespace, so this namespace is no
    +	// - "CritAncestor": a critical error exists in an ancestor namespace, so this namespace is no
     	// longer being updated either.
     	//
    -	// - "REQUIRED_CHILD_CONFLICT": this namespace has a required child, but a namespace of the same
    -	// name already exists and is not a child of this namespace. Note that the condition is _not_
    -	// annotated onto the other namespace; it is considered an error _only_ for the would-be parent
    -	// namespace.
    +	// - "HNSMissing": this namespace is an owned namespace (created by reconciling an hns instance),
    +	// but the hns instance is missing in its owner (referenced in its owner annotation) or the owner
    +	// namespace is missing.
    +	//
    +	// - "CannotUpdateObject": this namespace has an error when updating a propagated object. The
    +	// affected object will point to the source object.
    +	//
    +	// - "CannotPropagateObject": this namespace has an error when propagating a source object. The
    +	// affected objects will point to all the propagated objects that have an error to update.

    Thanks all, updated!

    Reviewers
    Assignees
    yiqigao217 yiqigao217
    Labels
    risk: low confidence: 92.3% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 27.7% (LOW) · Higher = larger blast radius
    27.7%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 92.3% · Lower = rushed or shallow review
    92.3%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 2.1% · Safe to merge
    2.1%