Bug 1468388
| Summary: | [RFE] Tasks: allow for searching of tasks by 'user' | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Satellite | Reporter: | Chris Duryee <cduryee> | ||||
| Component: | Tasks Plugin | Assignee: | Ivan Necas <inecas> | ||||
| Status: | CLOSED ERRATA | QA Contact: | Peter Ondrejka <pondrejk> | ||||
| Severity: | medium | Docs Contact: | |||||
| Priority: | medium | ||||||
| Version: | 6.2.10 | CC: | aruzicka, bkearney, egolov, inecas, jcallaha, mmccune, nshaik | ||||
| Target Milestone: | 6.7.0 | Keywords: | FieldEngineering, FutureFeature, Reopened, UserExperience | ||||
| Target Release: | Unused | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | tfm-rubygem-foreman-tasks-0.17.1 | Doc Type: | If docs needed, set a value | ||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2020-04-14 13:22:16 UTC | Type: | Bug | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Bug Depends On: | 1631812 | ||||||
| Bug Blocks: | |||||||
| Attachments: |
|
||||||
|
Description
Chris Duryee
2017-07-06 23:03:20 UTC
Created redmine issue http://projects.theforeman.org/issues/20755 from this bug I believe we can do this currently with following search owner.login = admin That's right. Thanks @nagoor for pointing out this can 'user' be added as a synonym for owner.login? it's difficult to figure out from the web ui to use owner.login, since the column is named 'user'. I'm ok with this: opened a PR upstream for it https://github.com/theforeman/foreman-tasks/pull/283 Upstream bug assigned to inecas Upstream bug assigned to inecas Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/20755 has been resolved. Created attachment 1471642 [details]
Search by admin User
Verified in Satellite 6.4
Upstream bug assigned to aruzicka Upstream bug assigned to aruzicka Upstream bug assigned to inecas Upstream bug assigned to aruzicka Upstream bug assigned to inecas FailedQA, tested in sat 6.7 snap 4 Search tasks with query "user = admin" got "Could Not Receive Data: Request Failed With Status Code 500" searching with "owner.login = admin" seem to work ok though. attached foreman-debug Not sure if it helps, but here is dynflow-executor.log: SIGTERM ["/opt/theforeman/tfm/root/usr/share/gems/gems/daemons-1.2.3/lib/daemons/monitor.rb:55:in `sleep'", "/opt/theforeman/tfm/root/usr/share/gems/gems/daemons-1.2.3/lib/daemons/monitor.rb:55:in `block in watch'", "/opt/theforeman/tfm/root/usr/share/gems/gems/daemons-1.2.3/lib/daemons/monitor.rb:42:in `loop'", "/opt/theforeman/tfm/root/usr/share/gems/gems/daemons-1.2.3/lib/daemons/monitor.rb:42:in `watch'", "/opt/theforeman/tfm/root/usr/share/gems/gems/daemons-1.2.3/lib/daemons/monitor.rb:66:in `block in start_with_pidfile'", "/opt/theforeman/tfm/root/usr/share/gems/gems/daemons-1.2.3/lib/daemons/monitor.rb:61:in `fork'", "/opt/theforeman/tfm/root/usr/share/gems/gems/daemons-1.2.3/lib/daemons/monitor.rb:61:in `start_with_pidfile'", "/opt/theforeman/tfm/root/usr/share/gems/gems/daemons-1.2.3/lib/daemons/monitor.rb:92:in `start'", "/opt/theforeman/tfm/root/usr/share/gems/gems/daemons-1.2.3/lib/daemons/application_group.rb:141:in `create_monitor'", "/opt/theforeman/tfm/root/usr/share/gems/gems/daemons-1.2.3/lib/daemons/application.rb:283:in `start'", "/opt/theforeman/tfm/root/usr/share/gems/gems/daemons-1.2.3/lib/daemons/controller.rb:56:in `run'", "/opt/theforeman/tfm/root/usr/share/gems/gems/daemons-1.2.3/lib/daemons.rb:193:in `block in run_proc'", "/opt/theforeman/tfm/root/usr/share/gems/gems/daemons-1.2.3/lib/daemons/cmdline.rb:88:in `catch_exceptions'", "/opt/theforeman/tfm/root/usr/share/gems/gems/daemons-1.2.3/lib/daemons.rb:192:in `run_proc'", "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.1/lib/dynflow/rails/daemon.rb:73:in `block in run_background'", "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.1/lib/dynflow/rails/daemon.rb:72:in `times'", "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.1/lib/dynflow/rails/daemon.rb:72:in `run_background'", "/usr/sbin/dynflowd:71:in `block in <main>'", "/usr/sbin/dynflowd:67:in `chdir'", "/usr/sbin/dynflowd:67:in `<main>'"] Upstream bug assigned to inecas 2019-12-03T10:21:14 [D|app|aec885e2] Backtrace for 'Action failed' error (ActiveRecord::StatementInvalid): PG::AmbiguousColumn: ERROR: ORDER BY "started_at" is ambiguous
| LINE 1: ...,4)) WHERE (("users"."login" = 'admin')) ORDER BY started_at...
| ^
| : SELECT DISTINCT foreman_tasks_tasks.*, *, coalesce(ended_at, current_timestamp) - coalesce(coalesce(started_at, ended_at), current_timestamp) as duration, "foreman_tasks_tasks"."id" AS t0_r0, "foreman_tasks_tasks"."type" AS t0_r1,
"foreman_tasks_tasks"."label" AS t0_r2, "foreman_tasks_tasks"."started_at" AS t0_r3, "foreman_tasks_tasks"."ended_at" AS t0_r4, "foreman_tasks_tasks"."state" AS t0_r5, "foreman_tasks_tasks"."result" AS t0_r6, "foreman_tasks_tasks"."ext
ernal_id" AS t0_r7, "foreman_tasks_tasks"."parent_task_id" AS t0_r8, "foreman_tasks_tasks"."start_at" AS t0_r9, "foreman_tasks_tasks"."start_before" AS t0_r10, "foreman_tasks_tasks"."action" AS t0_r11, "foreman_tasks_tasks"."user_id" AS
t0_r12, "foreman_tasks_tasks"."state_updated_at" AS t0_r13, "users"."id" AS t1_r0, "users"."login" AS t1_r1, "users"."firstname" AS t1_r2, "users"."lastname" AS t1_r3, "users"."mail" AS t1_r4, "users"."admin" AS t1_r5, "users"."last_l$
gin_on" AS t1_r6, "users"."auth_source_id" AS t1_r7, "users"."created_at" AS t1_r8, "users"."updated_at" AS t1_r9, "users"."password_hash" AS t1_r10, "users"."password_salt" AS t1_r11, "users"."locale" AS t1_r12, "users"."avatar_hash" $
S t1_r13, "users"."default_organization_id" AS t1_r14, "users"."default_location_id" AS t1_r15, "users"."lower_login" AS t1_r16, "users"."mail_enabled" AS t1_r17, "users"."timezone" AS t1_r18, "users"."description" AS t1_r19 FROM "fore$
an_tasks_tasks" LEFT OUTER JOIN "users" ON "users"."id" = "foreman_tasks_tasks"."user_id" AND (users.id IN (1,2,3,4,2,4,1,3,4)) WHERE (("users"."login" = 'admin')) ORDER BY started_at DESC LIMIT $1 OFFSET $2
-----B<-----SNIP-----B<-----
| /home/aruzicka/projects/foreman/foreman-tasks/app/controllers/foreman_tasks/api/tasks_controller.rb:299:in `map'
| /home/aruzicka/projects/foreman/foreman-tasks/app/controllers/foreman_tasks/api/tasks_controller.rb:299:in `tasks_list'
-----B<-----SNIP-----B<-----
If you sort by duration, the search for "user = admin" should work. It seems that the default ordering is somehow interfering with the search.
The failure is being addressed in https://bugzilla.redhat.com/show_bug.cgi?id=1779653 Verified on Sat 6.7 snap 8, using all supported search symbols Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2020:1454 |