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

Common Feed Upload Framework #2875

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

Conversation

Jmencab
Copy link

@Jmencab Jmencab commented Feb 8, 2025

Changes proposed in this Pull Request:

Closes # .

This change sets up a framework for onboarding new feeds to the plugin with an example of Promotions. Most code is stubbed with the emphasis on the structure of the code. The code is implementing the following diagram: https://internalfb.com/excalidraw/EX370195

A FeedManager and FeedFactory class are added. The manager will have a dictionary of all instances that are instantiated via the factory. The manager in turn is instantiated by the main plugin driver. This will give us a global entry point to all other Feeds need they be displayed.

A similar paradigm is set up for the FeedGenerator, a class that is used by the Job Manager to set the recurring Feed generation job.

An AbstractFeed class is added that specifies the common logic and flow of the hooks needed to implement the feed upload, with the product feed upload as an example.

FeedHandler and FeedWriter interfaces are also added to help reuse code for future feed generations with the example of the CsvFeedWriter being used as it will be the most common.

A FeedInfoToTracker interface is also added to abstract the concept of getting metadata from the feed and feed uploads to the plugin Tracker instance.

create_upload and read_upload requests are added the API class. The former maps directly to the GraphCommercePartnerIntegrationFileUpdatePost endpoint which allows update/create operations on the feed while the latter is a theoretical endpoint-- implementation of how feed metadata and status are retrieved is TBD.

Screenshot 2025-02-07 at 5 50 41 PM

  • Do the changed files pass phpcs checks? Please remove phpcs:ignore comments in changed files and fix any issues, or delete if not practical.

@Jmencab Jmencab marked this pull request as ready for review February 8, 2025 01:41
@facebook-github-bot
Copy link
Contributor

@Jmencab has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants