-
Notifications
You must be signed in to change notification settings - Fork 609
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
[rush] plugin mode for customized cache provider #2898
Comments
The first step is to work out a design spec. Compared to the problems of a generalized plugin system, the build cache providers have a somewhat easier problem because they are not needed until after Some basic questions:
|
@m1heng For question 6, let us know if you can share any technical details about your |
Thanks for writing this up @octogonz! My two cents:
Although right now we're focused on the cloud cache provider "feature", I'd assume we'll have multiple in the future. My vote would be for 1:many, so that a single NPM package could provide two or more complementary features (perhaps for a certain vendor, like GCP). I don't feel strongly about this either though. Either way a name like
If you go with 1:many, the plugin manifest probably is an array of plugins, and each plugin might need to have its own schema. For example, even though the S3 and Azure cloud provider plugins are both plugins for the same feature, they can have different sets of required options that the user must provide, so we need some way for the plugin to specify its options schema, which Rush can validate (wherever the user "enables" the Azure plugin, they'd also need to provide the JSON options it expects, which Rush will validate on behalf of the plugin).
It's likely either
👍 Agree on pulling from an NPM registry (at least at first).
My preference would be that a plugin implements a specific "feature interface" (like the cloud build cache provider), and receives its own validated options. As a strawman, maybe this looks something like: import type { ICloudBuildCacheFeature } from '@microsoft/rush-lib';
export interface AzureBuildCacheProviderOptions {
// ... options ...
}
export class AzureBuildCacheProvider implements ICloudBuildCacheFeature<AzureBuildCacheProviderOptions> {
// constructor consumes options and prepares as necessary
// implementation of the 2-3 methods ICloudBuildCacheFeature requires
}
export function register(....) {
// some hook which you pass the AzureBuildCacheProvider object to register it
} I don't think there is any "basic" API other than each one looks something like this (by that I mean, I'm not even sure there is an As a potential plugin author, here are things I wouldn't want to deal with, and would definitely want Rush to help me with:
|
Hi @octogonz @iclanton , I drafted a graph below to show the plugin loader workflow as we talked eariler today. Can you help to check for the details and let me know if you have any concerns. Details:
PR related TODOs:
|
Summary
as previously discussed in #2408 and along with more discussion made in Rush Hour. This issue intends to narrow the scope into solving customized cache provider along with a workable design of plugin mode.
cc @octogonz @chengcyber
The text was updated successfully, but these errors were encountered: