There is a good amount of duplicate code in these 3 repos: section-topics, section-image-recs and image-suggestions.
This is brittle because a change/fix in one place will not automatically address the other(s) - it's all to easy to miss.
This is a burden because more work is required to see changes through in multiple places (where other logic might interfere or require alternative implementation)
In this task we should:
Compare duplicate code between these repos.See https://phabricator.wikimedia.org/T339120#8931247- For any duplicate(-ish) code, we should come up with a strategy to share it from one source. Some ideas:
- keep it in one of them, delete from the other, and copy at compile time to the other.
- keep it in one of them, delete from the other, and git submodule from the other
- have a 'common' repo where these files reside.
- merge scripts into a monorepo <- PREFERRED OPTION
Note: there is some overlap with T333699; both should follow a similar resolution.
Updated tasks
- build monorepo - https://gitlab.wikimedia.org/repos/structured-data/image-suggestions-data-pipelines
- unify GitLab CI
- verify lint job - https://gitlab.wikimedia.org/repos/structured-data/image-suggestions-data-pipelines/-/pipelines/112825
- verify test job
- verify publish_conda_env
- verify bump_dag
- verify trigger_release
- unify documentation
-
build the scripts package separately from section_topics- included in section_topics as first-class citizens - update DAGs that run scripts
[] remove seal.sections.get_articles and use section_topics.pipeline's functions - not worth it, requires hacks to build sibling modules for a few lines of similar code
- remove section_topics.section_alignment_image_suggestions.apply_filter
and use section_topics.pipeline.apply_filter
[] remove image_suggestions.queries.latest_revisions and use wmf_content.mediawiki_content_current_v1
[x] replace wmf.wikidata_item_page_link with image_suggestions_wikidata_item_page_link in section_topics.queries.QIDS - moved to T394757: Update relevant data pipelines to wmf_content.mediawiki_content_current_v1