flyteadmin icon indicating copy to clipboard operation
flyteadmin copied to clipboard

Fix sorting bug for named entities

Open pmahindrakar-oss opened this issue 3 years ago • 1 comments

Signed-off-by: Prafulla Mahindrakar [email protected]

TL;DR

The column used in ordering should be part of the group by clause aswell and hence have added the created_at column too. This wasn't happening for created_at column which was absent.

Only the record sets cannot be orderd by state since those dont exist workflow table.

With the fix :

flytectl get workflow -p flytesnacks -d development --filter.fieldSelector "state=0" --filter.sortBy "created_at" 
 --------------- ------------- ------------------------------------------------------------- ------------------------ ------- 
| PROJECT (46)  | DOMAIN      | NAME                                                        | DESCRIPTION            | STATE |
 --------------- ------------- ------------------------------------------------------------- ------------------------ ------- 
| flytesnacks   | development | core.containerization.use_secrets.my_secret_workflow        |                        |       |
 --------------- ------------- ------------------------------------------------------------- ------------------------ ------- 

Type

  • [X] Bug Fix
  • [ ] Feature
  • [ ] Plugin

Are all requirements met?

  • [X] Code completed
  • [X] Smoke tested
  • [X] Unit tests added
  • [ ] Code documentation added
  • [ ] Any pending items have an associated Issue

Complete description

How did you fix the bug, make the feature etc. Link to any design docs etc

Tracking Issue

fixes https://github.com/flyteorg/flyte/issues/2327

Follow-up issue

NA

pmahindrakar-oss avatar Apr 07 '22 14:04 pmahindrakar-oss

Codecov Report

Merging #394 (47bb2ec) into master (d9b1c03) will increase coverage by 0.57%. The diff coverage is 100.00%.

:exclamation: Current head 47bb2ec differs from pull request most recent head 0e3915c. Consider uploading reports for the commit 0e3915c to get more accurate results

@@            Coverage Diff             @@
##           master     #394      +/-   ##
==========================================
+ Coverage   60.80%   61.38%   +0.57%     
==========================================
  Files         151      154       +3     
  Lines       10799    11088     +289     
==========================================
+ Hits         6566     6806     +240     
- Misses       3529     3578      +49     
  Partials      704      704              
Flag Coverage Δ
unittests 60.35% <100.00%> (+0.57%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/repositories/gormimpl/common.go 60.71% <ø> (ø)
pkg/repositories/gormimpl/named_entity_repo.go 82.00% <100.00%> (+11.00%) :arrow_up:
pkg/repositories/gormimpl/node_execution_repo.go 67.66% <0.00%> (-5.92%) :arrow_down:
pkg/manager/impl/execution_manager.go 73.96% <0.00%> (-0.18%) :arrow_down:
pkg/repositories/config/migrations.go 2.65% <0.00%> (-0.15%) :arrow_down:
pkg/rpc/adminservice/base.go 4.12% <0.00%> (-0.05%) :arrow_down:
pkg/manager/impl/task_execution_manager.go 71.75% <0.00%> (ø)
...c/notifications/implementations/event_publisher.go 94.28% <0.00%> (ø)
...cloudevent/implementations/cloudevent_publisher.go 86.44% <0.00%> (ø)
pkg/async/cloudevent/factory.go 84.00% <0.00%> (ø)
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update d9b1c03...0e3915c. Read the comment docs.

codecov[bot] avatar Apr 07 '22 14:04 codecov[bot]