Skip to content

fix(flyteadmin): keep description entity types separate - #7958

Merged
popojk merged 3 commits into
flyteorg:masterfrom
1fanwang:fix-description-entity-resource-type
Sep 4, 2026
Merged

popojk merged 3 commits into
flyteorg:masterfrom
1fanwang:fix-description-entity-resource-type

Conversation

@1fanwang

@1fanwang 1fanwang commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Why are the changes needed?

When a task and workflow share the same project, domain, name, and version, requesting the workflow description can return the task's description. Listing workflow descriptions can also return both rows.

Description rows use resource_type to distinguish those entities, but Flyteadmin's get and list queries did not filter on that column. After this change, both operations return only the requested type.

What changes were proposed in this pull request?

Add resource_type to the description entity get and list filters. Requests with an unspecified list type keep the existing behavior.

How was this patch tested?

The regression uses the real manager, repository, GORM query path, and an in-memory SQLite table containing a task and workflow with the same identifier.

$ cd flyteadmin
$ go test ./pkg/manager/impl -run '^TestDescriptionEntityManagerDistinguishesResourceType$' -count=1 -v
$ go test ./pkg/repositories/gormimpl ./pkg/manager/impl -count=1
$ go test -race ./pkg/manager/impl \
    -run '^TestDescriptionEntityManagerDistinguishesResourceType$' -count=20
$ cd ../flytestdlib
$ go test -race ./cache -run '^TestInProcessing$' -count=100
Raw logs

Base d8b6a3b49ec3 with the regression test:

--- FAIL: TestDescriptionEntityManagerDistinguishesResourceType
expected: WORKFLOW
actual:   TASK
expected: "workflow"
actual:   "task"
DescriptionEntityList should have 1 item, but has 2
FAIL

This branch:

=== RUN   TestDescriptionEntityManagerDistinguishesResourceType
--- PASS: TestDescriptionEntityManagerDistinguishesResourceType (0.00s)
PASS
ok  github.com/flyteorg/flyte/flyteadmin/pkg/manager/impl
ok  github.com/flyteorg/flyte/flyteadmin/pkg/repositories/gormimpl
ok  github.com/flyteorg/flyte/flyteadmin/pkg/manager/impl  2.470s
ok  github.com/flyteorg/flyte/flytestdlib/cache  1.521s

Labels

fixed

Check all the applicable boxes

  • Documentation is not applicable because no public API or configuration changed.
  • All new and existing affected-package tests passed.
  • All commits are signed-off.

Description entity keys include the resource type, but get and list queries omitted it. Tasks and workflows with the same identifier could therefore return the wrong description or appear in the same list.

Signed-off-by: 1fanwang <1fannnw@gmail.com>
@github-actions github-actions Bot added the flyte label Sep 2, 2026
@codecov

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.50%. Comparing base (ecb5b85) to head (c5bbec2).

Files with missing lines Patch % Lines
...min/pkg/manager/impl/description_entity_manager.go 75.00% 1 Missing and 1 partial ⚠️
...g/repositories/gormimpl/description_entity_repo.go 50.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7958      +/-   ##
==========================================
- Coverage   57.29%   56.50%   -0.79%     
==========================================
  Files         931      772     -159     
  Lines       58305    52285    -6020     
==========================================
- Hits        33405    29545    -3860     
+ Misses      21843    19975    -1868     
+ Partials     3057     2765     -292     
Flag Coverage Δ
unittests-datacatalog 53.62% <ø> (ø)
unittests-flyteadmin 53.24% <66.66%> (+<0.01%) ⬆️
unittests-flytecopilot 48.05% <ø> (ø)
unittests-flytectl ?
unittests-flyteidl 76.63% <ø> (ø)
unittests-flyteplugins 60.45% <ø> (ø)
unittests-flytepropeller 53.84% <ø> (ø)
unittests-flytestdlib 64.39% <ø> (ø)

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

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: 1fanwang <1fannnw@gmail.com>
@AdilFayyaz AdilFayyaz added the fixed For any bug fixes label Sep 3, 2026

@AdilFayyaz AdilFayyaz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good!

@popojk
popojk enabled auto-merge (squash) September 4, 2026 10:17
@popojk
popojk merged commit 80ab015 into flyteorg:master Sep 4, 2026
48 of 50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fixed For any bug fixes flyte

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants