Skip to content

feat: Controllable ROOT_URLCONF #5545

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

Conversation

khvn26
Copy link
Member

@khvn26 khvn26 commented Jun 5, 2025

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

  • 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?
  • I have used a Conventional Commit title for this Pull Request

Changes

This PRs refactors the root urlconf to allow the urls marker usage in tests. This is required to enable API routes when TASK_PROCESSOR_MODE is on, which enables the run_tasks fixture usage in functional tests:

@pytest.mark.urls('app.urls.api')
def test_my_stuff(
    api_client: APIClient,
    run_tasks: RunTasksFixture,
) -> None:
    # When
    api_client.get("/api/v1/my-stuff")  # path only available in API (not task processor) runtime

    # Then
    task_runs = run_tasks(1)
    assert task_runs[0].result == "SUCCESS"

How did you test this code?

Not yet.

Copy link

vercel bot commented Jun 5, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs ⬜️ Ignored (Inspect) Visit Preview Jun 6, 2025 3:33pm
flagsmith-frontend-preview ⬜️ Ignored (Inspect) Visit Preview Jun 6, 2025 3:33pm
flagsmith-frontend-staging ⬜️ Ignored (Inspect) Visit Preview Jun 6, 2025 3:33pm

@github-actions github-actions bot added api Issue related to the REST API feature New feature or request labels Jun 5, 2025
@khvn26 khvn26 force-pushed the feat/controllable-root-url-conf branch from ef5481f to faf3386 Compare June 6, 2025 15:22
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Jun 6, 2025
@khvn26 khvn26 force-pushed the feat/controllable-root-url-conf branch from faf3386 to 562457f Compare June 6, 2025 15:33
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Jun 6, 2025
Copy link

codecov bot commented Jun 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.69%. Comparing base (ad1f3c1) to head (562457f).
⚠️ Report is 113 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5545      +/-   ##
==========================================
- Coverage   97.69%   97.69%   -0.01%     
==========================================
  Files        1247     1248       +1     
  Lines       44250    44248       -2     
==========================================
- Hits        43231    43229       -2     
  Misses       1019     1019              

☔ View full report in Codecov by Sentry.
📢 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 marked this pull request as ready for review June 6, 2025 15:38
@khvn26 khvn26 requested a review from a team as a code owner June 6, 2025 15:38
@khvn26 khvn26 requested review from gagantrivedi and removed request for a team June 6, 2025 15:38
@github-actions github-actions bot removed the feature New feature or request label Jun 6, 2025
Copy link
Contributor

github-actions bot commented Jun 6, 2025

Docker builds report

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

@github-actions github-actions bot added the feature New feature or request label Jun 6, 2025
@gagantrivedi
Copy link
Member

In tests, URLs are loaded before the run_task fixture mock is applied, so we don't need ROOT_URLCONF for now

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 feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants