Projet

Général

Profil

Development #42504

ajouter un script pour vérifier à chaque build si des migrations sont manquantes

Ajouté par Benjamin Dauvergne il y a presque 4 ans. Mis à jour il y a presque 4 ans.

Statut:
Fermé
Priorité:
Normal
Assigné à:
Catégorie:
-
Version cible:
-
Début:
05 mai 2020
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Oui
Planning:
Non

Description

Au passage on corrigera les migrations auxquelles il manque des valeurs sans conséquences pour la BDD.

Contexte : plein d'adaptation aux migrations manquantes suite aux mises à jour dj22 et python3, ça rend difficile de développer proprement de nouvelles migrations, avec ce script on ne sera plus jamais en retard.


Fichiers

0010-tox.ini-ignore-warning-between-Django-1.11-and-Pytho.patch (1002 octets) 0010-tox.ini-ignore-warning-between-Django-1.11-and-Pytho.patch Benjamin Dauvergne, 05 mai 2020 16:08
0003-misc-remove-byte-strings-in-migrations-42504.patch (52,9 ko) 0003-misc-remove-byte-strings-in-migrations-42504.patch Benjamin Dauvergne, 05 mai 2020 16:08
0004-misc-add-missing-blank-True-to-BooleanField-in-migra.patch (13,9 ko) 0004-misc-add-missing-blank-True-to-BooleanField-in-migra.patch Benjamin Dauvergne, 05 mai 2020 16:08
0002-custom_user-remove-permission-view_user-42504.patch (3,44 ko) 0002-custom_user-remove-permission-view_user-42504.patch Benjamin Dauvergne, 05 mai 2020 16:08
0001-tox.ini-add-a-check-migrations.sh-script-to-check-mi.patch (1,48 ko) 0001-tox.ini-add-a-check-migrations.sh-script-to-check-mi.patch Benjamin Dauvergne, 05 mai 2020 16:08
0006-misc-use-NullBooleanField-for-BooleanField-null-True.patch (2,07 ko) 0006-misc-use-NullBooleanField-for-BooleanField-null-True.patch Benjamin Dauvergne, 05 mai 2020 16:08
0009-idp_oidc-fix-order-of-ALGO_CHOICES-in-migrations-425.patch (3,39 ko) 0009-idp_oidc-fix-order-of-ALGO_CHOICES-in-migrations-425.patch Benjamin Dauvergne, 05 mai 2020 16:08
0005-misc-add-missing-base_manager-declarations-to-migrat.patch (2,14 ko) 0005-misc-add-missing-base_manager-declarations-to-migrat.patch Benjamin Dauvergne, 05 mai 2020 16:08
0007-saml-fix-order-of-NAME_ID_FORMATS-42504.patch (4,36 ko) 0007-saml-fix-order-of-NAME_ID_FORMATS-42504.patch Benjamin Dauvergne, 05 mai 2020 16:08
0008-django_rbac-fix-path-of-get_hex_uuid-function-42504.patch (2,21 ko) 0008-django_rbac-fix-path-of-get_hex_uuid-function-42504.patch Benjamin Dauvergne, 05 mai 2020 16:08

Révisions associées

Révision 986a0b3b (diff)
Ajouté par Benjamin Dauvergne il y a presque 4 ans

tox.ini: add a check-migrations.sh script to check migrations on each run (#42504)

Révision ddc710af (diff)
Ajouté par Benjamin Dauvergne il y a presque 4 ans

custom_user: remove permission view_user (#42504)

This permission was never used and it is now used by Django 2.1.

Révision 89ca4486 (diff)
Ajouté par Benjamin Dauvergne il y a presque 4 ans

misc: remove byte strings in migrations (#42504)

Révision 6e18d5e6 (diff)
Ajouté par Benjamin Dauvergne il y a presque 4 ans

misc: add missing blank=True to BooleanField in migrations (#42504)

Révision 226f1f98 (diff)
Ajouté par Benjamin Dauvergne il y a presque 4 ans

misc: add missing base_manager declarations to migrations (#42504)

Révision 89f7c068 (diff)
Ajouté par Benjamin Dauvergne il y a presque 4 ans

misc: use NullBooleanField for BooleanField(null=True) with Django<2 (#42504)

Révision 1bbe96b8 (diff)
Ajouté par Benjamin Dauvergne il y a presque 4 ans

saml: fix order of NAME_ID_FORMATS (#42504)

Révision 6099169b (diff)
Ajouté par Benjamin Dauvergne il y a presque 4 ans

django_rbac: fix path of get_hex_uuid function (#42504)

Révision e0526c98 (diff)
Ajouté par Benjamin Dauvergne il y a presque 4 ans

idp_oidc: fix order of ALGO_CHOICES in migrations (#42504)

Choices should not depend on environment.

Révision 0dd9c2d7 (diff)
Ajouté par Benjamin Dauvergne il y a presque 4 ans

tox.ini: ignore warning between Django 1.11 and Python 3.8 (#42504)

Historique

#1

Mis à jour par Benjamin Dauvergne il y a presque 4 ans

#2

Mis à jour par Benjamin Dauvergne il y a presque 4 ans

La branche est plus à jour.

#3

Mis à jour par Benjamin Dauvergne il y a presque 4 ans

  • Description mis à jour (diff)
#4

Mis à jour par Valentin Deniaud il y a presque 4 ans

Ça marche bien.

À propos de 0002, il y a toujours du view_user qui traîne, genre manager/user_views.py: permissions = ['custom_user.view_user'], c'est normal ?

Et makemigrations génère toujours une migration pour auth et une autre chelou dans django, le script les ignore mais c'est pas possible de réparer ça aussi et de ne pas ignorer ?

#5

Mis à jour par Benjamin Dauvergne il y a presque 4 ans

Valentin Deniaud a écrit :

Ça marche bien.

À propos de 0002, il y a toujours du view_user qui traîne, genre manager/user_views.py: permissions = ['custom_user.view_user'], c'est normal ?

C'est ça la blague, ça n'a rien à voir. On a deux systèmes de permissions parallèles django.contrib.auth.models.Permission et authentic2.a2_rbac.models.Permission, qui se recoupent au niveau des backends dans les méthodes .has_perm...(...). En gros on les désigne pareil mais c'est stocké de manière différentes (et au niveau de l'admin Django c'est compatible), via les rôles dans django_rbac/a2_rbac et au niveau des utilisateurs et des groupes dans django.contrib.auth.

Et makemigrations génère toujours une migration pour auth et une autre chelou dans django, le script les ignore mais c'est pas possible de réparer ça aussi et de ne pas ignorer ?

Je ne voulais pas m'en occuper maintenant, on a du dupliquer les migrations de django.contrib.auth à un moment, si je supprime l'indirection maintenant1 je ne pense pas que ça va marcher tout seul (décalage sur les numéros de migration), je préfère laisser ça à un autre ticket. Les éventuelles migrations manquantes dans admin et auth ne nous posent pas trop de problèmes pour l'instant.

1 dans settings.py :

293 MIGRATION_MODULES = {
294     'auth': 'authentic2.auth_migrations_18',
295     'menu': 'authentic2.menu_migrations',
296     'dashboard': 'authentic2.dashboard_migrations',
297 }

#6

Mis à jour par Valentin Deniaud il y a presque 4 ans

  • Statut changé de Solution proposée à Solution validée

OK, merci pour les explications !

#7

Mis à jour par Benjamin Dauvergne il y a presque 4 ans

  • Statut changé de Solution validée à Résolu (à déployer)
commit 0dd9c2d76f28274220e7d0ccc7a988359872c1c5
Author: Benjamin Dauvergne <bdauvergne@entrouvert.com>
Date:   Tue May 5 16:07:42 2020 +0200

    tox.ini: ignore warning between Django 1.11 and Python 3.8 (#42504)

commit e0526c989570fd9950b1ce9efc7894c801d7a289
Author: Benjamin Dauvergne <bdauvergne@entrouvert.com>
Date:   Tue May 5 15:30:17 2020 +0200

    idp_oidc: fix order of ALGO_CHOICES in migrations (#42504)

    Choices should not depend on environment.

commit 6099169b6913f8a6b82175751dfa8a03f6a9a217
Author: Benjamin Dauvergne <bdauvergne@entrouvert.com>
Date:   Tue May 5 15:28:26 2020 +0200

    django_rbac: fix path of get_hex_uuid function (#42504)

commit 1bbe96b846b1efae6085a2b1cfe65216c5211dd4
Author: Benjamin Dauvergne <bdauvergne@entrouvert.com>
Date:   Tue May 5 15:27:58 2020 +0200

    saml: fix order of NAME_ID_FORMATS (#42504)

commit 89f7c068da45ca89f018d98bba4db93515a5d3ed
Author: Benjamin Dauvergne <bdauvergne@entrouvert.com>
Date:   Tue May 5 15:27:38 2020 +0200

    misc: use NullBooleanField for BooleanField(null=True) with Django<2 (#42504)

commit 226f1f98f52c1dfa9306c75f6cc5134b02e7dce6
Author: Benjamin Dauvergne <bdauvergne@entrouvert.com>
Date:   Tue May 5 15:27:08 2020 +0200

    misc: add missing base_manager declarations to migrations (#42504)

commit 6e18d5e62e19cf7b40e916a3847c49854df7e2eb
Author: Benjamin Dauvergne <bdauvergne@entrouvert.com>
Date:   Tue May 5 13:54:46 2020 +0200

    misc: add missing blank=True to BooleanField in migrations (#42504)

commit 89ca44863c2fbb4e7fba7dddb79589decd334db4
Author: Benjamin Dauvergne <bdauvergne@entrouvert.com>
Date:   Tue May 5 13:54:23 2020 +0200

    misc: remove byte strings in migrations (#42504)

commit ddc710af0c776c58ffb594c4a7f94f6db30b50c3
Author: Benjamin Dauvergne <bdauvergne@entrouvert.com>
Date:   Tue May 5 13:19:00 2020 +0200

    custom_user: remove permission view_user (#42504)

    This permission was never used and it is now used by Django 2.1.

commit 986a0b3ba88d4cf39fb46c6ceb9b10feeaf889d1
Author: Benjamin Dauvergne <bdauvergne@entrouvert.com>
Date:   Tue May 5 13:18:46 2020 +0200

    tox.ini: add a check-migrations.sh script to check migrations on each run (#42504)
#8

Mis à jour par Frédéric Péters il y a presque 4 ans

  • Statut changé de Résolu (à déployer) à Solution déployée

Formats disponibles : Atom PDF