Skip to content

Commit a0891ca

Browse files
author
edge-katanomi-app2[bot]
committed
📚 Sync docs from alaudadevops/connectors-operator on bc90488f076b70de1ee82abef9dcb93c4305c567
Source: docs: add docs to describe how to add dynamic forms for resource interface (#434) Author: edge-katanomi-app2[bot] Ref: refs/heads/main Commit: bc90488f076b70de1ee82abef9dcb93c4305c567 This commit automatically syncs documentation changes from the source-docs repository. 🔗 View source commit: https://github.com/alaudadevops/connectors-operator/commit/bc90488f076b70de1ee82abef9dcb93c4305c567 🤖 Synced on 2025-12-12 01:40:40 UTC
1 parent c9546ec commit a0891ca

File tree

3 files changed

+239
-11
lines changed

3 files changed

+239
-11
lines changed

‎.github/SYNC_INFO.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Documentation Sync Information
22

3-
- **Last synced**: 2025-12-11 06:06:47 UTC
3+
- **Last synced**: 2025-12-12 01:40:40 UTC
44
- **Source repository**: alaudadevops/connectors-operator
5-
- **Source commit**: [f6ac686740365cb80e5714c63be8b7228b23a885](https://github.com/alaudadevops/connectors-operator/commit/f6ac686740365cb80e5714c63be8b7228b23a885)
6-
- **Triggered by**: chengjingtao
7-
- **Workflow run**: [#60](https://github.com/alaudadevops/connectors-operator/actions/runs/20123703939)
5+
- **Source commit**: [bc90488f076b70de1ee82abef9dcb93c4305c567](https://github.com/alaudadevops/connectors-operator/commit/bc90488f076b70de1ee82abef9dcb93c4305c567)
6+
- **Triggered by**: edge-katanomi-app2[bot]
7+
- **Workflow run**: [#62](https://github.com/alaudadevops/connectors-operator/actions/runs/20153396588)
88

99
## Files synced:
1010
- docs/

‎docs/en/connectors/concepts/resource_interface.mdx‎

Lines changed: 208 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,20 @@ metadata:
102102
cpaas.io/description: "GitCodeRepository is a resource interface for Git code repository"
103103
```
104104

105+
you can also use `style.tekton.dev/descriptors` annotation to describe the params for dynamic form.
106+
107+
```yaml
108+
metadata:
109+
annotations:
110+
style.tekton.dev/descriptors: |-
111+
- path: params.revision
112+
x-descriptors:
113+
- urn:alm:descriptor:widgets:select
114+
- urn:alm:descriptor:expression:props.options:schema:openapi:context.connectorClass.spec.api.openapi:listGitRefs
115+
```
116+
117+
more details please refer to [dynamic-form](#dynamic-form).
118+
105119
### Resource Categories \{#categories}
106120

107121
ResourceInterface organizes resources into categories that define common contracts and behaviors. Categories are marked using the label `resourceinterface.connectors.cpaas.io/category`.
@@ -280,6 +294,199 @@ This enables the system to match compatible connectors with ResourceInterfaces a
280294
281295
More about ConnectorClass please refer to [Concept of ConnectorClass](./connectorclass.mdx)
282296
297+
## Dynamic Form \{#dynamic-form}
298+
299+
Dynamic forms provide a declarative way to configure interactive UI components for Pipeline Integration. With dynamic forms, users can browse and select resources such as Git repositories and revisions directly through the connector.
300+
301+
### Overview
302+
303+
Use the `style.tekton.dev/descriptors` annotation to define dynamic form behavior for parameters. Here is an example:
304+
305+
```yaml
306+
metadata:
307+
annotations:
308+
style.tekton.dev/descriptors: >-
309+
- path: params.repository
310+
x-descriptors:
311+
- urn:alm:descriptor:com.tectonic.ui:select:repository
312+
- urn:alm:descriptor:expression:props.options:api:/clusters-rewrite/${context.cluster}${context.connector.status.api.path}/api/v4/projects?simple=true
313+
- urn:alm:descriptor:expression:props.options:label:path:path_with_namespace
314+
- urn:alm:descriptor:expression:props.options:value:path:path_with_namespace
315+
- urn:alm:descriptor:label:en:Repository
316+
- urn:alm:descriptor:label:zh:Repository
317+
- urn:alm:descriptor:description:zh:Repository path including group name or username, e.g. mygroup/my-app.
318+
- urn:alm:descriptor:description:en:Repository path including group name or username, e.g. mygroup/my-app.
319+
```
320+
321+
The syntax follows the <ExternalSiteLink name="pipelines" href="/pipelines/how_to/configure_dynamic_forms.html" children="Pipeline Dynamic Forms" /> specification. Familiarity with that documentation is recommended before proceeding.
322+
323+
In addition to the standard capabilities, dynamic forms in ResourceInterface support:
324+
325+
- **Extended context variables** for accessing connector and ResourceInterface data
326+
- **Reference OpenAPI display schema** definitions in ConnectorClass for centralized API configuration and reference the api definition when using dynamic form
327+
328+
### Extended Context Variables
329+
330+
The following context variables are available in ResourceInterface dynamic forms:
331+
332+
| Variable | Description |
333+
| -------- | ----------- |
334+
| `context.connector` | The Connector object. Access any field, e.g., `context.connector.status.api.path` |
335+
| `context.connectorClass` | The ConnectorClass object. Access any field, e.g., `context.connectorClass.spec.api.openapi` |
336+
| `context.params` | Parameter values in `Pipeline Integration` UI form, e.g., `context.params.repository` |
337+
| `context.resourceInterface` | The ResourceInterface object. Access any field as needed |
338+
339+
### Dynamic Form Configuration Approaches
340+
341+
There are two approaches to configure dynamic forms in ResourceInterface:
342+
343+
1. **Direct API Configuration**: Call connector APIs directly using descriptor expressions. This approach is straightforward and easy to understand. The Connectors System provides [Connector API](./connector_api.mdx) endpoints for listing repositories, git references, and more.
344+
345+
2. **Reference OpenAPI Display Schema in ConnectorClass**: Define API calls and display mappings in the ConnectorClass using `spec.api.openapi`. This approach centralizes API definitions and display configurations, avoiding duplication across multiple ResourceInterfaces. When using dynamic form, you can reference the API definition in the ConnectorClass directly.
346+
347+
You can use either approach independently or combine them as needed.
348+
349+
### Direct API Configuration
350+
351+
**Example: Listing GitLab Repositories**
352+
353+
GitLab connectors expose the native GitLab API, which can be used to populate a repository selector:
354+
355+
```yaml
356+
kind: ResourceInterface
357+
metadata:
358+
name: gitlabcoderepository
359+
annotations:
360+
style.tekton.dev/descriptors: >-
361+
- path: params.repository
362+
x-descriptors:
363+
- urn:alm:descriptor:com.tectonic.ui:select:repository
364+
- urn:alm:descriptor:expression:props.options:api:/clusters-rewrite/${context.cluster}${context.connector.status.api.path}/api/v4/projects?simple=true
365+
- urn:alm:descriptor:expression:props.options:label:path:path_with_namespace
366+
- urn:alm:descriptor:expression:props.options:value:path:path_with_namespace
367+
- urn:alm:descriptor:label:en:Repository
368+
- urn:alm:descriptor:label:zh:Repository
369+
- urn:alm:descriptor:description:zh:Repository path including group name or username, e.g. mygroup/my-app.
370+
- urn:alm:descriptor:description:en:Repository path including group name or username, e.g. mygroup/my-app.
371+
```
372+
373+
**Example: Listing Git References**
374+
375+
Git connector provides a `gitrefs` endpoint for listing branches and tags:
376+
377+
```yaml
378+
kind: ResourceInterface
379+
metadata:
380+
name: gitcoderepository
381+
annotations:
382+
style.tekton.dev/descriptors: >-
383+
- path: params.revision
384+
x-descriptors:
385+
- urn:alm:descriptor:com.tectonic.ui:select:revision
386+
- urn:alm:descriptor:expression:props.options:api:/clusters-rewrite/${context.cluster}${context.connector.status.api.path}/git/gitrefs?repositoryUrl=${context.connector.spec.address + "/" + context.params.repository + ".git"}&search=${current.search}
387+
- urn:alm:descriptor:expression:props.options:path:items
388+
- urn:alm:descriptor:expression:props.options:label:path:name
389+
- urn:alm:descriptor:expression:props.options:value:path:name
390+
- urn:alm:descriptor:label:en:Revision
391+
- urn:alm:descriptor:label:zh:Revision
392+
- urn:alm:descriptor:description:zh:Git revision reference, e.g. refs/heads/main.
393+
- urn:alm:descriptor:description:en:Git revision reference (e.g., refs/heads/main for branches)
394+
```
395+
396+
### Reference OpenAPI Display Schema \{#reference-openapi-display-schema-in-connectorclass}
397+
398+
To centralize API definitions and display configurations, define them in the ConnectorClass using `spec.api.openapi`. Dynamic forms can then reference these definitions directly, eliminating redundant configurations across ResourceInterfaces.
399+
400+
**Prerequisites**
401+
402+
1. Define the OpenAPI specification in the ConnectorClass. See [ConnectorClass OpenAPI Description](./connectorclass.mdx#api_openapi) for details.
403+
2. Add the `x-display-schema` extension to define how the API integrates with dynamic forms.
404+
405+
**Display Schema Structure**
406+
407+
The `x-display-schema` extension contains:
408+
409+
- `parameters[]`: Defines how to populate API parameters at runtime.
410+
- `name`: Parameter name (must match the API parameter name)
411+
- `value`: Parameter value expression. Syntax follows <ExternalSiteLink name="pipelines" href="pipelines/how_to/configure_dynamic_forms.html#api-dynamic-options-configuration" children="Pipeline Dynamic Forms" />.
412+
- `descriptors`: Defines how API response data maps to form options. Syntax follows <ExternalSiteLink name="pipelines" href="pipelines/how_to/configure_dynamic_forms.html" children="Pipeline Dynamic Forms" />.
413+
414+
**Example: Git References API**
415+
416+
The following ConnectorClass configuration defines the `GET /git/gitrefs` API with display schema:
417+
418+
- The `repositoryUrl` parameter is set to `${context.connector.spec.address + "/" + context.params.repository + ".git"}` and passed as a query parameter
419+
- The `search` parameter is set to `${current.search}` for filtering results
420+
- The response `items` array is mapped to select options, using `name` for both label and value
421+
422+
``` yaml
423+
kind: ConnectorClass
424+
spec:
425+
api:
426+
openapi:
427+
openapi: 3.0.3
428+
info:
429+
title: Git API
430+
version: v1alpha1
431+
paths:
432+
/git/gitrefs:
433+
get:
434+
x-provider-type: api
435+
x-display-schema:
436+
parameters:
437+
- name: repositoryUrl
438+
value: ${context.connector.spec.address + "/" + context.params.repository + ".git"}
439+
- name: search
440+
value: ${current.search}
441+
descriptors:
442+
- urn:alm:descriptor:expression:props.options:path:items
443+
- urn:alm:descriptor:expression:props.options:label:path:name
444+
- urn:alm:descriptor:expression:props.options:value:path:name
445+
operationId: listGitRefs
446+
parameters:
447+
- name: repositoryUrl
448+
in: query
449+
description: "Cloneable URL of the repository (e.g., https://github.com/mygroup/my-app.git)"
450+
required: true
451+
schema:
452+
type: string
453+
- name: search
454+
in: query
455+
description: "Return list of git references containing the search string"
456+
required: false
457+
schema:
458+
type: string
459+
responses:
460+
'200':
461+
description: "All git references for a repository"
462+
content:
463+
application/json: {}
464+
```
465+
466+
**Referencing OpenAPI in ResourceInterface**
467+
468+
Once the API is defined in ConnectorClass, reference it in your ResourceInterface using the following syntax:
469+
470+
- `urn:alm:descriptor:widgets:select` to specify the widget type
471+
- `schema:openapi:context.connectorClass.spec.api.openapi:<operationId>` to reference the API definition in the ConnectorClass
472+
473+
```yaml
474+
kind: ResourceInterface
475+
metadata:
476+
name: gitcoderepository
477+
annotations:
478+
style.tekton.dev/descriptors: >-
479+
- path: params.revision
480+
x-descriptors:
481+
- urn:alm:descriptor:widgets:select
482+
- urn:alm:descriptor:expression:props.options:schema:openapi:context.connectorClass.spec.api.openapi:listGitRefs
483+
- urn:alm:descriptor:label:en:Revision
484+
- urn:alm:descriptor:label:zh:Revision
485+
- urn:alm:descriptor:description:zh:Git revision reference, e.g. refs/heads/main.
486+
- urn:alm:descriptor:description:en:Git revision reference (e.g., refs/heads/main for branches)
487+
```
488+
489+
With this configuration, the `revision` field in Pipeline Integration renders as a dropdown that fetches options from the `listGitRefs` API.
283490

284491
## Examples \{#examples}
285492

@@ -397,3 +604,4 @@ spec:
397604
- [Concept of Connector](./connector.mdx)
398605
- [Concept of ConnectorClass](./connectorclass.mdx)
399606
- <ExternalSiteLink name="pipelines" href="/pipelines/concepts/integrate_with_connector.html" children="Pipeline Integration" />
607+
- <ExternalSiteLink name="pipelines" href="/pipelines/how_to/configure_dynamic_forms.html" children="Pipeline Dynamic Forms" />

‎docs/en/overview/release_notes.mdx‎

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,25 +29,45 @@ The following table shows the compatibility and support matrix between the Alaud
2929

3030
### Features and Enhancements
3131

32-
- Provides out-of-the-box definitions for `GitCodeRepository`, `OCIArtifact`, and `MavenArtifact` resources, enabling seamless integration of external resources (Git repositories, OCI artifacts, Maven artifacts) into TektonCD pipelines through a unified UI interface. For more details, see
33-
* [ResourceInterface](../connectors/concepts/resource_interface.mdx)
34-
* <ExternalSiteLink name="pipelines" href="/pipelines/concepts/integrate_with_connector.html" children="Pipeline Integration" />
35-
- Add docs to explain credential permissions required for each connector. more details: [Credential Permissions Required](../connectors-git/concepts/git_connectorclass.mdx#credential_permissions_required)
32+
**More Connectors**
33+
3634
- Support integration with GitLab Server by using GitLab Connector. more details:
3735
- [GitLab Connector Quick Start](../connectors-gitlab/quick_start.mdx)
3836
- Support integration with NPM Registries by using NPM Connector. more details:
3937
- [NPM Connector Quick Start](../connectors-npm/quick_start.mdx)
4038
- Support integration with Harbor Registries by using Harbor Connector. more details:
4139
- [Harbor Connector Quick Start](../connectors-harbor/quick_start.mdx)
42-
- Support accessing tool's original API through the Connector API when the ConnectorClass provides Proxy Service capabilities. The system now supports two ways to access tool resources: using the tool's original API via Proxy Service, or using custom APIs provided for the ConnectorClass. For more details, see
43-
* [Connector API](../connectors/concepts/connector_api.mdx)
40+
41+
**ResourceInterface for Pipeline Integration**
42+
43+
- Provides out-of-the-box definitions for `GitCodeRepository`, `OCIArtifact`, and `MavenArtifact` resources, enabling seamless integration of external resources (Git repositories, OCI artifacts, Maven artifacts) into TektonCD pipelines through a unified UI interface. For more details, see
44+
* [ResourceInterface](../connectors/concepts/resource_interface.mdx)
45+
* <ExternalSiteLink name="pipelines" href="/pipelines/concepts/integrate_with_connector.html" children="Pipeline Integration" />
46+
- Support Dynamic Form in ResourceInterface for Pipeline Integration. For more details, see [ResourceInterface Dynamic Form](../connectors/concepts/resource_interface.mdx#dynamic-form).
47+
48+
**Connector API Enhancement**
49+
50+
- Support accessing tool's original API through the Connector API when the ConnectorClass provides Proxy Service capabilities. The system now supports two ways to access tool resources: using the tool's original API via Proxy Service, or using custom APIs provided for the ConnectorClass. For more details, see [Connector API](../connectors/concepts/connector_api.mdx).
51+
52+
**ConnectorClass Customization Flexibility**
53+
4454
- Support using Rego rules to extract tokens from client requests when using the built-in HTTP reverse proxy. Combined with the existing ability to inject authentication credentials into backend requests through Rego rules, you can now extend the built-in reverse proxy's capabilities to support tools with non-standard HTTP authentication mechanisms.
4555
- For token extraction configuration, see [Custom Rego-based Authentication](../connectors/concepts/connectors_proxy.mdx#custom-rego-based-authentication).
4656
- For authentication injection configuration, see [Injecting Authentication Credentials into Backend Request when using built-in Reverse Proxy](../connectors/concepts/connectors_proxy.mdx#injecting-authentication-when-using-built-in-reverse-proxy).
4757
- Support using request variables in `spec.auth.types[].generator.rego` to inject authentication credentials into backend requests. more details: [Variables Available in Rego](../connectors/concepts/connectorclass.mdx#variables-available-in-rego).
48-
- OCI Connector supports using forward proxy for image operations. For more details, see [OCI Connector Forward Proxy](../connectors-oci/concepts/oci_connectorclass.mdx#forward-proxy)
58+
59+
**OCI Connector Forward Proxy**
60+
61+
- OCI Connector supports using forward proxy for image operations. For more details, see [OCI Connector Forward Proxy](../connectors-oci/concepts/oci_connectorclass.mdx#forward-proxy).
62+
63+
**CSI Driver Built-in Configurations**
64+
4965
- `Connectors CSI Driver` provides built-in configuration files that are always mounted into Pods. For more details, see [Built-in Configurations](../connectors/concepts/connectors_csi.mdx#built-in-configurations).
5066

67+
**Other Enhancements**
68+
69+
- Add docs to explain credential permissions required for each connector. more details: [Credential Permissions Required](../connectors-git/concepts/git_connectorclass.mdx#credential_permissions_required).
70+
5171
### Breaking Changes
5272

5373
- Remove the `input.xxx` variable from `spec.auth.types[].generator.rego`. Use `input.data.xxx` instead.

0 commit comments

Comments
 (0)