Skip to content

Conversation

@dennis-bilson-port
Copy link
Member

@dennis-bilson-port dennis-bilson-port commented Oct 22, 2025

User description

Add support for pre-filtering in Jenkins Exporter to limit retrieved and updated data. Enables users to fetch only relevant builds (e.g., last N builds, recent days, or specific jobs), improving performance and reducing unnecessary data ingestion.

This is the linked feature request

Updated docs pages

Please also include the path for the updated docs

  • Quickstart (/)
  • Blueprint (/build-your-software-catalog/sync-data-to-catalog/cicd/jenkins)

PR Type

Documentation


Description

  • Refactored Jenkins integration documentation into modular components

  • Added pre-filtering selectors for builds: maxBuildsPerJob, daysSince, jobFilter

  • Created separate blueprint and configuration files for each entity type

  • Improved documentation structure with collapsible details sections


Diagram Walkthrough

flowchart LR
  A["Main Jenkins Doc"] -->|imports| B["Job Blueprint"]
  A -->|imports| C["Job Config"]
  A -->|imports| D["Build Blueprint"]
  A -->|imports| E["Build Config<br/>with Pre-filters"]
  A -->|imports| F["User Blueprint"]
  A -->|imports| G["User Config"]
  A -->|imports| H["Stage Blueprint"]
  A -->|imports| I["Stage Config"]
  A -->|imports| J["Default Config"]
  E -->|includes| K["maxBuildsPerJob<br/>daysSince<br/>jobFilter"]
Loading

File Walkthrough

Relevant files
Documentation
10 files
_example_jenkins_build_blueprint.mdx
Wrapped blueprint in collapsible details section                 
+3/-0     
_example_jenkins_build_configuration.mdx
New file with build pre-filtering configuration options   
+83/-0   
_example_jenkins_default_mapping_configuration.mdx
New file with complete default mapping configuration         
+60/-0   
_example_jenkins_job_blueprint.mdx
Wrapped job blueprint in collapsible details section         
+3/-0     
_example_jenkins_job_configuration.mdx
New file with job integration configuration example           
+23/-0   
_example_jenkins_stage_blueprint.mdx
New file with stage blueprint definition                                 
+65/-0   
_example_jenkins_stage_configuration.mdx
New file with stage configuration and job URL filtering   
+83/-0   
_example_jenkins_user_blueprint.mdx
New file with user blueprint definition                                   
+32/-0   
_example_jenkins_user_configuration.mdx
New file with user integration configuration example         
+21/-0   
jenkins.md
Refactored main doc to use modular component imports         
+24/-442

@dennis-bilson-port dennis-bilson-port self-assigned this Oct 22, 2025
@dennis-bilson-port dennis-bilson-port marked this pull request as ready for review October 22, 2025 21:39
@qodo-merge-pro
Copy link
Contributor

qodo-merge-pro bot commented Oct 22, 2025

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
- [ ] Create ticket/issue <!-- /create_ticket --create_ticket=true -->

</details></td></tr>
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
No custom compliance provided

Follow the guide to enable custom compliance check.

  • Update
Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-merge-pro
Copy link
Contributor

qodo-merge-pro bot commented Oct 22, 2025

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
High-level
Update build limit note for consistency

The "Build Limit" note incorrectly states a fixed limit of 100 builds per job.
This should be updated to reflect that 100 is the default value for the new
configurable maxBuildsPerJob selector, ensuring documentation consistency.

Examples:

docs/build-your-software-catalog/sync-data-to-catalog/cicd/jenkins/jenkins.md [457-459]
:::note Build Limit
The integration fetches up to 100 builds per Jenkins job, allowing you to view the 100 latest builds in Port for each job.
:::
docs/build-your-software-catalog/sync-data-to-catalog/cicd/jenkins/_example_jenkins_build_configuration.mdx [38-51]
<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

 ... (clipped 4 lines)

Solution Walkthrough:

Before:

### Build

:::note Build Limit
The integration fetches up to 100 builds per Jenkins job, allowing you to view the 100 latest builds in Port for each job.
:::

<JenkinsBuildBlueprint/>

<JenkinsBuildIntegration/>

After:

### Build

