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

Update ContentSource to match MediaMixin #4854

Merged
merged 2 commits into from
Sep 6, 2024
Merged

Conversation

obulat
Copy link
Contributor

@obulat obulat commented Sep 3, 2024

Fixes

Fixes #2488 by @sarayourfriend

Description

This PR updates the ContentProvider.provider_identifier field length to match AbstractMedia.provider (80 characters).

Testing Instructions

The CI should pass.

Checklist

  • My pull request has a descriptive title (not a vague title likeUpdate index.md).
  • My pull request targets the default branch of the repository (main) or a parent feature branch.
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added or updated tests for the changes I made (if applicable).
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no visible errors.
  • I ran the DAG documentation generator (ov just catalog/generate-docs for catalog
    PRs) or the media properties generator (ov just catalog/generate-docs media-props
    for the catalog or ov just api/generate-docs for the API) where applicable.

Developer Certificate of Origin

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

@obulat obulat requested a review from a team as a code owner September 3, 2024 13:50
@obulat obulat requested review from krysal and stacimc and removed request for a team September 3, 2024 13:50
@openverse-bot openverse-bot added 🧱 stack: api Related to the Django API 🟨 priority: medium Not blocking but should be addressed soon 🛠 goal: fix Bug fix 💻 aspect: code Concerns the software code in the repository labels Sep 3, 2024
Copy link
Collaborator

@stacimc stacimc left a comment

Choose a reason for hiding this comment

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

Setting the max_length to 80 to match the higher of the two constraints seems reasonable to me 👍 But don't we need to run makemigrations here?

@sarayourfriend
Copy link
Collaborator

Definitely need makemigrations, luckily the CI caught that 🙂 https://github.com/WordPress/openverse/actions/runs/10684310921/job/29614652675?pr=4854

@obulat obulat marked this pull request as draft September 4, 2024 03:19
@obulat obulat force-pushed the fix-provider-field-length branch from cc3cc52 to 2cce646 Compare September 5, 2024 15:36
@WordPress WordPress deleted a comment from github-actions bot Sep 5, 2024
@obulat obulat marked this pull request as ready for review September 5, 2024 15:37
@sarayourfriend sarayourfriend changed the title Update ContentProvider to match MediaMixin Update ContentSource to match MediaMixin Sep 5, 2024
@openverse-bot openverse-bot added the migrations Modifications to Django migrations label Sep 5, 2024
Copy link
Collaborator

@sarayourfriend sarayourfriend left a comment

Choose a reason for hiding this comment

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

LGTM! I updated the PR title to correct the model name @obulat, just a heads-up in case you are surprised by it 🙂

I'm pretty confident that this will be a non-problem to apply in production. The table is very small, anyway. Based on the Postgres documentation for varchar, the database will need to adjust the padding on each row for the column, but I'd expect that to be fast. varchar is TOAST, so it doesn't need to change the width of the column within the table anyway.

@obulat obulat force-pushed the fix-provider-field-length branch from 2cce646 to 176c0a3 Compare September 6, 2024 04:54
@WordPress WordPress deleted a comment from github-actions bot Sep 6, 2024
Copy link

github-actions bot commented Sep 6, 2024

This PR has migrations. Please rebase it before merging to ensure that conflicting migrations are not introduced.

@obulat obulat merged commit 18f4313 into main Sep 6, 2024
45 checks passed
@obulat obulat deleted the fix-provider-field-length branch September 6, 2024 05:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💻 aspect: code Concerns the software code in the repository 🛠 goal: fix Bug fix migrations Modifications to Django migrations 🟨 priority: medium Not blocking but should be addressed soon 🧱 stack: api Related to the Django API
Projects
Archived in project
4 participants