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

refactor: versionning des variables applicatives #857

Draft
wants to merge 4 commits into
base: vp/isolate_test_conf
Choose a base branch
from

Conversation

vincentporte
Copy link
Contributor

@vincentporte vincentporte commented Dec 11, 2024

Description

🎸 Versionner les variables applicatives de la communauté

Type de changement

🚧 technique

Points d'attention

🦺 prerequis  : commu #864 + itou secrets #118

🦺 Ajouter les variables d'env

  • CC_PRE_BUILD_HOOK
  • CC_PRE_RUN_HOOK
  • ITOU_SECRETS_HTTPS_REPO_URL
  • SOPS_AGE_KEY

🦺 Supprimer les variables d'env

  • ALLOWED_HOSTS
  • DJANGO_DEBUG
  • DJANGO_SECRET_KEY
  • OPENID_xxx
  • S3_xxx
  • SIB_xxxi

@vincentporte vincentporte requested a review from vperron December 11, 2024 15:45
@vincentporte vincentporte self-assigned this Dec 11, 2024
@vincentporte vincentporte added python Pull requests that update Python code technical debt labels Dec 11, 2024
@vincentporte vincentporte changed the title refactor: versionning des variables applicatives refactor: versionning des variables applicatives Dec 11, 2024
Copy link

@vperron vperron left a comment

Choose a reason for hiding this comment

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

a part deux nits, dans l'ensemble ça me semble OK. Attention je n'ai pas tenté de lancer l'app ou les tests :)

config/settings/base.py Outdated Show resolved Hide resolved
config/settings/dev.py Outdated Show resolved Hide resolved
@vincentporte vincentporte force-pushed the vp/init_c3_versionned_env_vars branch 4 times, most recently from 66d1631 to a32a2f5 Compare December 19, 2024 09:59
@vincentporte vincentporte force-pushed the vp/init_c3_versionned_env_vars branch from a32a2f5 to 1b874c4 Compare December 19, 2024 15:34
@vincentporte vincentporte force-pushed the vp/init_c3_versionned_env_vars branch from 1b874c4 to 10cf3d1 Compare December 19, 2024 16:18
@vincentporte vincentporte added the recette-jetable review_app label Dec 19, 2024
@vincentporte vincentporte changed the base branch from master to vp/isolate_test_conf December 19, 2024 16:43
@vincentporte vincentporte added recette-jetable review_app and removed recette-jetable review_app labels Dec 19, 2024
Copy link
Contributor

🥁 La recette jetable est prête ! 👉 Je veux tester cette PR !

@vincentporte
Copy link
Contributor Author

check in env var

AWS_STORAGE_BUCKET_NAME 
AWS_STORAGE_BUCKET_NAME_PUBLIC 

@vincentporte vincentporte added recette-jetable review_app and removed recette-jetable review_app labels Dec 19, 2024
Copy link
Contributor

🥁 La recette jetable est prête ! 👉 Je veux tester cette PR !

@vincentporte
Copy link
Contributor Author

🔴

