Revert "Remove usage of deprecated django storage settings (#581)"#600
Revert "Remove usage of deprecated django storage settings (#581)"#600
Conversation
This reverts commit 7775beb.
Reviewer's GuideThis PR reverts the prior removal of deprecated Django storage settings by restoring AWS_* environment variable mappings in deploy configurations, updating the domain storage script to use AWS_* attributes, and renaming related PULP environment variables and parameters accordingly. Class diagram for reverted Django storage settings usageclassDiagram
class settings {
+AWS_S3_ENDPOINT_URL
+AWS_S3_REGION_NAME
+AWS_ACCESS_KEY_ID
+AWS_SECRET_ACCESS_KEY
+AWS_STORAGE_BUCKET_NAME
+AWS_DEFAULT_ACL
+S3_USE_SIGV4
+AWS_S3_SIGNATURE_VERSION
+AWS_S3_ADDRESSING_STYLE
+DEFAULT_FILE_STORAGE
}
%% Previously, settings.storages.default.options was used
class storages_default_options {
+endpoint_url
+region_name
+access_key
+secret_key
+bucket_name
+default_acl
+signature_version
+addressing_style
}
settings <|-- storages_default_options : (previous usage)
%% Now, direct AWS_* attributes are used in settings
%% The diagram shows the reverted structure
Class diagram for domain-storage-script config (reverted)classDiagram
class settings {
+AWS_ACCESS_KEY_ID
+AWS_SECRET_ACCESS_KEY
+AWS_STORAGE_BUCKET_NAME
}
class domain_storage_script {
+config : str
+print(config)
}
settings <.. domain_storage_script : uses
%% The script now directly accesses AWS_* attributes from settings
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey @decko - I've reviewed your changes and they look great!
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `deploy/clowdapp.yaml:134` </location>
<code_context>
+ AWS_ACCESS_KEY_ID = '$S3_ACCESS_KEY_ID'
+ AWS_SECRET_ACCESS_KEY = '$S3_SECRET_ACCESS_KEY'
+ AWS_STORAGE_BUCKET_NAME = '$S3_BUCKET_NAME'
+ AWS_DEFAULT_ACL = "@none None"
+ S3_USE_SIGV4 = True
+ AWS_S3_SIGNATURE_VERSION = "s3v4"
+ AWS_S3_ADDRESSING_STYLE = "path"
</code_context>
<issue_to_address>
The value '@none None' for AWS_DEFAULT_ACL is non-standard and may not be recognized by boto3 or Django-Storages.
Use standard values like 'private', 'public-read', or None (without quotes) for AWS_DEFAULT_ACL. '@none None' may cause errors. Refer to the storage backend documentation for correct configuration.
</issue_to_address>
<suggested_fix>
<<<<<<< SEARCH
AWS_DEFAULT_ACL = "@none None"
=======
AWS_DEFAULT_ACL = None
>>>>>>> REPLACE
</suggested_fix>
### Comment 2
<location> `deploy/clowdapp.yaml:130` </location>
<code_context>
- },
- }
+ AWS_S3_ENDPOINT_URL = "http://${S3_HOSTNAME}:9000"
+ AWS_S3_REGION_NAME = "east"
+ AWS_ACCESS_KEY_ID = '$S3_ACCESS_KEY_ID'
+ AWS_SECRET_ACCESS_KEY = '$S3_SECRET_ACCESS_KEY'
+ AWS_STORAGE_BUCKET_NAME = '$S3_BUCKET_NAME'
</code_context>
<issue_to_address>
The region name is set to 'east', which is not a valid AWS region.
Consider using a standard AWS region name (e.g., 'us-east-1') or clarify if 'east' is intended for a local or mock service to prevent confusion and potential connection issues.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| AWS_ACCESS_KEY_ID = '$S3_ACCESS_KEY_ID' | ||
| AWS_SECRET_ACCESS_KEY = '$S3_SECRET_ACCESS_KEY' | ||
| AWS_STORAGE_BUCKET_NAME = '$S3_BUCKET_NAME' | ||
| AWS_DEFAULT_ACL = "@none None" |
There was a problem hiding this comment.
suggestion (bug_risk): The value '@none None' for AWS_DEFAULT_ACL is non-standard and may not be recognized by boto3 or Django-Storages.
Use standard values like 'private', 'public-read', or None (without quotes) for AWS_DEFAULT_ACL. '@none None' may cause errors. Refer to the storage backend documentation for correct configuration.
| AWS_DEFAULT_ACL = "@none None" | |
| AWS_DEFAULT_ACL = None |
| AWS_S3_REGION_NAME = "east" | ||
| AWS_ACCESS_KEY_ID = '$S3_ACCESS_KEY_ID' |
There was a problem hiding this comment.
issue (bug_risk): The region name is set to 'east', which is not a valid AWS region.
Consider using a standard AWS region name (e.g., 'us-east-1') or clarify if 'east' is intended for a local or mock service to prevent confusion and potential connection issues.
* Reapply "Remove usage of deprecated django storage settings (#581)" (#600) This reverts commit 90373d9. * Update region_name Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> --------- Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
This reverts commit 7775beb.
Summary by Sourcery
Revert the removal of deprecated Django storage settings by updating the ClowdApp deployment manifest to use direct AWS_* environment variables, streamlining S3 configuration, and renaming Pulp storage-related variables.
Enhancements: