Skip to content
This repository has been archived by the owner on Aug 4, 2023. It is now read-only.

Science Museum: Handle unrecognized licenses #850

Merged
merged 2 commits into from
Nov 9, 2022

Conversation

AetherUnbound
Copy link
Contributor

Fixes

Fixes WordPress/openverse#1580 by @AetherUnbound

Description

This PR addresses an issue wherein licenses which were expected to follow the CC license pattern actually ended up being generic license types. I have changed the tests to use in-line data, and added all of the cases I was able to capture that caused issues when I ran this locally.

I also added a new year range, 2020-2023, so we can include data from the last two years 😄

Testing Instructions

just test

If you want to observe the failure:

  1. Check out main
  2. Comment out all year ranges except (0, 1500) (this was the one that originally caused the error)
  3. Disable your ingestion limit
  4. Run the DAG, and note that the error in the issue occurs
  5. Check out this branch
  6. Ensure that the othe year ranges are still commented out
  7. Run the DAG again, observe that it completes!

Checklist

  • My pull request has a descriptive title (not a vague title like Update 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.

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.

@AetherUnbound AetherUnbound requested a review from a team as a code owner October 28, 2022 22:03
@openverse-bot openverse-bot added this to Needs review in Openverse PRs Oct 28, 2022
@openverse-bot openverse-bot added 💻 aspect: code Concerns the software code in the repository 🛠 goal: fix Bug fix 🟧 priority: high Stalls work on the project or its dependents labels Oct 28, 2022
@openverse-bot
Copy link
Contributor

Based on the high urgency of this PR, the following reviewers are being gently reminded to review this PR:

@obulat
@stacimc
This reminder is being automatically generated due to the urgency configuration.

Excluding weekend1 days, this PR was updated 2 day(s) ago. PRs labelled with high urgency are expected to be reviewed within 2 weekday(s)2.

@AetherUnbound, if this PR is not ready for a review, please draft it to prevent reviewers from getting further unnecessary pings.

Footnotes

  1. Specifically, Saturday and Sunday.

  2. For the purpose of these reminders we treat Monday - Friday as weekdays. Please note that the that generates these reminders runs at midnight UTC on Monday - Friday. This means that depending on your timezone, you may be pinged outside of the expected range.

Copy link
Contributor

@obulat obulat left a comment

Choose a reason for hiding this comment

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

I tried running the script this way and checking the items without the license. They are either not openly-licensed, or not images. Great tests!

Copy link
Member

@krysal krysal left a comment

Choose a reason for hiding this comment

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

I was able to reproduce the error in main (quite fast!) as well, and the fix looks good 👍

@@ -25,6 +25,7 @@
(1940, 1965),
(1965, 1990),
(1990, 2020),
(2020, 2023),
Copy link
Member

Choose a reason for hiding this comment

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

Nice observation and addition! 💯

Openverse PRs automation moved this from Needs review to Reviewer approved Nov 7, 2022
@AetherUnbound AetherUnbound merged commit 3dfd893 into main Nov 9, 2022
Openverse PRs automation moved this from Reviewer approved to Merged! Nov 9, 2022
@AetherUnbound AetherUnbound deleted the bugfix/science-museum#738 branch November 9, 2022 19:10
Pmeet pushed a commit to Pmeet/openverse-catalog that referenced this pull request Nov 15, 2022
* Science Museum: Handle unrecognized licenses

* Add present year range
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
💻 aspect: code Concerns the software code in the repository 🛠 goal: fix Bug fix 🟧 priority: high Stalls work on the project or its dependents
Projects
No open projects
Openverse PRs
  
Merged!
Development

Successfully merging this pull request may close these issues.

Invalid license name in Science Museum ingestion
4 participants