2024-12-19T17:34:35.194Z: Loading data
2024-12-19T17:34:36.784Z: Installed 38 object(s) from 1 fixture(s)
2024-12-19T17:34:39.076Z: superuser created
2024-12-19T17:34:39.167Z: Traceback (most recent call last):
2024-12-19T17:34:39.179Z:   File "/home/bas/app_0a1a04d0-6423-4651-b1ca-62d226d8a41a/manage.py", line 31, in <module>
2024-12-19T17:34:39.179Z:     main()
2024-12-19T17:34:39.179Z:     ~~~~^^
2024-12-19T17:34:39.180Z:   File "/home/bas/app_0a1a04d0-6423-4651-b1ca-62d226d8a41a/manage.py", line 27, in main
2024-12-19T17:34:39.180Z:     execute_from_command_line(sys.argv)
2024-12-19T17:34:39.180Z:     ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
2024-12-19T17:34:39.180Z:   File "/home/bas/venv/lib/python3.13/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
2024-12-19T17:34:39.180Z:     utility.execute()
2024-12-19T17:34:39.180Z:     ~~~~~~~~~~~~~~~^^
2024-12-19T17:34:39.180Z:   File "/home/bas/venv/lib/python3.13/site-packages/django/core/management/__init__.py", line 436, in execute
2024-12-19T17:34:39.180Z:     self.fetch_command(subcommand).run_from_argv(self.argv)
2024-12-19T17:34:39.180Z:     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
2024-12-19T17:34:39.181Z:   File "/home/bas/venv/lib/python3.13/site-packages/django/core/management/base.py", line 413, in run_from_argv
2024-12-19T17:34:39.181Z:     self.execute(*args, **cmd_options)
2024-12-19T17:34:39.181Z:     ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
2024-12-19T17:34:39.181Z:   File "/home/bas/venv/lib/python3.13/site-packages/django/core/management/base.py", line 459, in execute
2024-12-19T17:34:39.181Z:     output = self.handle(*args, **options)
2024-12-19T17:34:39.181Z:   File "/home/bas/app_0a1a04d0-6423-4651-b1ca-62d226d8a41a/lacommunaute/forum/management/commands/populate.py", line 22, in handle
2024-12-19T17:34:39.181Z:     partners = PartnerFactory.create_batch(5, with_logo=True)
2024-12-19T17:34:39.181Z:   File "/home/bas/venv/lib/python3.13/site-packages/factory/base.py", line 553, in create_batch
2024-12-19T17:34:39.181Z:     return [cls.create(**kwargs) for _ in range(size)]
2024-12-19T17:34:39.181Z:             ~~~~~~~~~~^^^^^^^^^^
2024-12-19T17:34:39.181Z:   File "/home/bas/venv/lib/python3.13/site-packages/factory/base.py", line 539, in create
2024-12-19T17:34:39.181Z:     return cls._generate(enums.CREATE_STRATEGY, kwargs)
2024-12-19T17:34:39.181Z:            ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-12-19T17:34:39.181Z:   File "/home/bas/venv/lib/python3.13/site-packages/factory/django.py", line 122, in _generate
2024-12-19T17:34:39.181Z:     return super()._generate(strategy, params)
2024-12-19T17:34:39.181Z:            ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
2024-12-19T17:34:39.181Z:   File "/home/bas/venv/lib/python3.13/site-packages/factory/base.py", line 468, in _generate
2024-12-19T17:34:39.181Z:     return step.build()
2024-12-19T17:34:39.181Z:            ~~~~~~~~~~^^
2024-12-19T17:34:39.181Z:   File "/home/bas/venv/lib/python3.13/site-packages/factory/builder.py", line 274, in build
2024-12-19T17:34:39.181Z:     instance = self.factory_meta.instantiate(
2024-12-19T17:34:39.181Z:         step=step,
2024-12-19T17:34:39.181Z:         args=args,
2024-12-19T17:34:39.181Z:         kwargs=kwargs,
2024-12-19T17:34:39.181Z:     )
2024-12-19T17:34:39.181Z:   File "/home/bas/venv/lib/python3.13/site-packages/factory/base.py", line 320, in instantiate
2024-12-19T17:34:39.181Z:     return self.factory._create(model, *args, **kwargs)
2024-12-19T17:34:39.181Z:            ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
2024-12-19T17:34:39.181Z:   File "/home/bas/venv/lib/python3.13/site-packages/factory/django.py", line 175, in _create
2024-12-19T17:34:39.181Z:     return manager.create(*args, **kwargs)
2024-12-19T17:34:39.181Z:            ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
2024-12-19T17:34:39.181Z:   File "/home/bas/venv/lib/python3.13/site-packages/django/db/models/manager.py", line 87, in manager_method
2024-12-19T17:34:39.181Z:     return getattr(self.get_queryset(), name)(*args, **kwargs)
2024-12-19T17:34:39.182Z:     return field.pre_save(obj, add=True)
2024-12-19T17:34:39.182Z:            ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
2024-12-19T17:34:39.182Z:   File "/home/bas/venv/lib/python3.13/site-packages/django/db/models/fields/files.py", line 324, in pre_save
2024-12-19T17:34:39.182Z:     file.save(file.name, file.file, save=False)
2024-12-19T17:34:39.182Z:     ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-12-19T17:34:39.182Z:   File "/home/bas/venv/lib/python3.13/site-packages/django/db/models/fields/files.py", line 94, in save
2024-12-19T17:34:39.182Z:     self.name = self.storage.save(name, content, max_length=self.field.max_length)
2024-12-19T17:34:39.182Z:                 ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-12-19T17:34:39.182Z:   File "/home/bas/venv/lib/python3.13/site-packages/django/core/files/storage/base.py", line 44, in save
2024-12-19T17:34:39.182Z:     name = self.get_available_name(name, max_length=max_length)
2024-12-19T17:34:39.182Z:   File "/home/bas/venv/lib/python3.13/site-packages/django/core/files/storage/base.py", line 88, in get_available_name
2024-12-19T17:34:39.182Z:     while self.exists(name) or (max_length and len(name) > max_length):
2024-12-19T17:34:39.182Z:           ~~~~~~~~~~~^^^^^^
2024-12-19T17:34:39.182Z:   File "/home/bas/venv/lib/python3.13/site-packages/storages/backends/s3.py", line 587, in exists
2024-12-19T17:34:39.182Z:     self.connection.meta.client.head_object(Bucket=self.bucket_name, Key=name)
2024-12-19T17:34:39.182Z:     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-12-19T17:34:39.182Z:   File "/home/bas/venv/lib/python3.13/site-packages/botocore/client.py", line 569, in _api_call
2024-12-19T17:34:39.182Z:     return self._make_api_call(operation_name, kwargs)
2024-12-19T17:34:39.182Z:            ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
2024-12-19T17:34:39.182Z:   File "/home/bas/venv/lib/python3.13/site-packages/botocore/client.py", line 964, in _make_api_call
2024-12-19T17:34:39.182Z:     api_params = self._emit_api_params(
2024-12-19T17:34:39.182Z:         api_params=api_params,
2024-12-19T17:34:39.182Z:         operation_model=operation_model,
2024-12-19T17:34:39.182Z:         context=request_context,
2024-12-19T17:34:39.182Z:     )
2024-12-19T17:34:39.182Z:   File "/home/bas/venv/lib/python3.13/site-packages/botocore/client.py", line 1083, in _emit_api_params
2024-12-19T17:34:39.182Z:     self.meta.events.emit(
2024-12-19T17:34:39.182Z:     ~~~~~~~~~~~~~~~~~~~~~^
2024-12-19T17:34:39.182Z:         f'before-parameter-build.{service_id}.{operation_name}',
2024-12-19T17:34:39.182Z:         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-12-19T17:34:39.182Z:     ...<2 lines>...
2024-12-19T17:34:39.182Z:         context=context,
2024-12-19T17:34:39.182Z:         ^^^^^^^^^^^^^^^^
2024-12-19T17:34:39.182Z:     )
2024-12-19T17:34:39.182Z:     ^
2024-12-19T17:34:39.182Z:   File "/home/bas/venv/lib/python3.13/site-packages/botocore/hooks.py", line 412, in emit
2024-12-19T17:34:39.182Z:     return self._emitter.emit(aliased_event_name, **kwargs)
2024-12-19T17:34:39.182Z:            ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-12-19T17:34:39.182Z:   File "/home/bas/venv/lib/python3.13/site-packages/botocore/hooks.py", line 256, in emit
2024-12-19T17:34:39.182Z:     return self._emit(event_name, kwargs)
2024-12-19T17:34:39.182Z:            ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
2024-12-19T17:34:39.182Z:   File "/home/bas/venv/lib/python3.13/site-packages/botocore/hooks.py", line 239, in _emit
2024-12-19T17:34:39.182Z:     response = handler(**kwargs)
2024-12-19T17:34:39.182Z:   File "/home/bas/venv/lib/python3.13/site-packages/botocore/handlers.py", line 294, in validate_bucket_name
2024-12-19T17:34:39.182Z:     if not VALID_BUCKET.search(bucket) and not VALID_S3_ARN.search(bucket):
2024-12-19T17:34:39.182Z:            ~~~~~~~~~~~~~~~~~~~^^^^^^^^
2024-12-19T17:34:39.182Z: TypeError: expected string or bytes-like object, got 'NoneType'
2024-12-19T17:34:39.630Z: [INFO] Successfully deployed in 1 minute and 19 seconds
2024-12-19T17:34:39.630Z: Uploading application build cache archive… file is 225M before compression.

@vincentporte vincentporte removed the recette-jetable review_app label Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python Pull requests that update Python code technical debt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants