-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Fleet] Fail gracefully on agent count retrieval #200590
[Fleet] Fail gracefully on agent count retrieval #200590
Conversation
Pinging @elastic/fleet (Team:Fleet) |
...ic/applications/fleet/sections/settings/components/download_source_flyout/confirm_update.tsx
Outdated
Show resolved
Hide resolved
…gs/components/download_source_flyout/confirm_update.tsx Co-authored-by: Julia Bardi <90178898+juliaElastic@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some comments about the copy
<FormattedMessage | ||
id="xpack.fleet.settings.updateDownloadSourceModal.confirmModalTextWithoutCount" | ||
data-test-subj="editDownloadSourcesConfirmModal.confirmModalText" | ||
defaultMessage="This action will update {downloadSourceName} agent binary source. It will update related policies and agents. This action can not be undone. Are you sure you wish to continue?" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that repeating the will update
part twice sounds a bit strange here. Could we change to something like this instead?
This action will update {downloadSourceName} agent binary source, its related policies and agents. This action can not be undone. Are you sure you wish to continue?
) : ( | ||
<FormattedMessage | ||
id="xpack.fleet.settings.deleteDowloadSource.confirmModalTextWithoutCount" | ||
defaultMessage="This action will delete {downloadSourceName} agent binary source. It will update related policies and agents. This action can not be undone. Are you sure you wish to continue?" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest:
This action will delete {downloadSourceName} agent binary source and it will update its related policies and agents. This action can not be undone. Are you sure you wish to continue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this sounds better I will made the change
@@ -67,7 +67,7 @@ const ConfirmDeleteDescription: React.FunctionComponent<ConfirmDeleteDescription | |||
) : ( | |||
<FormattedMessage | |||
id="xpack.fleet.settings.deleteDowloadSource.confirmModalTextWithoutCount" | |||
defaultMessage="This action will delete {downloadSourceName} agent binary source. It will update related policies and agents. This action can not be undone. Are you sure you wish to continue?" | |||
defaultMessage="This action will delete {downloadSourceName} agent binary sourceand it will update its related policies and agents. This action can not be undone. Are you sure you wish to continue?" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's a missing space :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes! LGTM
Starting backport for target branches: 8.x https://github.com/elastic/kibana/actions/runs/11899451975 |
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Async chunks
cc @nchaulet |
(cherry picked from commit e9881a7)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…0641) # Backport This will backport the following commits from `main` to `8.x`: - [[Fleet] Fail gracefully on agent count retrieval (#200590)](#200590) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Nicolas Chaulet","email":"nicolas.chaulet@elastic.co"},"sourceCommit":{"committedDate":"2024-11-18T19:15:00Z","message":"[Fleet] Fail gracefully on agent count retrieval (#200590)","sha":"e9881a7add765f532ab500b7d74f9c988727d2b0","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","v9.0.0","backport:prev-minor"],"title":"[Fleet] Fail gracefully on agent count retrieval","number":200590,"url":"https://github.com/elastic/kibana/pull/200590","mergeCommit":{"message":"[Fleet] Fail gracefully on agent count retrieval (#200590)","sha":"e9881a7add765f532ab500b7d74f9c988727d2b0"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/200590","number":200590,"mergeCommit":{"message":"[Fleet] Fail gracefully on agent count retrieval (#200590)","sha":"e9881a7add765f532ab500b7d74f9c988727d2b0"}}]}] BACKPORT--> Co-authored-by: Nicolas Chaulet <nicolas.chaulet@elastic.co>
Summary
Resolve #192056
When a user do not have the permissions to read agent or agents policies we cannot retrieve the agent count, because of that we were not able to show the confirm modal when updating/delating outputs/binary source. That PR fix that by failing gracefully when we are not able to retrieve that count.
UI Changes