-
Notifications
You must be signed in to change notification settings - Fork 144
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
Jmencab
wants to merge
14
commits into
main
Choose a base branch
from
jmencab-common_feed_skeleton
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Added abstract feed and promotions feed promotions feed extending abstract feed
…foForTracker that will need feed_id and upload_id from the Feed class
…te factory to reflect
@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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
phpcs
checks? Please removephpcs:ignore
comments in changed files and fix any issues, or delete if not practical.