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

Remove legacy provider DAG logic #849

Merged
merged 9 commits into from
Oct 28, 2022
Merged

Conversation

stacimc
Copy link
Contributor

@stacimc stacimc commented Oct 28, 2022

Fixes

Fixes WordPress/openverse#1398 by @AetherUnbound

Description

  • Removes now-unused logic branches that handled legacy provider scripts
  • Updates the ProviderWorkflow and ProviderReingestionWorkflow dataclasses to infer the provider script, provider name, and media types from the configured ingestion class
    • This means that to configure a new DAG, all you need to define in the dataclass is the Ingester class! Everything else is optional
  • Updates some docs

Note: #848 should be merged first and this will need to be rebased to pull in Europeana changes.

Not included:
It may be time to revisit the generate_tsv_filenames logic, which I have not touched in this PR beyond deleting fully-unused legacy branches. Should we open a new issue for this?

Testing Instructions

just test

Test some DAGs! Make sure to try at least one audio-only, one image-only, one audio-and-image, and one reingestion workflow. If you're looking for a thrill set INGESTION_LIMIT to 10 and turn them all on 🥳

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.

@stacimc stacimc added 🟧 priority: high Stalls work on the project or its dependents ✨ goal: improvement Improvement to an existing user-facing feature 💻 aspect: code Concerns the software code in the repository labels Oct 28, 2022
@stacimc stacimc self-assigned this Oct 28, 2022
@stacimc stacimc force-pushed the remove/legacy-provider-DAG-logic branch from d9727dd to 9ebe5e1 Compare October 28, 2022 17:34
@stacimc stacimc marked this pull request as ready for review October 28, 2022 17:40
@stacimc stacimc requested a review from a team as a code owner October 28, 2022 17:40
Copy link
Contributor

@AetherUnbound AetherUnbound left a comment

Choose a reason for hiding this comment

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

Yay for deleted code! 🥳 I have one note, and it looks like the --extended tests are failing 🤔

Comment on lines +50 to +56
super().__post_init__()
# Override the dag_id
self.dag_id = f"{self.provider_name}_reingestion_workflow"
return

super().__post_init__()
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to call super().__post_init__() twice? 😮

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, unfortunately. If a dag_id wasn't provided in the configuration, we want to override it. We need to call super first in order to set the provider_name (which is used in building the dag_id), and then we can override it. We can't do this check after calling super, because dag_id will have been set (to the regular _workflow name) during the super call. So we must call super within the branch.

But if dag_id was provided, we still want to call super(), so we also have to do it outside the branch. The return on L53 prevents it from actually being run twice.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, oops! Okay I see, we're not actually calling it twice as you point out. Thanks!

@stacimc stacimc force-pushed the remove/legacy-provider-DAG-logic branch from a3291db to 5ad46cc Compare October 28, 2022 20:34
Copy link
Contributor

@AetherUnbound AetherUnbound left a comment

Choose a reason for hiding this comment

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

🚀 Woohoo!

Copy link
Member

@zackkrida zackkrida left a comment

Choose a reason for hiding this comment

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

If you're looking for a thrill set INGESTION_LIMIT to 10 and turn them all on 🥳

Indeed, I am, so I turned on many of the DAGs 😆 awesome work!

@stacimc stacimc merged commit 92771e3 into main Oct 28, 2022
@stacimc stacimc deleted the remove/legacy-provider-DAG-logic branch October 28, 2022 21:30
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: improvement Improvement to an existing user-facing feature 🟧 priority: high Stalls work on the project or its dependents
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove legacy provider logic for DAG wrapper functions
3 participants