Don't register management section if capabilities are not granted#90782
Don't register management section if capabilities are not granted#90782legrego merged 6 commits intoelastic:masterfrom
Conversation
|
@elasticmachine merge upstream |
|
ACK: reviewing... |
azasypkin
left a comment
There was a problem hiding this comment.
LGTM, thanks for the quick fix!
Would you mind running a flaky test runner on the backport PR as well (if possible)? I'm a bit worried that in 7.11 I've seen both Logstash pipelines and Beats Management sections rendered when there should have been none of these sections (see gif in #90770).
One thing I noticed is that this fix made another minor problem more apparent, but since tests don't complain I'm fine with it. I believe Beats team needs to eventually implement a proper fix and register sections in setup though:
- Logout
- Try to go directly to
https://localhost:5601/app/management - Log in as a super user and observe that Beats Management section is missing sometimes
- Browser refresh fixes this problem
… into chore/fix-beats-flakyness
Great catch, thanks @azasypkin! I think I identified this, and fixed in |
|
I commented the wrong part above. I fixed the logstash issue, not the beats issue you described |
|
I'm re-running the flaky test runner for CI groups 7,8,9, and additionally for CI group 2, which includes the Logstash functional tests for feature controls. |
|
@azasypkin Would you mind reviewing the latest logstash changes? |
|
|
||
| export class LogstashPlugin implements Plugin<void, void, SetupDeps> { | ||
| private licenseSubscription?: Subscription; | ||
| private capabilities$ = new BehaviorSubject<null | Capabilities>(null); |
There was a problem hiding this comment.
nit: it feels like you can just use new Subject<Capabilities>() and remove null check in the subscription?
azasypkin
left a comment
There was a problem hiding this comment.
Still LGTM with optional nit, thanks for handling Logstash Pipelines as well!
💚 Build SucceededMetrics [docs]Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
…astic#90782) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
…astic#90782) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
|
Backport result |
Summary
Only registers the Beats CM and Logstash management sections if the user is authorized for them. Addresses a race condition where the section would be registered after the Management app had gone through and disabled sections based on capabilities.
Ideally Beats CM wouldn't register itself in an async manner (i.e., potentially during the
startphase), but priorities aren't aligned with rewriting the way this application is structured.Flaky test verification:
Resolves #90849
Resolves #90770