Skip to content
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

fix(django-upgrade): upgrade django major version #4136

Merged
merged 10 commits into from
Aug 28, 2024

Conversation

gagantrivedi
Copy link
Member

@gagantrivedi gagantrivedi commented Jun 10, 2024

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

  • I have run pre-commit to check linting
  • 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

BREAKING CHANGE: Upgrade django major version

How did you test this code?

Updates tests

@gagantrivedi gagantrivedi added improvement Improvement to the existing platform api Issue related to the REST API dependencies Pull requests that update a dependency file labels Jun 10, 2024
Copy link

vercel bot commented Jun 10, 2024

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 Aug 22, 2024 6:58am
flagsmith-frontend-preview ⬜️ Ignored (Inspect) Visit Preview Aug 22, 2024 6:58am
flagsmith-frontend-staging ⬜️ Ignored (Inspect) Visit Preview Aug 22, 2024 6:58am

@gagantrivedi gagantrivedi changed the title build(deps): upgrade django build(deps): upgrade django to 4.x Jun 10, 2024
@gagantrivedi gagantrivedi changed the title build(deps): upgrade django to 4.x build(deps): upgrade django major version Jun 10, 2024
Copy link
Contributor

github-actions bot commented Jun 10, 2024

Uffizzi Preview deployment-54081 was deleted.

Copy link

codecov bot commented Jun 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.95%. Comparing base (18ed5d2) to head (4a3e2ce).
Report is 11 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4136      +/-   ##
==========================================
+ Coverage   96.92%   96.95%   +0.02%     
==========================================
  Files        1178     1152      -26     
  Lines       39623    39650      +27     
==========================================
+ Hits        38405    38442      +37     
+ Misses       1218     1208      -10     

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

@gagantrivedi gagantrivedi changed the title build(deps): upgrade django major version deps: upgrade django major version Jun 10, 2024
@gagantrivedi gagantrivedi added api Issue related to the REST API and removed api Issue related to the REST API labels Jun 10, 2024
@matthewelwell matthewelwell changed the title deps: upgrade django major version deps!: upgrade django major version Jun 12, 2024
@matthewelwell
Copy link
Contributor

@gagantrivedi just a heads up that I've updated the title of this PR to mark it as breaking

@gagantrivedi gagantrivedi force-pushed the feat/upgrade-django branch from caffa2b to 56b5148 Compare July 11, 2024 04:06
@github-actions github-actions bot removed the dependencies Pull requests that update a dependency file label Jul 11, 2024
@gagantrivedi gagantrivedi changed the title deps!: upgrade django major version deps(django)!: upgrade django major version Jul 11, 2024
@gagantrivedi gagantrivedi changed the title deps(django)!: upgrade django major version fix(django-upgrade)!: upgrade django major version Jul 11, 2024
@gagantrivedi gagantrivedi removed the improvement Improvement to the existing platform label Jul 11, 2024
@gagantrivedi gagantrivedi marked this pull request as ready for review July 11, 2024 04:21
@gagantrivedi gagantrivedi requested a review from a team as a code owner July 11, 2024 04:21
@gagantrivedi gagantrivedi requested review from novakzaballa and removed request for a team July 11, 2024 04:21
Copy link
Contributor

github-actions bot commented Jul 11, 2024

flagsmith-private-cloud image build and security scan finished ✨

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-private-cloud:pr-4136 Finished ✅ Results

Copy link
Contributor

github-actions bot commented Jul 11, 2024

flagsmith-frontend image build and security scan finished ✨

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-frontend:pr-4136 Finished ✅ Results

Copy link
Contributor

github-actions bot commented Jul 11, 2024

flagsmith-e2e image build finished ✨

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-e2e:pr-4136 Finished ✅ Skipped

Copy link
Contributor

github-actions bot commented Jul 11, 2024

flagsmith image build and security scan finished ✨

Image Build Status Security report
ghcr.io/flagsmith/flagsmith:pr-4136 Finished ✅ Results

Copy link
Contributor

github-actions bot commented Jul 11, 2024

flagsmith-api image build and security scan finished ✨

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-api:pr-4136 Finished ✅ Results

@gagantrivedi gagantrivedi removed the api Issue related to the REST API label Jul 11, 2024
@gagantrivedi gagantrivedi changed the title fix(django-upgrade)!: upgrade django major version fix(django-upgrade): upgrade django major version Jul 11, 2024
@gagantrivedi gagantrivedi changed the title fix(django-upgrade): upgrade django major version fix(django-upgrade)!: upgrade django major version Jul 11, 2024
update pyproject.toml

bump pytest-django

update test

remove default_app_config

bump pytest-xdist

rbac test fixes

remove default_app_config

cover fixes
api/environments/identities/models.py Show resolved Hide resolved
):
# Given
if (
settings.IS_RBAC_INSTALLED and not is_admin_master_api_key_client
Copy link
Contributor

Choose a reason for hiding this comment

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

This feels slightly odd to me:

  1. I'd rather not have to use another parametrized argument for the boolean if we can avoid it (although I have looked into it myself and can't see any obvious options).
  2. If we do need to use the extra argument, why not invert it and use is_admin_client rather than is_admin_master_api_key_client?

Either way, it'd be good to add a comment as to why we expect the extra query in this scenario.

Comment on lines 2594 to 2656
if settings.IS_RBAC_INSTALLED: # pragma: no cover
num_queries += 1
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess what Gagan is trying to achieve here is a generic solution that works for both (one which includes all the private packages) and one which doesn't.

I guess with @khvn26 's approach, we could add a pytest.mark.skip perhaps?

@gagantrivedi gagantrivedi added api Issue related to the REST API and removed api Issue related to the REST API labels Aug 22, 2024
@gagantrivedi gagantrivedi force-pushed the feat/upgrade-django branch 2 times, most recently from 758fc94 to 4a3e2ce Compare August 22, 2024 06:58
@gagantrivedi gagantrivedi added api Issue related to the REST API and removed api Issue related to the REST API labels Aug 22, 2024
Copy link
Contributor

@matthewelwell matthewelwell left a comment

Choose a reason for hiding this comment

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

Looks good to me, but keen to get @khvn26 's thoughts on the solution to the main discussion thread.

@gagantrivedi gagantrivedi changed the title fix(django-upgrade)!: upgrade django major version fix(django-upgrade): upgrade django major version Aug 28, 2024
@gagantrivedi gagantrivedi added this pull request to the merge queue Aug 28, 2024
Merged via the queue into main with commit aa234e4 Aug 28, 2024
35 of 36 checks passed
@gagantrivedi gagantrivedi deleted the feat/upgrade-django branch August 28, 2024 08:05
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 improvement Improvement to the existing platform tech-debt Technical debt issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants