Skip to content

Commit f9667d6

Browse files
committed
chore: address review comments
1 parent f9898c4 commit f9667d6

File tree

8 files changed

+28
-28
lines changed

8 files changed

+28
-28
lines changed

config.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
},
3939
"plugins": {
4040
"type": "array",
41-
"description": "List of plugins to integrate on Git Proxy's push or pull actions. Each value is either a file path or a module name.",
41+
"description": "List of plugins to integrate on GitProxy's push or pull actions. Each value is either a file path or a module name.",
4242
"items": {
4343
"type": "string"
4444
}

plugins/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Git Proxy plugins & samples
2-
Git Proxy supports extensibility in the form of plugins. These plugins are specified via [configuration](/docs/category/configuration) as NPM packages or JavaScript code on disk. For each plugin configured, Git Proxy will attempt to load each package or file as a standard [Node module](https://nodejs.org/api/modules.html). Plugin authors will create instances of the extension classes exposed by Git Proxy and use these objects to implement custom functionality.
1+
# GitProxy plugins & samples
2+
GitProxy supports extensibility in the form of plugins. These plugins are specified via [configuration](/docs/category/configuration) as NPM packages or JavaScript code on disk. For each plugin configured, GitProxy will attempt to load each package or file as a standard [Node module](https://nodejs.org/api/modules.html). Plugin authors will create instances of the extension classes exposed by GitProxy and use these objects to implement custom functionality.
33

4-
For detailed documentation, please refer to the [Git Proxy development resources on the project's site](https://git-proxy.finos.org/docs/development/plugins)
4+
For detailed documentation, please refer to the [GitProxy development resources on the project's site](https://git-proxy.finos.org/docs/development/plugins)
55

66
## Included plugins
7-
These plugins are maintained by the core Git Proxy team. As a future roadmap item, organizations can choose to omit
8-
certain features of Git Proxy by simply removing the dependency from a deployed version of the application.
7+
These plugins are maintained by the core GitProxy team. As a future roadmap item, organizations can choose to omit
8+
certain features of GitProxy by simply removing the dependency from a deployed version of the application.
99

10-
- `git-proxy-plugin-samples`: "hello world" examples of the Git Proxy plugin system
10+
- `git-proxy-plugin-samples`: "hello world" examples of the GitProxy plugin system

plugins/git-proxy-plugin-samples/example.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const { Step } = require('@finos/git-proxy/proxy/actions');
1111
/**
1212
*
1313
* @param {object} req Express Request object
14-
* @param {Action} action Git Proxy Action
14+
* @param {Action} action GitProxy Action
1515
* @return {Promise<Action>} Promise that resolves to an Action
1616
*/
1717
async function logMessage(req, action) {

plugins/git-proxy-plugin-samples/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@finos/git-proxy-plugin-samples",
33
"version": "0.1.0-alpha.0",
4-
"description": "A set of sample (dummy) plugins for Git Proxy to demonstrate how plugins are authored.",
4+
"description": "A set of sample (dummy) plugins for GitProxy to demonstrate how plugins are authored.",
55
"scripts": {
66
"test": "echo \"Error: no test specified\" && exit 1"
77
},

src/proxy/chain.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const executeChain = async (req) => {
4747
};
4848

4949
/**
50-
* The plugin loader used for the Git Proxy chain.
50+
* The plugin loader used for the GitProxy chain.
5151
*
5252
* @type {import('../plugin').PluginLoader}
5353
*/

website/docs/configuration/reference.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ description: JSON schema reference documentation for GitProxy
194194
| **Type** | `array of string` |
195195
| **Required** | No |
196196

197-
**Description:** List of plugins to integrate on Git Proxy's push or pull actions. Each value is either a file path or a module name.
197+
**Description:** List of plugins to integrate on GitProxy's push or pull actions. Each value is either a file path or a module name.
198198

199199
| Each item of this array must be | Description |
200200
| ------------------------------- | ----------- |
@@ -520,4 +520,4 @@ description: JSON schema reference documentation for GitProxy
520520
</details>
521521

522522
----------------------------------------------------------------------------------------------------------------------------
523-
Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2024-07-22 at 10:42:24 -0400
523+
Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2024-10-02 at 13:21:09 -0400

website/docs/development/contributing.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
title: Contributing
33
---
44

5-
Here's how to get setup for contributing to Git Proxy.
5+
Here's how to get setup for contributing to GitProxy.
66

77
## Setup
8-
The Git Proxy project relies on the following pre-requisites:
8+
The GitProxy project relies on the following pre-requisites:
99

1010
- [Node](https://nodejs.org/en/download) (16+)
1111
- [npm](https://npmjs.com/) (8+)
@@ -29,7 +29,7 @@ $ npm run client # Run only the UI
2929
<!-- Notes about testing methodology -->
3030

3131
## Configuration schema
32-
The configuration for Git Proxy includes a JSON Schema ([`config.schema.json`](https://github.com/finos/git-proxy/blob/main/config.schema.json)) to define the expected properties used by the application. When adding new configuration properties to Git Proxy, ensure that the schema is updated with any new, removed or changed properties. See [JSON Schema docs for specific syntax](https://json-schema.org/docs).
32+
The configuration for GitProxy includes a JSON Schema ([`config.schema.json`](https://github.com/finos/git-proxy/blob/main/config.schema.json)) to define the expected properties used by the application. When adding new configuration properties to GitProxy, ensure that the schema is updated with any new, removed or changed properties. See [JSON Schema docs for specific syntax](https://json-schema.org/docs).
3333

3434
When updating the configuration schema, you must also re-generate the reference doc used here on the site. To generate the reference documentation, [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) is used to output the Markdown.
3535

website/docs/development/plugins.mdx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,24 @@ title: Plugins
33
---
44

55
## How plugins work
6-
Git Proxy supports extensibility in the form of plugins. These plugins are specified via [configuration](/docs/category/configuration) as NPM packages or JavaScript code on disk. For each plugin configured, Git Proxy will attempt to load each package or file as a standard [Node module](https://nodejs.org/api/modules.html). Plugin authors will create instances of the extension classes exposed by Git Proxy and use these objects to implement custom functionality.
6+
GitProxy supports extensibility in the form of plugins. These plugins are specified via [configuration](/docs/category/configuration) as NPM packages or JavaScript code on disk. For each plugin configured, GitProxy will attempt to load each package or file as a standard [Node module](https://nodejs.org/api/modules.html). Plugin authors will create instances of the extension classes exposed by GitProxy and use these objects to implement custom functionality.
77

8-
For each loaded "plugin object", it is inserted into Git Proxy's chain of actions which are triggered on a given Git action received by Git Proxy such as `git push` or `git fetch`.
8+
For each loaded "plugin object", it is inserted into GitProxy's chain of actions which are triggered on a given Git action received by GitProxy such as `git push` or `git fetch`.
99

1010
:::caution
11-
The order that plugins are configured matters! Plugins execute _before_ Git Proxy's builtin steps and in the order that they are configured in `proxy.config.json`. If you wish to use a combination of features, ensure that your custom plugins do not conflict or interfere with later steps in the processing chain.
11+
The order that plugins are configured matters! Plugins execute _before_ GitProxy's builtin steps and in the order that they are configured in `proxy.config.json`. If you wish to use a combination of features, ensure that your custom plugins do not conflict or interfere with later steps in the processing chain.
1212
:::
1313

14-
Git Proxy uses the [load-plugin package](https://www.npmjs.com/package/load-plugin) to provide the Node module resolution.
14+
GitProxy uses the [load-plugin package](https://www.npmjs.com/package/load-plugin) to provide the Node module resolution.
1515

1616
## Limitations
1717
- Plugins are only supported on the Git HTTP proxy server. There is no similar extensibility today for the dashboard UI or its backing API.
18-
- Extensions are defined as JavaScript classes which are [quite limited](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Inheritance_and_the_prototype_chain#inheritance_with_the_prototype_chain). Git Proxy has a rather naive system for determining if a provided module has any objects which it recognizes as "Git Proxy plugin types". A conversion of the project to TypeScript will provide more flexible options for enforcing API contracts via strict interfaces & types in a future release. [Use of TypeScript is a roadmap item](https://github.com/finos/git-proxy/issues/276).
18+
- Extensions are defined as JavaScript classes which are [quite limited](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Inheritance_and_the_prototype_chain#inheritance_with_the_prototype_chain). GitProxy has a rather naive system for determining if a provided module has any objects which it recognizes as "GitProxy plugin types". A conversion of the project to TypeScript will provide more flexible options for enforcing API contracts via strict interfaces & types in a future release. [Use of TypeScript is a roadmap item](https://github.com/finos/git-proxy/issues/276).
1919

2020
## Using plugins
2121
The primary goals of the plugin system is to:
2222

23-
- Allow users deploying Git Proxy to do so via the distributed binary package. ie. `npx -- @finos/git-proxy`
23+
- Allow users deploying GitProxy to do so via the distributed binary package. ie. `npx -- @finos/git-proxy`
2424
- Allow users to consume plugins that packaged using standard tools (npm) and optionally distributed via npm themselves.
2525
- Reuse as much native Node functionality as possible for calling 3rd-party code (plugins) from the main application (git-proxy).
2626

@@ -32,7 +32,7 @@ The below instructions are using the [`@finos/git-proxy-plugin-samples`](https:/
3232
1. Install both `@finos/git-proxy` and the `@finos/git-proxy-plugin-samples` package to the local `node_modules/` directory using the following command:
3333

3434
```bash
35-
$ npm install -g @finos/git-proxy@1.3.5 @finos/[email protected]
35+
$ npm install -g @finos/git-proxy@latest @finos/[email protected]
3636
```
3737

3838
Alternatively, you can create local packages from source and install those instead.
@@ -71,10 +71,10 @@ Loaded plugin: LogRequestPlugin
7171

7272
### via JavaScript file(s)
7373
:::caution
74-
This section is considered highly experimental and not recommended for general use. Even when authoring local plugins that are not distributed, it is best to use `node_modules/` and not rely on bespoke system setup or layout of files. Use `npm pack` and `npm install path/to/plugin.tgz` if you must use local plugin code to ensure Git Proxy's plugin manager can properly load your plugins.
74+
This section is considered highly experimental and not recommended for general use. Even when authoring local plugins that are not distributed, it is best to use `node_modules/` and not rely on bespoke system setup or layout of files. Use `npm pack` and `npm install path/to/plugin.tgz` if you must use local plugin code to ensure GitProxy's plugin manager can properly load your plugins.
7575
:::
7676

77-
Plugins written as standalone JavaScript files are used similarly to npm packages. The main difference is that file-based module loading requires additional steps to ensure that the given JavaScript files (written as Node CommonJS or ES modules) have all the necessary dependencies to be imported. Since Git Proxy plugin system relies on class-based inheritence, the module will require at least a dependency to `@finos/git-proxy` to be able to import the required classes. Plugins do not have to be distributed by NPM to be used in this fashion which may be advantageous in certain environments.
77+
Plugins written as standalone JavaScript files are used similarly to npm packages. The main difference is that file-based module loading requires additional steps to ensure that the given JavaScript files (written as Node CommonJS or ES modules) have all the necessary dependencies to be imported. Since GitProxy plugin system relies on class-based inheritence, the module will require at least a dependency to `@finos/git-proxy` to be able to import the required classes. Plugins do not have to be distributed by NPM to be used in this fashion which may be advantageous in certain environments.
7878

7979
1. To use a plugin that is written as a standalone JavaScript file, ensure that the JS code has all its necessary dependencies:
8080

@@ -128,7 +128,7 @@ To develop a new plugin, you must add `@finos/git-proxy` as a [peer dependency](
128128
- `@finos/git-proxy/plugin/PullActionPlugin`: execute as an action in the proxy chain during a `git fetch`
129129
- `@finos/git-proxy/proxy/actions/Step` and `@finos/git-proxy/proxy/actions/Action`: internal classes which act as carriers for `git` state during proxying. Plugins should modify the passed in `action` for affecting any global state of the git operation and add its own custom `Step` object to capture the plugin's own internal state (logs, errored/blocked status, etc.)
130130

131-
Git Proxy will load your plugin only if it extends one of the two plugin classes above. It is also important that your package has [`exports`](https://nodejs.org/api/packages.html#exports) defined for the plugin loader to properly load your module(s).
131+
GitProxy will load your plugin only if it extends one of the two plugin classes above. It is also important that your package has [`exports`](https://nodejs.org/api/packages.html#exports) defined for the plugin loader to properly load your module(s).
132132

133133
Please see the [sample plugin package included in the repo](https://github.com/finos/git-proxy/tree/main/plugins/git-proxy-plugin-samples) for details on how to structure your plugin package.
134134

@@ -141,7 +141,7 @@ class FooPlugin extends PushActionPlugin {
141141
constructor() {
142142
super(); // don't pass any function to the parent class - let the parent's this.exec function be undefined
143143
this.displayName = 'FooPlugin';
144-
// overwrite the parent's exec function which is executed as part of Git Proxy's action chain.
144+
// overwrite the parent's exec function which is executed as part of GitProxy's action chain.
145145
// use an arrow function if you require access to the instances's state (properties, methods, etc.)
146146
this.exec = async (req, action) => {
147147
console.log(this.displayName);
@@ -162,7 +162,7 @@ class FooPlugin extends PushActionPlugin {
162162
```bash
163163
$ npm init
164164
# ...
165-
$ npm install --save-peer @finos/git-proxy@1.3.5
165+
$ npm install --save-peer @finos/git-proxy@latest
166166
```
167167

168168
`package.json`
@@ -182,7 +182,7 @@ $ npm install --save-peer @finos/[email protected]
182182
".": "./bar.js"
183183
},
184184
"peerDependencies": {
185-
"@finos/git-proxy": "^1.3.5-alpha.0"
185+
"@finos/git-proxy": "^1.3.5"
186186
}
187187
}
188188
```

0 commit comments

Comments
 (0)