Skip to content

fix(Tagging): TagType evaluated incorrectly in database queries#7877

Merged
emyller merged 1 commit into
mainfrom
fix/stale-tagging
Jun 25, 2026
Merged

fix(Tagging): TagType evaluated incorrectly in database queries#7877
emyller merged 1 commit into
mainfrom
fix/stale-tagging

Conversation

@emyller

@emyller emyller commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Thanks for submitting a PR! Please check the boxes below:

  • I have read the Contributing Guide.
  • I have added information to docs/ if required so people know about the feature.
  • I have filled in the "Changes" section below.
  • I have filled in the "How did you test this code" section below.

Changes

Contributes to #7433

Fixes a bug in which tag-based querying won't bring results because SQL is evaluated with non-str object representation, e.g. WHERE type = '<TagType.STALE>'.

Normalise TagType interfacing:

  • TextChoices provides reliable ergonomics
  • Tests are dumbimised and stick to bare value (ensures contract)

How did you test this code?

Running tests.

@emyller emyller self-assigned this Jun 25, 2026
@emyller emyller requested a review from a team as a code owner June 25, 2026 21:27
@emyller emyller requested review from khvn26 and removed request for a team June 25, 2026 21:27
@vercel

vercel Bot commented Jun 25, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

3 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs Ignored Ignored Jun 25, 2026 9:27pm
flagsmith-frontend-preview Ignored Ignored Jun 25, 2026 9:27pm
flagsmith-frontend-staging Ignored Ignored Jun 25, 2026 9:27pm

Request Review

@github-actions github-actions Bot added api Issue related to the REST API fix labels Jun 25, 2026
@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-e2e:pr-7877 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-api-test:pr-7877 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-frontend:pr-7877 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-api:pr-7877 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-7877 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-7877 Finished ✅ Results

@codecov

codecov Bot commented Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.61%. Comparing base (408f05b) to head (57938f8).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7877      +/-   ##
==========================================
- Coverage   98.61%   98.61%   -0.01%     
==========================================
  Files        1486     1486              
  Lines       58301    58300       -1     
==========================================
- Hits        57495    57494       -1     
  Misses        806      806              

☔ 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.

@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  44.3 seconds
commit  57938f8
info  🔄 Run: #17838 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  42.4 seconds
commit  57938f8
info  🔄 Run: #17838 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  20 passed
skipped  1 skipped

Details

stats  21 tests across 16 suites
duration  1 minute, 17 seconds
commit  57938f8
info  🔄 Run: #17838 (attempt 1)

Skipped tests

firefox › tests/initialise-tests.pw.ts › Signup › Create Organisation and Project @oss

### Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  59.6 seconds
commit  57938f8
info  🔄 Run: #17838 (attempt 1)

@github-actions

Copy link
Copy Markdown
Contributor

Visual Regression

17 screenshots compared. See report for details.
View full report

@khvn26 khvn26 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

Any other enums we should take care of? (doesn't have to be this PR, but having an issue would be nice if anything's left)

@emyller

emyller commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

Any other enums we should take care of? (doesn't have to be this PR, but having an issue would be nice if anything's left)

Good call. Found a couple: #7878

There's a bunch of enums — not Choices — that could be refactored, but I intentionally left those out of right now.

@emyller emyller merged commit 9032039 into main Jun 25, 2026
33 checks passed
@emyller emyller deleted the fix/stale-tagging branch June 25, 2026 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Issue related to the REST API fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants