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

Warn on license_url computation in the API #4198

Merged
merged 2 commits into from
May 30, 2024
Merged

Conversation

krysal
Copy link
Member

@krysal krysal commented Apr 24, 2024

Fixes

Related to #703 by @obulat

Description

In the interest of closing this PR, I changed the approach only to warn when the license is computed, as suggested by @obulat. The #703 issue will addressed when we confirm #4318 is not an issue anymore.


Old description

My understanding is that the computation from openverse_attribution.license.License can be removed but we still need the property.

This PR should not be merged until the updated add_license_url run is completed and it's confirmed the image table in the Catalog does not have more NULL values for this field.

If you are wondering about audio I confirmed all items have this field set to something else than NULL.

openledger> SELECT COUNT(identifier) FROM audio WHERE meta_data->>'license_url' IS NULL;
+-------+
| count |
|-------|
| 0     |
+-------+
SELECT 1
Time: 17.712s (17 seconds), executed in: 17.695s (17 seconds)

Testing Instructions

Run the API and remove the license_url of an image. Then, visit its media page and check the logs.

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 (if 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.

@github-actions github-actions bot added the 🧱 stack: api Related to the Django API label Apr 24, 2024
@openverse-bot openverse-bot added 🟨 priority: medium Not blocking but should be addressed soon ✨ goal: improvement Improvement to an existing user-facing feature 💻 aspect: code Concerns the software code in the repository labels Apr 24, 2024
@krysal krysal force-pushed the remove/license_url_computation branch from 104a518 to 1790189 Compare April 26, 2024 20:05
@sarayourfriend
Copy link
Collaborator

@krysal what is the status of this PR and this particular blocker? Is the PR still blocked? Should it be labelled as such?

This PR should not be merged until the updated add_license_url run is completed and it's confirmed the image table in the Catalog does not have more NULL values for this field.

@obulat
Copy link
Contributor

obulat commented May 23, 2024

@krysal, what if instead of removing the computation completely we leave it in but add a warning log. Then, if there are no warnings in a longish period of time (a month?), we can remove the computation?
This would not be blocked by the DAG, and could be merged now.

@krysal
Copy link
Member Author

krysal commented May 23, 2024

@sarayourfriend It's blocked pending completion of #3885, which I thought would be a relatively quick task, but some problems arose.

@krysal, what if instead of removing the computation completely we leave it in but add a warning log. Then, if there are no warnings in a longish period of time (a month?), we can remove the computation?
This would not be blocked by the DAG, and could be merged now.

That is a good idea! :) I'll adapt the PR for that 👍

@AetherUnbound
Copy link
Collaborator

@krysal I'm going to add the blocked label for this PR while work on #3885 is being done

@AetherUnbound AetherUnbound added the ⛔ status: blocked Blocked & therefore, not ready for work label May 23, 2024
@krysal krysal mentioned this pull request May 24, 2024
@krysal krysal force-pushed the remove/license_url_computation branch from 1790189 to 4a3a800 Compare May 29, 2024 16:02
@krysal krysal changed the title Remove license_url computation in api Warn on license_url computation in the API May 29, 2024
@krysal krysal removed the ⛔ status: blocked Blocked & therefore, not ready for work label May 29, 2024
@krysal krysal marked this pull request as ready for review May 29, 2024 16:29
@krysal krysal requested a review from a team as a code owner May 29, 2024 16:29
@krysal krysal requested review from dhruvkb and stacimc May 29, 2024 16:29
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.

This looks fine to me, I was able to see the log after removing the meta_data from a record locally. It's been a minute since I've looked at this -- can you remind me what cases we're trying to catch here? I thought the catalog should be enforcing setting the licenses now, and that incorrect cases had already been backfilled, but maybe I'm misremembering.

If there isn't one already, can we make an issue for checking the production logs so that it does not get forgotten?

Copy link
Member

@dhruvkb dhruvkb left a comment

Choose a reason for hiding this comment

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

LGTM! Added a suggestion to make logging more structured but it's not a blocker in my view.

api/api/models/media.py Outdated Show resolved Hide resolved
@krysal
Copy link
Member Author

krysal commented May 30, 2024

This looks fine to me, I was able to see the log after removing the meta_data from a record locally. It's been a minute since I've looked at this -- can you remind me what cases we're trying to catch here? I thought the catalog should be enforcing setting the licenses now, and that incorrect cases had already been backfilled, but maybe I'm misremembering.

If there isn't one already, can we make an issue for checking the production logs so that it does not get forgotten?

@stacimc I'm also hoping we don't see more incorrect cases but I created #4318 to wait and confirm that. There is also more explanation of the reasoning.

@krysal krysal force-pushed the remove/license_url_computation branch from ddffa95 to cdb7aa3 Compare May 30, 2024 13:46
Co-authored-by: Dhruv Bhanushali <[email protected]>
@krysal krysal force-pushed the remove/license_url_computation branch from cdb7aa3 to 06437e3 Compare May 30, 2024 13:52
@krysal krysal merged commit f4b5bed into main May 30, 2024
45 checks passed
@krysal krysal deleted the remove/license_url_computation branch May 30, 2024 14:02
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: improvement Improvement to an existing user-facing feature 🟨 priority: medium Not blocking but should be addressed soon 🧱 stack: api Related to the Django API
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

7 participants