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

build: swap default file storage away from deprecated lib #32646

Merged
merged 1 commit into from
Jul 31, 2023

Conversation

stvstnfrd
Copy link
Contributor

@stvstnfrd stvstnfrd commented Jul 4, 2023

The S3BotoStorage backend was deprecated in favor of the S3Boto3Storage backend. This change updates the default backend to use the latter.

Style: This re-links a relevant comment that had been disconnected during a previous refactoring.

Note: There is a relevant configuration change forthcoming,
but it's docs/comments only.

Fixes: FAL-3431
Fixes: openedx/public-engineering#128

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Jul 4, 2023
@openedx-webhooks
Copy link

Thanks for the pull request, @stvstnfrd! Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

Please let us know once your PR is ready for our review and all tests are green.

⚠️ We can't start reviewing your pull request until you've submitted a signed contributor agreement or indicated your institutional affiliation. Please see the CONTRIBUTING file for more information. If you've signed an agreement in the past, you may need to re-sign. See The New Home of the Open edX Codebase for details.

Once you've signed the CLA, please allow 1 business day for it to be processed. After this time, you can re-run the CLA check by editing the PR title. If the problem persists, you can tag the @openedx/cla-problems team in a comment on your PR for further assistance.

Copy link
Contributor Author

@stvstnfrd stvstnfrd left a comment

Choose a reason for hiding this comment

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

It looks like the primary, related variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ASSESS_KEY, etc.) remain the same in the new backend, but I'll do a deeper dive to confirm compatibility.

cms/envs/common.py Show resolved Hide resolved
@stvstnfrd
Copy link
Contributor Author

Note: This work is being done on behalf of OpenCraft and should, presumably, be covered under their CLA agreement.

@ChrisChV
Copy link
Contributor

ChrisChV commented Jul 6, 2023

Looks good 👍

I haven't found a way to check if the Deprecation Warning is gone. @stvstnfrd Do you have any idea how to check it?

  • I read through the changes.

cms/envs/production.py Outdated Show resolved Hide resolved
Copy link
Contributor Author

@stvstnfrd stvstnfrd left a comment

Choose a reason for hiding this comment

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

Thanks @ChrisChV . I couldn't find it generated anywhere either.

At face value, that configuration wouldn't be used unless one were setting AWS credentials, which presumably shouldn't happen during tests. I don't think the value is ever being tested/mocked elsewhere.

cms/envs/production.py Outdated Show resolved Hide resolved
@Agrendalath
Copy link
Member

@ChrisChV, @stvstnfrd, I verified that this gets rid of these warnings in a production-like environment. I'll leave the +1 and merge once the CLA check is clear.

@stvstnfrd stvstnfrd changed the title build: swap default file storage _away_ from deprecated lib build: swap default file storage away from deprecated lib Jul 11, 2023
@stvstnfrd
Copy link
Contributor Author

@openedx/cla-problems I've tried re-running the CLA check, but since the runner provides no visual feedback or indicator, I can't tell if it's actually working or not.

Related: Because the CLA check looks like it's been implemented with a webhook and not a Github Action, contributors can't manually rerun the check. If this were implemented with the latter, contributors could re-run the check explicitly, instead of relying on the "edit the title", which is a crude hack. Further, implementing this as a GHA would provide explicit, visual indication that the job was actually rerun (or not).

@stvstnfrd stvstnfrd changed the title build: swap default file storage away from deprecated lib build: swap default file storage _away_ from deprecated lib Jul 12, 2023
@stvstnfrd stvstnfrd changed the title build: swap default file storage _away_ from deprecated lib build: swap default file storage away from deprecated lib Jul 12, 2023
@stvstnfrd
Copy link
Contributor Author

@Agrendalath @ChrisChV Suggestions on who to ping from TCRIL about this?

I tagged @openedx/cla-problems previously, per the comment ^, but it's not clear that's still a valid Github Team (it didn't show up in autocomplete and it's not displayed as a hyperlink)... or maybe it is?

@Agrendalath
Copy link
Member

@mphilbrick211, could you re-run the CLA check?

@tecoholic, is everything done on our end for the CLA?

@pomegranited
Copy link
Contributor

@stvstnfrd This upgrade is painless, with no required configuration changes. But ops people and @openedx/community-release-managers might wonder if there is, so could you add a link to the django-storages Migration docs in your PR description? That section of the docs has since been removed from the master docs, so it can be a little hard to find.

@Agrendalath
Copy link
Member

Rebasing, as the CMS change was merged in #32733.

Copy link
Member

@Agrendalath Agrendalath left a comment

Choose a reason for hiding this comment

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

👍

  • I tested this: tested the S3Boto3Storage in the production-like environment
  • I read through the code
  • I checked for accessibility issues: n/a
  • Includes documentation: n/a
  • I made sure any change in configuration variables is reflected in the corresponding client's configuration-secure repository: n/a

The S3BotoStorage backend was deprecated in favor of the S3Boto3Storage
backend. This change updates the default backend to use the latter.

style: This re-links and rewords a relevant comment that had been
disconnected during previous refactoring.

docs: https://github.com/jschneier/django-storages/blob/ade79308a3f20480bec8a964bdbf2f4e0b50ff43/docs/backends/amazon-S3.rst#migrating-from-boto-to-boto3

Fixes: FAL-3431
Fixes: public-engineering/128
@stvstnfrd
Copy link
Contributor Author

@Agrendalath Rebased.

@pomegranited Commit message amended to contain docs link.

@ormsbee FYI since related to recent change you made.

@stvstnfrd
Copy link
Contributor Author

@Agrendalath Ready to merge.

It's weird not having the Big Green Button myself 😜

@Agrendalath Agrendalath merged commit 96699d5 into openedx:master Jul 31, 2023
42 checks passed
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

1 similar comment
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

@stvstnfrd stvstnfrd deleted the fal-3431 branch August 3, 2023 06:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-source-contribution PR author is not from Axim or 2U
Projects
Archived in project
6 participants