Skip to content

refactor(Versioning): Publish a feature version with an AuthorData - #8310

Open
khvn26 wants to merge 2 commits into
chore/update-flag-cleanupfrom
refactor/publish-author
Open

refactor(Versioning): Publish a feature version with an AuthorData#8310
khvn26 wants to merge 2 commits into
chore/update-flag-cleanupfrom
refactor/publish-author

Conversation

@khvn26

@khvn26 khvn26 commented Aug 16, 2026

Copy link
Copy Markdown
Member
  • 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

Stacked on #8308.

In this PR, we accommodate EnvironmentFeatureVersion.publish() to the AuthorData dataclass.

EnvironmentFeatureVersion.publish() took published_by and published_by_api_key, so every caller had to categorise a request user. That split was written four ways across the codebase, and one of them was wrong: EnvironmentFeatureVersionCreateSerializer only handled FFAdminUser, so a version created with publish_immediately by a master API key recorded no publisher at all. Fixed here, with a test.

publish() now takes an AuthorData, which callers construct directly, or via AuthorData.from_request(request) where a request is available.

We also drop a dead serializer.save(published_by=request.user) kwarg in EnvironmentFeatureVersionViewSet.publish — the serializer reads the author from the request context and ignored it.

No behaviour change beyond the attribution fix.

How did you test this code?

Added unit tests, and modified existing tests asserting EnvironmentFeatureVersion.publish().

@khvn26
khvn26 requested review from a team as code owners August 16, 2026 12:18
@khvn26
khvn26 requested review from emyller and removed request for a team August 16, 2026 12:18
@vercel

vercel Bot commented Aug 16, 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 Preview Aug 16, 2026 3:38pm
flagsmith-frontend-preview Ignored Ignored Preview Aug 16, 2026 3:38pm
flagsmith-frontend-staging Ignored Ignored Preview Aug 16, 2026 3:38pm

Request Review

@coderabbitai

coderabbitai Bot commented Aug 16, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 82dc7adb-047f-4a38-946d-a4e2da72ce4a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added api Issue related to the REST API docs Documentation updates labels Aug 16, 2026
@github-actions github-actions Bot added refactor and removed docs Documentation updates labels Aug 16, 2026
@github-actions

github-actions Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Docker builds report

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

@github-actions

github-actions Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor
✅ private-cloud · depot-ubuntu-latest-arm-16 — run #19450 (attempt 1)

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

passed  2 passed

Details

stats  2 tests across 2 suites
duration  1 minute, 1 second
commit  187c818
info  🔄 Run: #19450 (attempt 1)

🗂️ Previous results
✅ private-cloud · depot-ubuntu-latest-16 — run #19450 (attempt 1)

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

passed  3 passed

Details

stats  3 tests across 3 suites
duration  33.1 seconds
commit  187c818
info  🔄 Run: #19450 (attempt 1)

✅ oss · depot-ubuntu-latest-arm-16 — run #19450 (attempt 1)

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  44.7 seconds
commit  187c818
info  🔄 Run: #19450 (attempt 1)

✅ oss · depot-ubuntu-latest-16 — run #19450 (attempt 1)

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  33.7 seconds
commit  187c818
info  🔄 Run: #19450 (attempt 1)

✅ private-cloud · depot-ubuntu-latest-16 — run #19447 (attempt 1)

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  55.2 seconds
commit  3e25f55
info  🔄 Run: #19447 (attempt 1)

✅ private-cloud · depot-ubuntu-latest-arm-16 — run #19447 (attempt 1)

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

passed  3 passed

Details

stats  3 tests across 3 suites
duration  37.1 seconds
commit  3e25f55
info  🔄 Run: #19447 (attempt 1)

✅ private-cloud · depot-ubuntu-latest-16 — run #19446 (attempt 1)

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

passed  3 passed

Details

stats  3 tests across 3 suites
duration  56.4 seconds
commit  3e25f55
info  🔄 Run: #19446 (attempt 1)

✅ private-cloud · depot-ubuntu-latest-arm-16 — run #19446 (attempt 1)

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  35.1 seconds
commit  3e25f55
info  🔄 Run: #19446 (attempt 1)

✅ oss · depot-ubuntu-latest-arm-16 — run #19447 (attempt 1)

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  46.9 seconds
commit  3e25f55
info  🔄 Run: #19447 (attempt 1)

✅ oss · depot-ubuntu-latest-arm-16 — run #19446 (attempt 1)

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  46.4 seconds
commit  3e25f55
info  🔄 Run: #19446 (attempt 1)

✅ oss · depot-ubuntu-latest-16 — run #19447 (attempt 1)

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  41.7 seconds
commit  3e25f55
info  🔄 Run: #19447 (attempt 1)

✅ oss · depot-ubuntu-latest-16 — run #19446 (attempt 1)

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  40.9 seconds
commit  3e25f55
info  🔄 Run: #19446 (attempt 1)

@github-actions

github-actions Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Visual Regression

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

@codecov

codecov Bot commented Aug 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.64%. Comparing base (d54e52f) to head (187c818).

Additional details and impacted files
@@                      Coverage Diff                      @@
##           chore/update-flag-cleanup    #8310      +/-   ##
=============================================================
- Coverage                      98.78%   98.64%   -0.14%     
=============================================================
  Files                           1605     1606       +1     
  Lines                          64417    64434      +17     
=============================================================
- Hits                           63633    63560      -73     
- Misses                           784      874      +90     

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

@khvn26
khvn26 force-pushed the refactor/publish-author branch from 6b7b050 to 12ffc67 Compare August 16, 2026 12:28
@github-actions github-actions Bot added the docs Documentation updates label Aug 16, 2026
@github-actions github-actions Bot added refactor docs Documentation updates and removed docs Documentation updates refactor labels Aug 16, 2026
@khvn26
khvn26 force-pushed the refactor/publish-author branch from 49778de to 574087f Compare August 16, 2026 13:32
@github-actions github-actions Bot added docs Documentation updates refactor and removed docs Documentation updates refactor labels Aug 16, 2026
@khvn26
khvn26 force-pushed the refactor/publish-author branch from 574087f to 10650cb Compare August 16, 2026 14:02
@github-actions github-actions Bot added docs Documentation updates refactor and removed docs Documentation updates refactor labels Aug 16, 2026
@khvn26
khvn26 force-pushed the refactor/publish-author branch from 10650cb to 3e25f55 Compare August 16, 2026 14:37
@github-actions github-actions Bot added docs Documentation updates refactor and removed docs Documentation updates refactor labels Aug 16, 2026
@khvn26
khvn26 force-pushed the refactor/publish-author branch from 3e25f55 to 187c818 Compare August 16, 2026 15:38
@github-actions github-actions Bot added docs Documentation updates refactor and removed docs Documentation updates refactor labels Aug 16, 2026
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 refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant