Skip to content

OTA-1174: upgrade status: --details shows descriptions and references - #1690

Closed
petr-muller wants to merge 10 commits into
openshift:masterfrom
petr-muller:ota-1174-details
Closed

OTA-1174: upgrade status: --details shows descriptions and references#1690
petr-muller wants to merge 10 commits into
openshift:masterfrom
petr-muller:ota-1174-details

Conversation

@petr-muller

Copy link
Copy Markdown
Member

With --details, every insight will have two more fields - description and remediation URL (runbook, documentation...). Output is not a table, but a oc describe-like tree output. Move the condition message from the insight summary to its description (which is only shown with --details). Remediation links point to o/runbooks runbook for the matching alert. Condition messages are propagated via an insight description, which is only shown with --details in a tree-like output. This allows us to keep linebreaks originally present in the message, we just need to pad each line enough to align it with the indentation of the message start. Incomplete insights are not not actionable enough to show them to the user, so we filter them out while processing.

@openshift-ci-robot

openshift-ci-robot commented Feb 22, 2024

Copy link
Copy Markdown

@petr-muller: This pull request references OTA-1174 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.16.0" version, but no target version was set.

Details

In response to this:

With --details, every insight will have two more fields - description and remediation URL (runbook, documentation...). Output is not a table, but a oc describe-like tree output. Move the condition message from the insight summary to its description (which is only shown with --details). Remediation links point to o/runbooks runbook for the matching alert. Condition messages are propagated via an insight description, which is only shown with --details in a tree-like output. This allows us to keep linebreaks originally present in the message, we just need to pad each line enough to align it with the indentation of the message start. Incomplete insights are not not actionable enough to show them to the user, so we filter them out while processing.

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Feb 22, 2024
@openshift-ci
openshift-ci Bot requested review from ardaguclu and soltysh February 22, 2024 15:57
@openshift-ci

openshift-ci Bot commented Feb 22, 2024

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: petr-muller

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

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 22, 2024
@petr-muller

Copy link
Copy Markdown
Member Author

@openshift-ci
openshift-ci Bot requested review from DavidHurta, LalatenduMohanty and wking and removed request for ardaguclu and soltysh February 22, 2024 16:07

@DavidHurta DavidHurta 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.

A well-written code. I even had a good chuckle reading the tests.

I have left some notes, mainly nitpicks and suggestions for small changes. I have not found any bugs.

Note: Tested locally on the submitted test data.

level: errorImpactLevel,
impactType: apiAvailabilityImpactType,
summary: `Cluster Operator testOperator is unavailable (Broken)`,
description: "Operator is broken\nand message has linebreaks",

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.

I would suggest to update the test name to reflect the change.

Something like: "insights flatten linebreaks in messages" -> "insights do not flatten linebreaks in messages"

t.Run(cv, func(t *testing.T) {
t.Parallel()
co := strings.Replace(cv, "-cv.yaml", "-co.yaml", 1)
for _, variant := range variants {

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.

We may want to update the README file to reflect that two output files are now required.

Comment thread pkg/cli/admin/upgrade/status/health.go Outdated
detailedOutput(w, displayData)
} else {
tabulatedOutput(w, displayData)

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.

Nitpick: A redundant line.

Comment on lines +115 to 129
func (i updateInsight) incomplete() bool {
return i.startedAt.IsZero() || i.impact.incomplete() || i.remediation.incomplete()
}

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.

At the moment, I agree with this definition of an incomplete update insight for the current code. However, in the future, some of the information may not be easily accessible. For example, in #1689, the startedAt may not be present for some insights. Or the reference link may not be easily obtainable. I am perfectly fine with merging this code at the moment, as it is perfectly correct for the current code and this PR's code, but we'll probably need to address this logic in the future for specific cases.

}
})
}

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.

Nitpick: A redundant line.

@petr-muller

Copy link
Copy Markdown
Member Author

Thanks for the feedback, will address. I will hold this PR so that #1689 does not accidentally need to rebase & resolve conflicts.

/hold

@LalatenduMohanty

Copy link
Copy Markdown
Member

The PR looks good to me. Once @Davoska 's comments are addressed we can merge this.

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 6, 2024
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 7, 2024
@petr-muller

Copy link
Copy Markdown
Member Author

/hold

Adapted to #1689 but I'd like to address some quirks

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 7, 2024
With --details, every insight will have two more fields - description and remediation URL (runbook, documentation...). Output is not a table, but a `oc describe`-like tree output.
Move the condition message from the insight summary to its description (which is only shown with --details). Remediation links point to o/runbooks runbook for the matching alert.
Condition messages are propagated via an insight description, which is only shown with `--details` in a tree-like output. This allows us to keep linebreaks originally present in the message, we just need to pad each line enough to align it with the indentation of the message start.
Incomplete insights are not not actionable enough to show them to the
user, so we filter them out while processing.
@openshift-ci

openshift-ci Bot commented Apr 16, 2024

Copy link
Copy Markdown
Contributor

@petr-muller: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-metal-ipi-ovn-ipv6 6da69b9 link false /test e2e-metal-ipi-ovn-ipv6

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@petr-muller

Copy link
Copy Markdown
Member Author

I'll need to break this one down :(

@petr-muller

petr-muller commented Apr 22, 2024

Copy link
Copy Markdown
Member Author

/close

Superceded by #1735 #1736 and #1737

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 22, 2024
@openshift-merge-robot

Copy link
Copy Markdown
Contributor

PR needs rebase.

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.

@openshift-ci openshift-ci Bot closed this Apr 22, 2024
@openshift-ci

openshift-ci Bot commented Apr 22, 2024

Copy link
Copy Markdown
Contributor

@petr-muller: Closed this PR.

Details

In response to this:

/close

Superseded by #1735 #1736 and #1737

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.

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. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants