fleet icon indicating copy to clipboard operation
fleet copied to clipboard

Queries and Policies page "Manage Automations" buttons not visible as admin [REOPENED]

Open qa-wolf[bot] opened this issue 1 year ago • 34 comments

Steps to reproduce:

  1. Log in as Admin
  2. Navigate to "Queries" tab Expected: "Manage automations" dropdown is visible Actual: "Manage automations" dropdown not is visible

Timestamp: 0:00 Video: https://www.loom.com/share/4ef6334eee884f5f87dd0bb322c573f8?sid=58fff4b1-2db1-4b2f-8f9c-9664122ce654 (https://www.loom.com/share/4ef6334eee884f5f87dd0bb322c573f8?sid=58fff4b1-2db1-4b2f-8f9c-9664122ce654)

To Fix

Instead of hiding the "Manage automations" dropdown when there are no queries, keep it visible and disabled with a tooltip. Same behavior as policies pages, but with query/queries instead of policy/policies:

  • All teams:
    Image
  • Team (as global user):
    Image
  • Hide text 'For inherited policies/queries select "All teams".' when viewing as team-level user.

qa-wolf[bot] avatar Jan 01 '25 17:01 qa-wolf[bot]

This bug was previously filed as https://github.com/fleetdm/fleet/issues/24897 It was closed out because it had a passing run, but in that case you could see that there was a team-specific query on the page, and when that happens, the "Manage automations" option shows up. This bug is only visible when there are inherited queries only on the page (team queries on a different page).

Slack thread here: https://fleetdm.slack.com/archives/C0480CNGT45/p1735751340839949

This also affects policies in the same way.

Related: https://github.com/fleetdm/fleet/issues/23047 https://github.com/fleetdm/fleet/issues/23051

I have asked QA Wolf to have this test throw an error until the bug has been fixed so hopefully this won't get closed out prematurely again. We should let them know when the bug has been resolved.

jmwatts avatar Jan 02 '25 17:01 jmwatts

This should be fixed as part of a bigger story #23243 Closing this ticket.

sharon-fdm avatar Jan 08 '25 19:01 sharon-fdm

Admin in the clouds, Queries tab, now improved, Ease flows like a stream.

fleet-release avatar Jan 08 '25 19:01 fleet-release

QA Wolf's specific issue was not resolved by #23243 as it did not address scenarios where only inherited policies were shown, and therefore, no Manage Automations dropdown is shown.

This issue will be resolved by #18796 which introduces a toggle to see inherited policies/queries. Therefore, only team policies/queries will show (unless you toggle on inherited policies/queries) and Manage automations will be shown by default. Reopening and will close once that issue is completed and shipped.

jmwatts avatar Apr 18 '25 13:04 jmwatts

scenarios where only inherited policies were shown,

@jmwatts to make sure I'm understanding, the bug case is if there are only inherited queries/policies on the current page, and team policies on a different page?

If there are only inherited policies at all, it makes sense that the automations option would be hidden/disabled

jacobshandling avatar Apr 30 '25 17:04 jacobshandling

@jacobshandling yes, that is correct, and it may make sense based on the way it's implemented, however this results in QA Wolf tests sometimes passing and sometimes failing based on whether or not the team policy is showing on the page.

Additionally, #18796 will resolve this issue, as the inherited queries/policies will be hidden by default. This bug was kept open because it hasn't been resolved yet, but will be if that ticket (or other work) resolves the issue.

jmwatts avatar Apr 30 '25 17:04 jmwatts

Thanks @jmwatts. Since this is reported by QA wolf but not any customers, I'd say it makes sense to wait for #18796 to fix it.

jacobshandling avatar Apr 30 '25 17:04 jacobshandling

Since this is not reported by any customer and may be fixed if #18796 is prioritized, @jmwatts, any reason not to close this one?

sharon-fdm avatar May 05 '25 17:05 sharon-fdm

@sharon-fdm This is causing intermittent failures for QA Wolf tests, so if it's is closed we will no longer be tracking a bug that is blocking some of their testing workflows.

"may be fixed if https://github.com/fleetdm/fleet/issues/18796 is prioritized" might be true, but then we're closing a bug that hasn't been fixed.

I would say either close it as not planned, and we'll tell QA Wolf to deactivate the tests, or leave it open until the bug is resolved.

jmwatts avatar May 05 '25 17:05 jmwatts

@jacobshandling, does this sound like a low-hanging-fruit ticket? (can you please estimate?) If so, let's take it to the new sprint.

sharon-fdm avatar May 05 '25 17:05 sharon-fdm

@noahtalerman This bug slipped off the radar. As we reviewed at QA sync, we realized that is requires design input from product.

lukeheath avatar Jul 15 '25 21:07 lukeheath

This bug slipped off the radar. As we reviewed at QA sync, we realized that is requires design input from product.

Sounds good. Thanks Luke. This bug will go through the bug triage process.

noahtalerman avatar Jul 15 '25 21:07 noahtalerman

@rachaelshaw So if I understand correctly the "To-fix" here is:

  1. When a team is selected on the Manage Queries page, and the only queries listed are inherited ones, then the "Manage automations" link should still appear
  2. The list of queries in the "manage automations" modal should include inherited queries

sgress454 avatar Jul 28 '25 14:07 sgress454

@sgress454 we don't want to change how the automations modals work; instead, I think we need to do the same thing we do for policies: disable the dropdown with a tooltip when the selected team has no team queries.

Basically the exact same thing as this, but with "query" instead of "policy":

Image

rachaelshaw avatar Jul 30 '25 18:07 rachaelshaw

Estimations:

Image

Decision: 1

sharon-fdm avatar Jul 30 '25 19:07 sharon-fdm

disable the dropdown with a tooltip when the selected team has no team queries.

@rachaelshaw has no team queries on the current page? (so disable even if the team has team queries on a not currently selected page)

jacobshandling avatar Jul 30 '25 19:07 jacobshandling

@jacobshandling I thought we added pagination to the automations modal at some point; am I wrong on that?

rachaelshaw avatar Jul 30 '25 19:07 rachaelshaw

gentle bump that this QA Wolf bug is still open cc: @jacobshandling @rachaelshaw @sharon-fdm

RachelElysia avatar Aug 19 '25 20:08 RachelElysia

@sharon-fdm This is a very old bug (I know it's been re-opened a couple of times), so please make sure to prioritize into the next sprint.

lukeheath avatar Aug 27 '25 15:08 lukeheath

The spec for this bug is not ready for development. There seem to be 2 conversations going around solving this, both of which need further fleshing out. My understanding:

The bug: When a user views a page of Queries with a team selected, and the current page of queries is only inherited (i.e. global) queries, the "Manage automations" button is hidden, even when the selected team does have query(ies) on a different page.

  • Conversation 1: This story was supposed to introduce a toggle for including/excluding inherited queries in this team view. It seems to have fallen off the map, @noahtalerman you may want to bring this back in to the pipeline. Even in the existing Figma for that story, I don't see any handling of this bug scenario, i.e., toggle includes inherited queries, only inherited queries are on current page. So, unless I'm misunderstanding, this story as specced would still not solve the bug.

  • Conversation 2: @rachaelshaw, responding to your comment here - the relevant set of queries, as of now, is the set on the queries table, not in the modal. Once the modal is open, it only displays team-level queries. The table/page-level queries, when all on current page are inherited, cause the button to be disabled. We can't just do what's on the policies page for the queries page because this bug exists there also, as the title now reads, though instead of hiding the button altogether, the disabled tooltip reads "To manage automations add a policy to this team." : Image

Some potential solutions - since this applies to both policies and queries, I'll refer to "entities": 1) Always show button, update disabled tooltip text depending on scenario: - Always show the manage automations button on the Queries page (already always visible on Policies) - If there are no team-level entities on the current page - disable the button - determine appropriate tooltip text: - Call a count endpoint or use existing count field from list response for team entities that excludes inherited entities. If this count >= 0, the text indicates "find a page with team level entities to manage automations" and/or the work from conversation 1 has happened and it reads "filter for team-level entities only" or similar

  • Advantages: Don't have to seriously re-tool the data flow of these pages, simpler and faster fix.
  • Disadvantages: Not great UX to tell the user "find team entities" - telling them to hit the above toggle would be better. Maybe the work is to update that story's spec to include this tooltip work and prioritize the whole thing.

2) Depend on team list entity endpoint's count field / team entity count endpoint for whether or not to disable the manage automations button - Instead of using the list of entities to determine whether or not to show the button (current), use a count - Since the manage policies automation modal already fetches its own data, that should already work. - the manage query automations modal currently uses data and handlers passed in from the parent page. This change would mean updating the query automations modal to fetch its own data and retooling large parts of the manage queries page.

Advantages: User always can access the manage automations modal when there are team queries, even if not visible on the current page Disadvantages: Much larger lift on the manage queries page. Weird UX to click Manage automations and see a list of entities you didn't see on the table.

Hopefully I've understood and distilled the problem and current state of discourse around it clearly, and one of these solutions is workable. If not, I think async communication has not worked well for this issue and the above story, and we should either A) bring this to design review or B) sweep this under the rug as not worth the capacity (I'm not seeing any customer labels) and remove the failing QA wolf test(s)!

@rachaelshaw @noahtalerman @sharon-fdm

jacobshandling avatar Sep 24 '25 01:09 jacobshandling