-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RFC: Include CLI packaging information within the connector metadata (#…
…322) # Add Binary CLI Plugin Packaging Information to `connector-metadata.yaml` This PR introduces changes to improve the management of binary CLI plugin information in the `connector-metadata.yaml` file. ## Key Changes 1. Extended `connector-metadata.json` to include binary CLI plugin packaging information. 2. Added a new optional `version` field to the `ConnectorMetadataDefinition` type for future versioning. 3. Extend `BinaryCliPluginDefinition` to accommodate inline binary CLI definition. ## Addition of `connector-metadata-types` A significant part of this PR is the introduction of `connector-metadata-types`. This file contains TypeScript type definitions for the `connector-metadata.json` structure and is meant to act as the source of truth for the schema of the `connector-metadata.json` file. As we advance, it is expected that if any changes are proposed in the connector metadata structure, they also update the `connectorTypes.ts` file in the `connector-metadata-types` folder.
- Loading branch information
1 parent
e505ac6
commit 862ab1a
Showing
12 changed files
with
2,001 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Validate Connector Metadata JSON Schema | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
validate-schema: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '18' | ||
|
||
- name: Install dependencies | ||
working-directory: connector-metadata-types | ||
run: npm ci | ||
|
||
- name: Generate and compare schema | ||
working-directory: connector-metadata-types | ||
run: | | ||
npm run generate-schema new-schema.json | ||
if [ -f schema.json ]; then | ||
if cmp -s schema.json new-schema.json; then | ||
echo "Schema is up to date" | ||
else | ||
echo "Error: Generated schema does not match the existing schema" | ||
echo "Diff between schema.json and new-schema.json:" | ||
diff -u schema.json new-schema.json || true | ||
exit 1 | ||
fi | ||
else | ||
echo "Error: schema.json does not exist" | ||
exit 1 | ||
fi | ||
rm new-schema.json |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Dependency directories | ||
node_modules/ | ||
|
||
# TypeScript compiled output | ||
dist/ | ||
build/ | ||
*.js | ||
*.js.map | ||
|
||
# TypeScript configuration | ||
tsconfig.tsbuildinfo |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Connector metadata types | ||
|
||
This project contains the schema of the connector-metadata.json file that is used in the | ||
package.tgz file of a connector, whenever a new version of a connector is released. | ||
|
||
It is expected that whenever authors propose a new RFC that changes the schema | ||
of the connector-metadata.json file, they will update this schema file accordingly in the `connectorTypes.ts` file. | ||
|
||
The `schema.json` file is the JSON schema of the current `connector-metadata.json` structure. | ||
|
||
|
||
## How to update the schema | ||
|
||
1. Update the `connectorTypes.ts` file with the new schema. | ||
2. Run `npm run generate-schema schema.json` to update the `schema.json` file. | ||
|
||
## Github Actions workflow | ||
|
||
|
||
The repo includes a GitHub Actions workflow that generates the schema and | ||
compares it with the existing schema file. | ||
|
||
This ensures that any changes to the schema generation logic are reflected | ||
in the committed schema file. |
Oops, something went wrong.