-
Notifications
You must be signed in to change notification settings - Fork 61
Add Documentation Note for Jenkins Integration with Pre-filtering Capability on Jenkins Builds #2937
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
Merged
sivanel97
merged 12 commits into
main
from
PORT-16637-update-docs-on-jenkins-integration-for-pre-filtering-capability
Oct 27, 2025
Merged
Add Documentation Note for Jenkins Integration with Pre-filtering Capability on Jenkins Builds #2937
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
94f9ed5
added docs for new selectors for pre-filtering builds from Jenkins API
dennis-bilson-port 4313d0d
Merge branch 'main' into PORT-16637
dennis-bilson-port 3dbeff7
Apply suggestion from @sivanel97
sivanel97 ffeed82
Make `maxBuildsPerJob` configurable in Jenkins integration and refine…
dennis-bilson-port 9981bfe
Merge branch 'main' into PORT-16637-update-docs-on-jenkins-integratio…
dennis-bilson-port 7fff522
Remove unused `daysSince` and `jobFilter` fields from Jenkins mapping…
dennis-bilson-port a84f871
Merge remote-tracking branch 'origin/PORT-16637-update-docs-on-jenkin…
dennis-bilson-port a3391db
Update _example_jenkins_stage_configuration.mdx
dennis-bilson-port ba5fcd7
Update _example_jenkins_stage_configuration.mdx
dennis-bilson-port 23d3bd1
Update _example_jenkins_default_mapping_configuration.mdx
dennis-bilson-port d4291e2
Update _example_jenkins_default_mapping_configuration.mdx
dennis-bilson-port e7c0641
Merge branch 'main' into PORT-16637-update-docs-on-jenkins-integratio…
dennis-bilson-port File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
51 changes: 51 additions & 0 deletions
51
...alog/sync-data-to-catalog/cicd/jenkins/_example_jenkins_build_configuration.mdx
This file contains hidden or 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,51 @@ | ||
| import Tabs from "@theme/Tabs" | ||
| import TabItem from "@theme/TabItem" | ||
|
|
||
| <details> | ||
| <summary><b>Integration configuration (click to expand)</b></summary> | ||
| ```yaml showLineNumbers | ||
| createMissingRelatedEntities: true | ||
| deleteDependentEntities: true | ||
| resources: | ||
| - kind: build | ||
| selector: | ||
| query: "true" | ||
| maxBuildsPerJob: 100 | ||
| port: | ||
| entity: | ||
| mappings: | ||
| identifier: .url | split("://")[1] | sub("^.*?/"; "") | gsub("%20"; "-") | gsub("%252F"; "-") | gsub("/"; "-") | .[:-1] | ||
| title: .displayName | ||
| blueprint: '"jenkinsBuild"' | ||
| properties: | ||
| buildStatus: .result | ||
| buildUrl: .url | ||
| buildDuration: .duration | ||
| timestamp: '.timestamp / 1000 | todate' | ||
| relations: | ||
| parentJob: .url | split("://")[1] | sub("^.*?/"; "") | gsub("%20"; "-") | gsub("%252F"; "-") | gsub("/"; "-") | .[:-1] | gsub("-[0-9]+$"; "") | ||
| previousBuild: >- | ||
| if .previousBuild then (.previousBuild.url | split("://")[1] | | ||
| sub("^.*?/"; "") | gsub("%20"; "-") | gsub("%252F"; "-") | | ||
| gsub("/"; "-") | .[:-1]) else null end | ||
| ``` | ||
| </details> | ||
|
|
||
| <Tabs groupId="config" queryString="parameter"> | ||
|
|
||
| <TabItem label="Include Max Builds Per Job" value="includeMaxBuildsPerJob"> | ||
|
|
||
| The `maxBuildsPerJob` selector is an optional parameter that allows you to limit the number of builds to fetch for each job. | ||
| By default, this selector is set to `100` which means the last 100 builds of each job will be fetched. | ||
|
|
||
| ```yaml | ||
| - kind: build | ||
| selector: | ||
| query: 'true' | ||
| # highlight-next-line | ||
| maxBuildsPerJob: 100 | ||
| ``` | ||
|
|
||
| </TabItem> | ||
|
|
||
| </Tabs> |
61 changes: 61 additions & 0 deletions
61
...data-to-catalog/cicd/jenkins/_example_jenkins_default_mapping_configuration.mdx
This file contains hidden or 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,61 @@ | ||
| <details> | ||
| <summary><b>Default mapping configuration (click to expand)</b></summary> | ||
|
|
||
| ```yaml showLineNumbers | ||
| createMissingRelatedEntities: true | ||
| deleteDependentEntities: true | ||
| resources: | ||
| - kind: job | ||
| selector: | ||
| query: 'true' | ||
| port: | ||
| entity: | ||
| mappings: | ||
| identifier: .url | split("://")[1] | sub("^.*?/"; "") | gsub("%20"; "-") | gsub("%252F"; "-") | gsub("/"; "-") | .[:-1] | ||
| title: .fullName | ||
| blueprint: '"jenkinsJob"' | ||
| properties: | ||
| jobName: .name | ||
| url: .url | ||
| jobStatus: '{"notbuilt": "created", "blue": "passing", "red": "failing"}[.color]' | ||
| timestamp: .time | ||
| parentJob: .__parentJob | ||
|
|
||
|
|
||
| - kind: build | ||
| selector: | ||
| query: 'true' | ||
| maxBuildsPerJob: 100 | ||
| port: | ||
| entity: | ||
| mappings: | ||
| identifier: >- | ||
| .url | split("://")[1] | sub("^.*?/"; "") | gsub("%20"; "-") | gsub("%252F"; "-") | gsub("/"; "-") | .[:-1] | ||
| title: .displayName | ||
| blueprint: '"jenkinsBuild"' | ||
| properties: | ||
| buildStatus: .result | ||
| buildUrl: .url | ||
| buildDuration: .duration | ||
| timestamp: .timestamp / 1000 | todate | ||
| relations: | ||
| parentJob: .url | split("://")[1] | sub("^.*?/"; "") | gsub("%20"; "-") | gsub("%252F"; "-") | gsub("/"; "-") | .[:-1] | gsub("-[0-9]+$"; "") | ||
| previousBuild: >- | ||
| if .previousBuild then (.previousBuild.url | split("://")[1] | | ||
| sub("^.*?/"; "") | gsub("%20"; "-") | gsub("%252F"; "-") | | ||
| gsub("/"; "-") | .[:-1]) else null end | ||
|
|
||
| - kind: user | ||
dennis-bilson-port marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| selector: | ||
| query: 'true' | ||
| port: | ||
| entity: | ||
| mappings: | ||
| identifier: .user.id | ||
| title: .user.fullName | ||
| blueprint: '"jenkinsUser"' | ||
| properties: | ||
| url: .user.absoluteUrl | ||
| lastUpdateTime: if .lastChange then (.lastChange/1000) else now end | strftime("%Y-%m-%dT%H:%M:%SZ") | ||
| ``` | ||
| </details> | ||
This file contains hidden or 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
23 changes: 23 additions & 0 deletions
23
...atalog/sync-data-to-catalog/cicd/jenkins/_example_jenkins_job_configuration.mdx
This file contains hidden or 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,23 @@ | ||
| <details> | ||
| <summary><b>Integration configuration (click to expand)</b></summary> | ||
| ```yaml showLineNumbers | ||
| createMissingRelatedEntities: true | ||
| deleteDependentEntities: true | ||
| resources: | ||
| - kind: job | ||
| selector: | ||
| query: "true" | ||
| port: | ||
| entity: | ||
| mappings: | ||
| identifier: .url | split("://")[1] | sub("^.*?/"; "") | gsub("%20"; "-") | gsub("/"; "-") | .[:-1] | ||
| title: .fullName | ||
| blueprint: '"jenkinsJob"' | ||
| properties: | ||
| jobName: .name | ||
| url: .url | ||
| jobStatus: '{"notbuilt": "created", "blue": "passing", "red": "failing"}[.color]' | ||
| timestamp: .time | ||
| parentJob: .__parentJob | ||
| ``` | ||
| </details> |
65 changes: 65 additions & 0 deletions
65
...-catalog/sync-data-to-catalog/cicd/jenkins/_example_jenkins_stage_blueprint.mdx
This file contains hidden or 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,65 @@ | ||
| <details> | ||
| <summary><b>Stage blueprint (click to expand)</b></summary> | ||
|
|
||
| ```json showLineNumbers | ||
| { | ||
| "identifier": "jenkinsStage", | ||
| "description": "This blueprint represents a stage in a Jenkins build", | ||
| "title": "Jenkins Stage", | ||
| "icon": "Jenkins", | ||
| "schema": { | ||
| "properties": { | ||
| "status": { | ||
| "type": "string", | ||
| "title": "Stage Status", | ||
| "enum": [ | ||
| "SUCCESS", | ||
| "FAILURE", | ||
| "UNSTABLE", | ||
| "ABORTED", | ||
| "IN_PROGRESS", | ||
| "NOT_BUILT", | ||
| "PAUSED_PENDING_INPUT" | ||
| ], | ||
| "enumColors": { | ||
| "SUCCESS": "green", | ||
| "FAILURE": "red", | ||
| "UNSTABLE": "yellow", | ||
| "ABORTED": "darkGray", | ||
| "IN_PROGRESS": "blue", | ||
| "NOT_BUILT": "lightGray", | ||
| "PAUSED_PENDING_INPUT": "orange" | ||
| } | ||
| }, | ||
| "startTimeMillis": { | ||
| "type": "number", | ||
| "title": "Start Time (ms)", | ||
| "description": "Timestamp in milliseconds when the stage started" | ||
| }, | ||
| "durationMillis": { | ||
| "type": "number", | ||
| "title": "Duration (ms)", | ||
| "description": "Duration of the stage in milliseconds" | ||
| }, | ||
| "stageUrl": { | ||
| "type": "string", | ||
| "title": "Stage URL", | ||
| "description": "URL to the stage" | ||
| } | ||
| }, | ||
| "required": [] | ||
| }, | ||
| "mirrorProperties": {}, | ||
| "calculationProperties": {}, | ||
| "relations": { | ||
| "parentBuild": { | ||
| "title": "Jenkins Build", | ||
| "target": "jenkinsBuild", | ||
| "required": true, | ||
| "many": false | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| </details> |
83 changes: 83 additions & 0 deletions
83
...alog/sync-data-to-catalog/cicd/jenkins/_example_jenkins_stage_configuration.mdx
This file contains hidden or 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,83 @@ | ||
| <details> | ||
| <summary><b>Integration configuration (click to expand)</b></summary> | ||
|
|
||
| :::note Control Stage Fetching | ||
| To prevent overwhelming your Ocean instance with potentially thousands of stages from Jenkins, the integration requires you to specify a specific job. This ensures that Ocean only retrieves stages related to that job, keeping things focused and efficient. | ||
|
|
||
| **Important**: The integration will also fetch stages from all nested jobs within the specified job. | ||
| ::: | ||
|
|
||
| ```yaml showLineNumbers | ||
| - kind: stage | ||
| selector: | ||
| query: 'true' | ||
| # Example jobUrl - replace with your own Jenkins job URL | ||
| jobUrl: http://your-jenkins-server/job/your-project/job/your-job | ||
| port: | ||
| entity: | ||
| mappings: | ||
| identifier: >- | ||
| ._links.self.href | sub("^.*?/"; "") | gsub("%20"; "-") | | ||
| gsub("%252F"; "-") | gsub("/"; "-") | ||
| title: .name | ||
| blueprint: '"jenkinsStage"' | ||
| properties: | ||
| status: .status | ||
| startTimeMillis: .startTimeMillis | ||
| durationMillis: .durationMillis | ||
| stageUrl: env.OCEAN__INTEGRATION__CONFIG__JENKINS_HOST + ._links.self.href | ||
| relations: | ||
| parentBuild: >- | ||
| ._links.self.href | sub("/execution/node/[0-9]+/wfapi/describe$"; | ||
| "") | sub("^.*?/"; "") | gsub("%20"; "-") | gsub("%252F"; "-") | | ||
| gsub("/"; "-") | ||
| # Additional stage configurations follow the same pattern. | ||
| - kind: stage | ||
| selector: | ||
| query: 'true' | ||
| # Example jobUrl - replace with your own Jenkins job URL | ||
| jobUrl: http://your-jenkins-server/job/your-project/job/another-job | ||
| port: | ||
| entity: | ||
| mappings: | ||
| identifier: >- | ||
| ._links.self.href | sub("^.*?/"; "") | gsub("%20"; "-") | | ||
| gsub("%252F"; "-") | gsub("/"; "-") | ||
| title: .name | ||
| blueprint: '"jenkinsStage"' | ||
| properties: | ||
| status: .status | ||
| startTimeMillis: .startTimeMillis | ||
| durationMillis: .durationMillis | ||
| stageUrl: env.OCEAN__INTEGRATION__CONFIG__JENKINS_HOST + ._links.self.href | ||
| relations: | ||
| parentBuild: >- | ||
| ._links.self.href | sub("/execution/node/[0-9]+/wfapi/describe$"; | ||
| "") | sub("^.*?/"; "") | gsub("%20"; "-") | gsub("%252F"; "-") | | ||
| gsub("/"; "-") | ||
|
|
||
| - kind: stage | ||
dennis-bilson-port marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| selector: | ||
| query: 'true' | ||
| # Example jobUrl - replace with your own Jenkins job URL | ||
| jobUrl: http://your-jenkins-server/job/your-project/job/third-job | ||
| port: | ||
| entity: | ||
| mappings: | ||
| identifier: >- | ||
| ._links.self.href | sub("^.*?/"; "") | gsub("%20"; "-") | | ||
| gsub("%252F"; "-") | gsub("/"; "-") | ||
| title: .name | ||
| blueprint: '"jenkinsStage"' | ||
| properties: | ||
| status: .status | ||
| startTimeMillis: .startTimeMillis | ||
| durationMillis: .durationMillis | ||
| stageUrl: env.OCEAN__INTEGRATION__CONFIG__JENKINS_HOST + ._links.self.href | ||
| relations: | ||
| parentBuild: >- | ||
| ._links.self.href | sub("/execution/node/[0-9]+/wfapi/describe$"; | ||
| "") | sub("^.*?/"; "") | gsub("%20"; "-") | gsub("%252F"; "-") | | ||
| gsub("/"; "-") | ||
| ``` | ||
| </details> | ||
32 changes: 32 additions & 0 deletions
32
...e-catalog/sync-data-to-catalog/cicd/jenkins/_example_jenkins_user_blueprint.mdx
This file contains hidden or 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,32 @@ | ||
| <details> | ||
| <summary><b>User blueprint (click to expand)</b></summary> | ||
|
|
||
| ```json showLineNumbers | ||
| { | ||
| "identifier": "jenkinsUser", | ||
| "description": "This blueprint represents a jenkins user", | ||
| "title": "Jenkins User", | ||
| "icon": "Jenkins", | ||
| "schema": { | ||
| "properties": { | ||
| "url": { | ||
| "type": "string", | ||
| "title": "URL", | ||
| "format": "url" | ||
| }, | ||
| "lastUpdateTime": { | ||
| "type": "string", | ||
| "format": "date-time", | ||
| "title": "Last Update", | ||
| "description": "Last updated timestamp of the user" | ||
| } | ||
| }, | ||
| "required": [] | ||
| }, | ||
| "mirrorProperties": {}, | ||
| "calculationProperties": {}, | ||
| "relations": {} | ||
| } | ||
| ``` | ||
|
|
||
| </details> |
21 changes: 21 additions & 0 deletions
21
...talog/sync-data-to-catalog/cicd/jenkins/_example_jenkins_user_configuration.mdx
This file contains hidden or 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,21 @@ | ||
| <details> | ||
| <summary><b>Integration configuration (click to expand)</b></summary> | ||
| ```yaml showLineNumbers | ||
| createMissingRelatedEntities: true | ||
| deleteDependentEntities: true | ||
| resources: | ||
| - kind: user | ||
| selector: | ||
| query: "true" | ||
| port: | ||
| entity: | ||
| mappings: | ||
| identifier: .user.id | ||
| title: .user.fullName | ||
| blueprint: '"jenkinsUser"' | ||
| properties: | ||
| url: .user.absoluteUrl | ||
| lastUpdateTime: if .lastChange then (.lastChange/1000) else now end | strftime("%Y-%m-%dT%H:%M:%SZ") | ||
|
|
||
| ``` | ||
| </details> |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.