:::note Build Limit
By default, the integration fetches up to 100 builds per Jenkins job. This limit is configurable using the `maxBuildsPerJob` selector. See the configuration options below for more details.
:::

<JenkinsBuildBlueprint/>

<JenkinsBuildIntegration/>
Suggestion importance[1-10]: 7

__

Why: The suggestion correctly identifies a documentation inconsistency where a note implies a fixed build limit, contradicting the new configurable maxBuildsPerJob feature, which could confuse users.

Medium
Possible issue
Fix invalid YAML indentation
Suggestion Impact:The commit adjusted the indentation so that selector and port are correctly nested under the user resource, matching the suggested fix.

code diff:

-  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")
+    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")

Fix the incorrect YAML indentation for the user resource where selector and port
should be indented under the kind: user list item.

docs/build-your-software-catalog/sync-data-to-catalog/cicd/jenkins/_example_jenkins_user_configuration.mdx [6-18]

 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")
+    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")

[Suggestion processed]

Suggestion importance[1-10]: 7

__

Why: The suggestion correctly identifies and fixes a YAML syntax error in the example configuration, which would prevent it from being parsed correctly.

Medium
Fix incorrect JQ URL parsing
Suggestion Impact:The commit added gsub("%252F"; "-") to both the identifier and parentJob jq mappings, aligning with the suggestion.

code diff:

-            identifier: .url | split("://")[1] | sub("^.*?/"; "") | gsub("%20"; "-") | gsub("/"; "-") | .[:-1]
+            identifier: .url | split("://")[1] | sub("^.*?/"; "") | gsub("%20"; "-") | gsub("%252F"; "-") | gsub("/"; "-") | .[:-1]
             title: .displayName
             blueprint: '"jenkinsBuild"'
             properties:
@@ -25,7 +23,7 @@
               buildDuration: .duration
               timestamp: '.timestamp / 1000 | todate'
             relations:
-              parentJob: .url | split("://")[1] | sub("^.*?/"; "") | gsub("%20"; "-") | gsub("/"; "-") | .[:-1] | gsub("-[0-9]+$"; "")
+              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"; "-") |

Add gsub("%252F"; "-") to the jq expressions for identifier and parentJob to
correctly handle URL-encoded slashes in Jenkins job names.

docs/build-your-software-catalog/sync-data-to-catalog/cicd/jenkins/_example_jenkins_build_configuration.mdx [17-32]

 entity:
   mappings:
-    identifier: .url | split("://")[1] | sub("^.*?/"; "") | gsub("%20"; "-") | gsub("/"; "-") | .[:-1]
+    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("/"; "-") | .[:-1] | gsub("-[0-9]+$"; "")
+      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

[Suggestion processed]

Suggestion importance[1-10]: 6

__

Why: The suggestion correctly identifies a missing transformation in the JQ expression for URL parsing, which would cause incorrect identifiers for nested Jenkins jobs, thus improving the example's correctness.

Low
  • Update

@aws-amplify-eu-west-1
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-2937.d2ngvl90zqbob8.amplifyapp.com

…s-integration-for-pre-filtering-capability' into PORT-16637-update-docs-on-jenkins-integration-for-pre-filtering-capability
Copy link
Collaborator

@kodjomiles kodjomiles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few suggestion to make the blocks cleaner
Looks great overall

dennis-bilson-port and others added 4 commits October 24, 2025 15:38
Co-authored-by: Jaden Kodjo Miles <87667954+kodjomiles@users.noreply.github.com>
Co-authored-by: Jaden Kodjo Miles <87667954+kodjomiles@users.noreply.github.com>
Co-authored-by: Jaden Kodjo Miles <87667954+kodjomiles@users.noreply.github.com>
Co-authored-by: Jaden Kodjo Miles <87667954+kodjomiles@users.noreply.github.com>
Copy link
Collaborator

@kodjomiles kodjomiles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@sivanel97 sivanel97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :)

Copy link
Member

@mk-armah mk-armah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sivanel97 sivanel97 merged commit 3ebafb0 into main Oct 27, 2025
5 checks passed
@sivanel97 sivanel97 deleted the PORT-16637-update-docs-on-jenkins-integration-for-pre-filtering-capability branch October 27, 2025 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants