Skip to content

Conversation

@ntsemah
Copy link

@ntsemah ntsemah commented Oct 30, 2025

Description

What

Add Blackduck step to release job.

Why ?

HPCINFRA-3964

How ?

It is optional but for complex PRs please provide information about the design,
architecture, approach, etc.

Change type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Tests
  • Other

Check list

  • Code follows the style de facto guidelines of this project
  • Comments have been inserted in hard to understand places
  • Documentation has been updated (if necessary)
  • Test has been added (if possible)

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Overview

Greptile Summary

Added Blackduck security scanning to the release pipeline with a new boolean parameter do_blackduck to control execution. The implementation follows the existing NGCI Blackduck scan pattern from .ci/matrix_job.yaml.

Major changes:

  • Added do_blackduck boolean parameter in release_jjb.yaml (defaults to true)
  • Added blackduck container definition using harbor.mellanox.com/toolbox/blackduck_post_scan:latest
  • Implemented new Blackduck step in release pipeline with NGCIBlackDuckScan module
  • Added container selector to Release step to explicitly run on RHEL 8.6
  • Configured source code scanning of src directory with report artifact attachment

Critical issue:

  • Blackduck API token is hardcoded in SPRING_APPLICATION_JSON environment variable (line 70), creating a security vulnerability by exposing credentials in source control

Confidence Score: 1/5

  • Critical security vulnerability with hardcoded API token must be resolved before merge
  • Score reflects the presence of a hardcoded Blackduck API token in source code (line 70 of release_matrix_job.yaml). While the PR successfully integrates Blackduck scanning and follows existing patterns, exposing credentials in version control is a critical security issue that requires immediate remediation. The functionality itself appears correct, but the security risk prevents safe merging.
  • .ci/pipeline/release_matrix_job.yaml requires immediate attention to remove hardcoded API token

Important Files Changed

File Analysis

Filename Score Overview
.ci/pipeline/release_jjb.yaml 5/5 Added boolean parameter to control Blackduck execution, no issues
.ci/pipeline/release_matrix_job.yaml 1/5 Added Blackduck scan step with hardcoded API token in environment variable, critical security issue

Sequence Diagram

sequenceDiagram
    participant User
    participant Jenkins
    participant ReleaseJob as Release Job (release_matrix_job.yaml)
    participant RHEL as RHEL 8.6 Container
    participant BD as Blackduck Container
    participant BDServer as Blackduck Server
    
    User->>Jenkins: Trigger release with do_blackduck=true
    Jenkins->>ReleaseJob: Start release pipeline
    ReleaseJob->>RHEL: Build-dpcp step
    RHEL->>RHEL: Clone and build libdpcp
    ReleaseJob->>RHEL: Release step
    RHEL->>RHEL: Execute .ci/do_release.sh
    RHEL->>ReleaseJob: Archive build artifacts
    
    alt do_blackduck enabled
        ReleaseJob->>BD: Start Blackduck step
        BD->>BD: Load SPRING_APPLICATION_JSON with hardcoded token
        BD->>BDServer: NGCIBlackDuckScan of src directory
        BDServer->>BD: Scan results
        BD->>ReleaseJob: Attach Blackduck report artifact
    end
    
    ReleaseJob->>Jenkins: Pipeline complete
    Jenkins->>User: Send notification email
Loading

2 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Overview

Greptile Summary

Adds Blackduck security scanning to the release pipeline with proper credential management.

Key Changes:

  • Added do_blackduck boolean parameter to control scan execution
  • Integrated Jenkins credentials (blackduck_api_token) instead of hardcoding tokens
  • Added Blackduck container to runs_on_dockers configuration
  • Created new Blackduck scan step using NGCIBlackDuckScan module to scan src/ directory
  • Added explicit containerSelector to Release step for RHEL8.6 container

Implementation Details:
The Blackduck integration correctly uses the credentials mechanism ($BLACKDUCK_API_TOKEN environment variable) rather than hardcoding API tokens like the existing .ci/matrix_job.yaml:391 pattern. This is a security improvement over the legacy approach.

Confidence Score: 4/5

  • Safe to merge with minor consideration for containerSelector addition
  • Implementation correctly uses Jenkins credentials for security. The Blackduck step mirrors the existing pattern in .ci/matrix_job.yaml (lines 372-391) but improves security by using environment variables instead of hardcoded tokens. Added containerSelector to Release step ensures proper container targeting. Minimal risk as the step is optional via do_blackduck parameter.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
.ci/pipeline/release_jjb.yaml 5/5 Added do_blackduck boolean parameter to control Blackduck execution
.ci/pipeline/release_matrix_job.yaml 4/5 Added Blackduck scanning step with credentials integration and containerSelector for Release step

Sequence Diagram

sequenceDiagram
    participant Jenkins
    participant GitHub
    participant K8s as Kubernetes Pod
    participant RHEL as RHEL8.6 Container
    participant BD as Blackduck Container
    participant BDS as Blackduck Server
    participant Release as Release Storage

    Jenkins->>GitHub: Checkout code (release_tag)
    Jenkins->>K8s: Create build pod
    
    K8s->>RHEL: Start RHEL8.6 container
    RHEL->>GitHub: Clone libdpcp dependency
    RHEL->>RHEL: Build dpcp library
    RHEL->>RHEL: Build release packages (.ci/do_release.sh)
    RHEL->>Release: Publish packages (if do_release=true)
    RHEL->>Jenkins: Archive artifacts (RPMs, logs)
    
    alt do_blackduck=true
        K8s->>BD: Start Blackduck container
        Jenkins->>BD: Inject BLACKDUCK_API_TOKEN from credentials
        BD->>BD: Scan src/ directory
        BD->>BDS: Upload scan results (with API token)
        BDS->>BD: Return analysis report
        BD->>Jenkins: Attach Blackduck report artifact
    end
    
    Jenkins->>Jenkins: Send email notification (if configured)
Loading

2 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Overview

Greptile Summary

Integrates Blackduck security scanning into the release pipeline with proper credentials management. The implementation follows secure practices by using Jenkins credentials binding instead of hardcoded tokens.

Key Changes:

  • Added do_blackduck parameter to control scan execution in release_jjb.yaml
  • Configured credentials binding for BLACKDUCK_API_TOKEN using Jenkins secret
  • Added Blackduck scan step using NGCIBlackDuckScan module with proper container isolation
  • Scans src directory and attaches report artifacts to build
  • Properly restricts Release step to RHEL 8.6 container

Security Note:
This PR correctly uses Jenkins credentials binding (credentialsId: 'blackduck_api_token') to inject the API token securely, which is an improvement over the hardcoded token pattern found in .ci/matrix_job.yaml:391

Confidence Score: 4/5

  • Safe to merge with minimal risk - properly configured CI integration
  • Configuration follows Jenkins best practices for credentials management and mirrors existing Blackduck setup. Minor concern: containerSelector addition to Release step was unmentioned in PR description but appears intentional for build isolation
  • No files require special attention - both changes are straightforward CI configuration

Important Files Changed

File Analysis

Filename Score Overview
.ci/pipeline/release_jjb.yaml 5/5 Added do_blackduck boolean parameter to control Blackduck scanning in release pipeline
.ci/pipeline/release_matrix_job.yaml 4/5 Added Blackduck scan step with proper credentials binding and container configuration

Sequence Diagram

sequenceDiagram
    participant Jenkins as Jenkins Controller
    participant Job as Release Job
    participant RHEL as RHEL 8.6 Container
    participant BD as Blackduck Container
    participant Creds as Jenkins Credentials
    participant BDS as Blackduck Server

    Jenkins->>Job: Trigger release job with do_blackduck=true
    Job->>Creds: Request blackduck_api_token credential
    Creds->>Job: Inject BLACKDUCK_API_TOKEN env var
    
    Job->>RHEL: Run Build-dpcp step
    RHEL->>Job: Build complete
    
    Job->>RHEL: Run Release step
    RHEL->>Job: Release artifacts created
    
    alt do_blackduck enabled
        Job->>BD: Start Blackduck scan step
        BD->>BD: Use BLACKDUCK_API_TOKEN from env
        BD->>BDS: Connect to https://blackduck.mellanox.com/
        BDS->>BD: Authenticate with API token
        BD->>BD: Scan src directory
        BD->>BDS: Upload scan results
        BDS->>BD: Return report
        BD->>Job: Attach Blackduck report artifact
    end
    
    Job->>Jenkins: Complete with artifacts
Loading

2 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Overview

Greptile Summary

This PR adds Blackduck security scanning to the release pipeline, addressing a significant security improvement by replacing the hardcoded API token pattern with proper credential management.

Key Changes

  • release_jjb.yaml: Added do_blackduck boolean parameter (default: true) to control Blackduck scanning
  • release_matrix_job.yaml:
    • Added blackduck_api_token credential binding to securely inject BLACKDUCK_API_TOKEN
    • Added blackduck container from harbor.mellanox.com/toolbox/blackduck_post_scan:latest
    • Added new "Blackduck" step using NGCIBlackDuckScan module to scan the src/ directory
    • Configured to attach scan reports as build artifacts

Security Improvement

This change mirrors the existing Blackduck setup in .ci/matrix_job.yaml but properly uses Jenkins credentials instead of hardcoded tokens. This is a positive security enhancement that should also be applied to .ci/matrix_job.yaml:391 where the hardcoded token still exists.

Critical Issue

Line 73 contains a JSON syntax error where ${BLACKDUCK_API_TOKEN} is not quoted within the JSON string, which will cause the Blackduck scan to fail with invalid JSON.

Confidence Score: 2/5

  • This PR cannot be merged safely due to a critical JSON syntax error that will cause the Blackduck scan to fail.
  • The implementation correctly addresses a security concern by using credentials instead of hardcoded tokens, and the overall architecture is sound. However, the missing quotes around ${BLACKDUCK_API_TOKEN} in the JSON string on line 73 creates invalid JSON that will cause runtime failure. Once this syntax error is fixed, the PR would be safe to merge.
  • release_matrix_job.yaml requires immediate attention - line 73 must be corrected before merge.

Important Files Changed

File Analysis

Filename Score Overview
.ci/pipeline/release_jjb.yaml 5/5 Adds do_blackduck boolean parameter to enable/disable Blackduck scanning. Clean addition with no issues.
.ci/pipeline/release_matrix_job.yaml 2/5 Adds Blackduck scanning step with credential-based authentication (fixing hardcoded token issue). Contains JSON syntax error in line 73 where ${BLACKDUCK_API_TOKEN} lacks required quotes.

Sequence Diagram

sequenceDiagram
    participant J as Jenkins Job
    participant P as Pipeline
    participant R as RHEL 8.6 Container
    participant B as Blackduck Container
    participant BD as Blackduck Server
    
    J->>P: Trigger release job with parameters
    Note over J,P: do_blackduck=true (default)<br/>release_tag, sha1, revision
    
    P->>P: Load credentials
    Note over P: BLACKDUCK_API_TOKEN from<br/>Jenkins credential store
    
    P->>R: Step 1: Build-dpcp
    R->>R: Clone & build libdpcp
    
    P->>R: Step 2: Release
    R->>R: Execute .ci/do_release.sh
    R->>P: Archive RPM packages & logs
    
    alt do_blackduck enabled
        P->>B: Step 3: Blackduck scan
        Note over B: NGCIBlackDuckScan module
        B->>B: Scan src/ directory
        Note over B: projectName: libxlio<br/>projectVersion: ${sha1}<br/>scanMode: source
        B->>BD: Submit scan results
        Note over B,BD: SPRING_APPLICATION_JSON with<br/>blackduck.url and api.token
        BD->>B: Return scan report
        B->>P: Attach report artifact
    end
    
    P->>J: Complete with artifacts
Loading

2 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Overview

Greptile Summary

Adds Blackduck security scanning to the release pipeline, similar to the existing implementation in .ci/matrix_job.yaml. The change introduces a do_blackduck parameter to control execution and configures the NGCIBlackDuckScan step to scan source code.

Key changes:

  • Added do_blackduck boolean parameter in release_jjb.yaml to enable/disable scanning
  • Configured Jenkins credentials to inject BLACKDUCK_API_TOKEN securely (avoiding hardcoded token like in .ci/matrix_job.yaml:391)
  • Added Blackduck container and scan step to analyze src/ directory
  • Configured step to run on blackduck tool container after release build completes

Critical issue:

  • Variable reference error in SPRING_APPLICATION_JSON (line 74): references $token instead of ${BLACKDUCK_API_TOKEN}, may cause authentication failure

Confidence Score: 2/5

  • PR has a critical variable reference bug that will likely cause Blackduck authentication to fail
  • Score reflects the variable reference mismatch in SPRING_APPLICATION_JSON which references $token (args parameter) instead of the injected credential ${BLACKDUCK_API_TOKEN}. This will likely cause runtime failure when the Blackduck step attempts authentication. The overall approach is sound and improves security over the hardcoded token pattern, but the implementation error needs correction before merge.
  • .ci/pipeline/release_matrix_job.yaml requires attention for the variable reference fix on line 74

Important Files Changed

File Analysis

Filename Score Overview
.ci/pipeline/release_matrix_job.yaml 2/5 Added Blackduck scanning step with credentials and configuration. Contains variable reference issue in SPRING_APPLICATION_JSON and missing quotes around token value

Sequence Diagram

sequenceDiagram
    participant User
    participant Jenkins
    participant ReleaseJob
    participant RHEL86Container
    participant BlackDuckContainer
    participant BlackDuckServer
    participant CredStore as Jenkins Credentials

    User->>Jenkins: Trigger release job with do_blackduck=true
    Jenkins->>ReleaseJob: Load release_matrix_job.yaml config
    ReleaseJob->>CredStore: Request blackduck_api_token credential
    CredStore->>ReleaseJob: Inject BLACKDUCK_API_TOKEN variable
    
    ReleaseJob->>RHEL86Container: Start Build-dpcp step
    RHEL86Container->>RHEL86Container: Clone and build libdpcp
    
    ReleaseJob->>RHEL86Container: Start Release step
    RHEL86Container->>RHEL86Container: Execute .ci/do_release.sh
    RHEL86Container->>ReleaseJob: Archive artifacts (rpm packages, logs)
    
    alt do_blackduck enabled
        ReleaseJob->>BlackDuckContainer: Start Blackduck step
        BlackDuckContainer->>BlackDuckContainer: Configure SPRING_APPLICATION_JSON with token
        BlackDuckContainer->>BlackDuckServer: Execute NGCIBlackDuckScan on src/
        BlackDuckServer->>BlackDuckServer: Analyze source code for vulnerabilities
        BlackDuckServer->>BlackDuckContainer: Return scan results
        BlackDuckContainer->>ReleaseJob: Attach BlackDuck report artifact
    end
    
    ReleaseJob->>Jenkins: Complete release pipeline
    Jenkins->>User: Send notification email with results
Loading

2 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Overview

Greptile Summary

Adds Blackduck source code scanning to the release job pipeline, mirroring the existing implementation from .ci/matrix_job.yaml.

Key changes:

  • Added do_blackduck boolean parameter to control scan execution (.ci/pipeline/release_jjb.yaml:38-41)
  • Added blackduck container to runs_on_dockers list (.ci/pipeline/release_matrix_job.yaml:34)
  • Implemented new Blackduck scan step using NGCIBlackDuckScan module (.ci/pipeline/release_matrix_job.yaml:52-69)
  • Configured to scan src directory with source mode analysis
  • Reports attached as Jenkins artifacts

Critical Issue: The implementation hardcodes the Blackduck API token directly in SPRING_APPLICATION_JSON (line 69), which is a serious security vulnerability. This token is now permanently exposed in git history and accessible to anyone with repository read access. Commit af2121d previously attempted to migrate tokens to Jenkins credentials to address this exact security issue, but this PR reintroduces the vulnerability by copying the insecure pattern from .ci/matrix_job.yaml:391 (which also still has the hardcoded token).

Confidence Score: 0/5

  • This PR introduces a critical security vulnerability by hardcoding API credentials in source code.
  • Score reflects the critical security issue of hardcoded API token in .ci/pipeline/release_matrix_job.yaml:69. The token is permanently exposed in git history and violates security best practices. While the functional implementation appears correct, this security vulnerability must be resolved before merging.
  • .ci/pipeline/release_matrix_job.yaml requires immediate attention - the hardcoded API token on line 69 must be replaced with Jenkins credentials.

Important Files Changed

File Analysis

Filename Score Overview
.ci/pipeline/release_jjb.yaml 5/5 Added do_blackduck boolean parameter to enable/disable Blackduck scanning. Clean implementation with no issues.
.ci/pipeline/release_matrix_job.yaml 0/5 Added Blackduck scanning step with hardcoded API token directly in source code. Critical security vulnerability - token is exposed in git history.

Sequence Diagram

sequenceDiagram
    participant Jenkins
    participant ReleaseJob as Release Job
    participant RHEL as RHEL 8.6 Container
    participant BD as Blackduck Container
    participant BDServer as Blackduck Server

    Jenkins->>ReleaseJob: Trigger with do_blackduck=true
    ReleaseJob->>RHEL: Build-dpcp step
    RHEL->>RHEL: Clone and build libdpcp
    ReleaseJob->>RHEL: Release step
    RHEL->>RHEL: Execute .ci/do_release.sh
    RHEL->>ReleaseJob: Archive artifacts (build_pkg.log, RPMs)
    
    alt do_blackduck enabled
        ReleaseJob->>BD: Start Blackduck step
        Note over BD: Uses harbor.mellanox.com/toolbox/blackduck_post_scan:latest
        BD->>BD: Set SPRING_APPLICATION_JSON with hardcoded token
        BD->>BD: Run NGCIBlackDuckScan
        Note over BD: projectName: libxlio<br/>scanMode: source<br/>projectSrcPath: src
        BD->>BDServer: Authenticate with API token
        BD->>BDServer: Upload source scan results
        BDServer->>BD: Return scan results
        BD->>ReleaseJob: Attach BlackDuck report artifact
    end
    
    ReleaseJob->>Jenkins: Complete with artifacts
Loading

2 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Overview

Greptile Summary

Adds BlackDuck security scanning to the release pipeline, making it configurable via a new do_blackduck parameter.

Key Changes:

  • Adds do_blackduck boolean parameter to release_jjb.yaml to control scanning
  • Introduces new Blackduck step in release_matrix_job.yaml using NGCIBlackDuckScan action
  • Configures scanning for src directory with source code analysis mode
  • Uses blackduck container from harbor.mellanox.com toolbox

Issues Found:

  • Hardcoded API token in SPRING_APPLICATION_JSON (matches existing pattern in .ci/matrix_job.yaml:391)
  • Trailing tab character in credential ID string
  • Unused credential definition (BLACKDUCK_GERRIT_CREDENTIALS)

Confidence Score: 3/5

  • PR can merge but has a critical security issue (hardcoded token) that mirrors existing codebase pattern
  • Score reflects the presence of a hardcoded API token which is a security vulnerability, though it matches the existing pattern in the main CI job. The syntax error (trailing tab) is minor but should be fixed. The implementation is otherwise straightforward and consistent with the existing Blackduck integration.
  • .ci/pipeline/release_matrix_job.yaml needs attention for credential ID syntax fix and to address the hardcoded token (though this is a codebase-wide pattern)

Important Files Changed

File Analysis

Filename Score Overview
.ci/pipeline/release_jjb.yaml 5/5 Adds do_blackduck boolean parameter to control BlackDuck scanning - straightforward configuration change with no issues
.ci/pipeline/release_matrix_job.yaml 2/5 Adds BlackDuck scanning step with hardcoded API token and trailing tab in credential ID. Token is a critical security issue; credential definition appears unused

Sequence Diagram

sequenceDiagram
    participant User
    participant Jenkins
    participant ReleaseJob
    participant RHEL8Container
    participant BlackduckContainer
    participant BlackduckServer

    User->>Jenkins: Trigger release job with release_tag
    Jenkins->>ReleaseJob: Load release_matrix_job.yaml config
    Jenkins->>ReleaseJob: Check do_blackduck parameter
    
    ReleaseJob->>RHEL8Container: Start Build-dpcp step
    RHEL8Container->>RHEL8Container: Clone and build libdpcp
    
    ReleaseJob->>RHEL8Container: Start Release step
    RHEL8Container->>RHEL8Container: Execute .ci/do_release.sh
    RHEL8Container->>ReleaseJob: Archive RPM artifacts
    
    alt do_blackduck == true
        ReleaseJob->>BlackduckContainer: Start Blackduck step
        BlackduckContainer->>BlackduckContainer: NGCIBlackDuckScan action
        BlackduckContainer->>BlackduckServer: Scan src/ directory
        Note over BlackduckContainer,BlackduckServer: Uses hardcoded API token
        BlackduckServer->>BlackduckContainer: Return scan results
        BlackduckContainer->>ReleaseJob: Attach BlackDuck report
    end
    
    ReleaseJob->>User: Send notification email with results
Loading

2 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Overview

Greptile Summary

Adds Blackduck security scanning to the release pipeline with a configurable boolean parameter to enable/disable the scan.

  • Adds do_blackduck parameter (default: true) to control scan execution
  • Introduces new Blackduck scan step using NGCIBlackDuckScan module
  • Configures scan to analyze src directory and attach results as artifacts
  • Critical Issue: Hardcoded Blackduck API token in release_matrix_job.yaml:72 exposes credentials in repository history
  • Syntax Issue: Trailing tab character in credential ID swx-jenkins2-svc-gerrit-password\t on line 17
  • Configuration Issue: BLACKDUCK_GERRIT_CREDENTIALS credential is defined but never referenced in the Blackduck step
  • Undocumented Change: Added containerSelector to Release step (lines 49-50) restricting it to rhel8.6 container

Confidence Score: 1/5

  • This PR has critical security vulnerabilities and must not be merged in its current state
  • The hardcoded Blackduck API token on line 72 is a critical security vulnerability that exposes credentials in the repository history. Additionally, there's a syntax error with a trailing tab in the credential ID and an unused credential definition. These issues must be resolved before merging.
  • .ci/pipeline/release_matrix_job.yaml requires immediate attention to remove hardcoded credentials and fix syntax errors

Important Files Changed

File Analysis

Filename Score Overview
.ci/pipeline/release_jjb.yaml 5/5 Adds do_blackduck boolean parameter to control Blackduck scan execution
.ci/pipeline/release_matrix_job.yaml 1/5 Adds Blackduck scan step with hardcoded API token (critical security issue), trailing tab in credential ID, and unused credential definition

Sequence Diagram

sequenceDiagram
    participant J as Jenkins Job
    participant R as RHEL8.6 Container
    participant B as Blackduck Container
    participant BD as Blackduck Server
    
    J->>J: Read do_blackduck parameter (default: true)
    J->>R: Start Release step
    R->>R: Run .ci/do_release.sh
    R->>R: Archive build artifacts
    R->>J: Release complete
    
    alt do_blackduck == true
        J->>B: Start Blackduck step
        B->>B: Load BLACKDUCK_GERRIT_CREDENTIALS
        B->>B: Set SPRING_APPLICATION_JSON with hardcoded token
        B->>BD: NGCIBlackDuckScan(projectName, projectVersion)
        B->>BD: Scan src directory
        BD->>BD: Perform security scan
        BD->>B: Return scan results
        B->>J: Attach report artifact
    else do_blackduck == false
        J->>J: Skip Blackduck step
    end
    
    J->>J: Send notification email
Loading

2 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Overview

Greptile Summary

This PR adds BlackDuck security scanning to the release pipeline by introducing a do_blackduck parameter in the JJB configuration and a new BlackDuck scan step in the release matrix job.

Key Changes:

  • Added boolean parameter do_blackduck (default: true) to control BlackDuck execution
  • Configured new BlackDuck scan step using NGCIBlackDuckScan module for source code scanning
  • Added blackduck Docker container from harbor.mellanox.com/toolbox/blackduck_post_scan:latest
  • Defined unused credential BLACKDUCK_GERRIT_CREDENTIALS in credentials section

Critical Security Issue:
The BlackDuck API token is hardcoded directly in SPRING_APPLICATION_JSON on line 72, exposing it in the repository history. This mirrors the existing pattern in .ci/matrix_job.yaml:391 where the same token appears. Historical commits show this has been an ongoing issue - commit af2121d attempted to move tokens to Jenkins credentials (blackduck_api_token), but later changes reverted to hardcoded tokens. The proper approach would be to use Jenkins credential injection instead of embedding secrets in source code.

Confidence Score: 2/5

  • This PR has a critical security vulnerability with the hardcoded API token but is functionally sound
  • Score of 2 reflects that while the BlackDuck integration is functionally correct and follows the existing pattern in the codebase, the hardcoded API token in line 72 represents a serious security risk. The token is permanently exposed in git history and accessible to anyone with repository read access. This same vulnerability exists in .ci/matrix_job.yaml:391, indicating a systemic security issue rather than an isolated mistake. The PR should not be merged until the token is moved to Jenkins credentials.
  • .ci/pipeline/release_matrix_job.yaml requires immediate attention to replace the hardcoded API token with Jenkins credential injection before merging

Important Files Changed

File Analysis

Filename Score Overview
.ci/pipeline/release_jjb.yaml 5/5 Added do_blackduck boolean parameter to control BlackDuck execution - straightforward and safe addition
.ci/pipeline/release_matrix_job.yaml 1/5 Added BlackDuck scan step with hardcoded API token in source code - critical security vulnerability exposing credentials in repository history

Sequence Diagram

sequenceDiagram
    participant User
    participant Jenkins
    participant ReleaseJob
    participant RHEL86Container
    participant BlackduckContainer
    participant BlackduckServer
    
    User->>Jenkins: Trigger release job with do_blackduck=true
    Jenkins->>ReleaseJob: Load release_matrix_job.yaml config
    ReleaseJob->>Jenkins: Inject BLACKDUCK_GERRIT_CREDENTIALS (unused)
    ReleaseJob->>RHEL86Container: Execute Build-dpcp step
    RHEL86Container->>ReleaseJob: Build complete
    ReleaseJob->>RHEL86Container: Execute Release step
    RHEL86Container->>RHEL86Container: Run .ci/do_release.sh
    RHEL86Container->>ReleaseJob: Archive build artifacts
    
    alt do_blackduck enabled
        ReleaseJob->>BlackduckContainer: Execute Blackduck step
        BlackduckContainer->>BlackduckContainer: Set SPRING_APPLICATION_JSON with hardcoded token
        BlackduckContainer->>BlackduckServer: NGCIBlackDuckScan (source scan)
        Note over BlackduckContainer,BlackduckServer: credentialsId: swx-jenkins3-svc_git-nbu_token
        BlackduckServer->>BlackduckContainer: Scan results
        BlackduckContainer->>ReleaseJob: Attach BlackDuck report
    end
    
    ReleaseJob->>User: Send email notification with build status
Loading

2 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Overview

Greptile Summary

This PR adds Blackduck security scanning to the release pipeline. The implementation mirrors the existing Blackduck configuration from .ci/matrix_job.yaml:372-391, ensuring consistency across CI/CD pipelines.

Key changes:

  • Added do_blackduck boolean parameter in release_jjb.yaml to allow toggling the scan (defaults to true)
  • Added Blackduck container definition (blackduck_post_scan:latest) to available containers
  • Added new Blackduck step that scans the src directory and attaches the report as a build artifact
  • Added explicit container selector to Release step to specify RHEL8.6 container

Pattern consistency: The Blackduck configuration uses the same hardcoded API token pattern as the existing CI pipeline (.ci/matrix_job.yaml:391). While this represents a pre-existing security practice in the codebase, it's worth noting for future refactoring to use Jenkins credentials instead.

Confidence Score: 4/5

  • This PR is safe to merge with minimal risk - it replicates a proven pattern from the existing CI pipeline
  • The implementation directly mirrors the working Blackduck configuration from .ci/matrix_job.yaml, reducing risk of errors. Score reduced by 1 point due to the hardcoded API token pattern (though this is pre-existing in the codebase, not introduced by this PR). The changes are isolated to CI configuration with clear enable/disable controls.
  • No files require special attention - both configuration files follow established patterns

Important Files Changed

File Analysis

Filename Score Overview
.ci/pipeline/release_jjb.yaml 5/5 Added do_blackduck boolean parameter to control Blackduck scanning in release job
.ci/pipeline/release_matrix_job.yaml 4/5 Added Blackduck scan step with hardcoded API token mirroring existing CI pipeline pattern, added container selector to Release step

Sequence Diagram

sequenceDiagram
    participant User
    participant Jenkins
    participant RHEL8.6 as RHEL8.6 Container
    participant BD as Blackduck Container
    participant BDS as Blackduck Server

    User->>Jenkins: Trigger release job with do_blackduck=true
    Jenkins->>RHEL8.6: Execute Build-dpcp step
    RHEL8.6->>RHEL8.6: Clone & build libdpcp
    Jenkins->>RHEL8.6: Execute Release step
    RHEL8.6->>RHEL8.6: Run .ci/do_release.sh
    RHEL8.6->>Jenkins: Archive artifacts (logs, RPMs)
    
    alt do_blackduck is enabled
        Jenkins->>BD: Execute Blackduck step
        BD->>BD: Load NGCIBlackDuckScan module
        BD->>BDS: Scan src directory
        Note over BD,BDS: Using hardcoded API token<br/>in SPRING_APPLICATION_JSON
        BDS->>BD: Return scan results
        BD->>Jenkins: Attach BlackDuck report artifact
    end
    
    Jenkins->>User: Send notification email with results
Loading

2 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Overview

Greptile Summary

Adds Blackduck security scanning to the release pipeline as a configurable step.

Key Changes:

  • Adds do_blackduck parameter to control scan execution (default: true)
  • Integrates Blackduck container and NGCIBlackDuckScan action
  • Scans src/ directory for security vulnerabilities
  • Generates and attaches Blackduck reports as build artifacts

Security Concern:

  • Hardcoded Blackduck API token in SPRING_APPLICATION_JSON (line 72) mirrors existing pattern in .ci/matrix_job.yaml:391, but represents a security vulnerability as the token is committed to version control

Configuration Note:

  • Credential BLACKDUCK_GERRIT_CREDENTIALS defined but unused (the credentialsId parameter directly references the credential ID string instead)

Confidence Score: 3/5

  • PR introduces security scanning capability but contains a critical security vulnerability with hardcoded API token
  • Score reflects the trade-off between functionality (properly configured Blackduck integration matching existing patterns) and security (hardcoded API token in version control). While the implementation correctly mirrors .ci/matrix_job.yaml:391, this pattern itself is a security anti-pattern that should be addressed
  • .ci/pipeline/release_matrix_job.yaml requires attention for the hardcoded API token on line 72

Important Files Changed

File Analysis

Filename Score Overview
.ci/pipeline/release_jjb.yaml 5/5 Adds boolean parameter do_blackduck to control Blackduck execution - straightforward and safe change
.ci/pipeline/release_matrix_job.yaml 3/5 Adds Blackduck scanning step with hardcoded API token in SPRING_APPLICATION_JSON (security concern), unused credential variable, but mirrors existing pattern from .ci/matrix_job.yaml:391

Sequence Diagram

sequenceDiagram
    participant Jenkins
    participant ReleaseJob as Release Job
    participant RHEL as RHEL8.6 Container
    participant BD as Blackduck Container
    participant BDS as Blackduck Server

    Jenkins->>ReleaseJob: Trigger release with parameters
    Note over ReleaseJob: do_blackduck=true (default)
    ReleaseJob->>RHEL: Build-dpcp step
    RHEL->>RHEL: Clone & build libdpcp
    ReleaseJob->>RHEL: Release step
    RHEL->>RHEL: Execute .ci/do_release.sh
    RHEL->>ReleaseJob: Archive artifacts (logs, RPMs)
    
    alt do_blackduck enabled
        ReleaseJob->>BD: Blackduck step (NGCIBlackDuckScan)
        Note over BD: Load credentials<br/>swx-jenkins3-svc_git-nbu_token
        Note over BD: SPRING_APPLICATION_JSON<br/>with hardcoded API token
        BD->>BD: Scan src/ directory
        BD->>BDS: Upload scan results
        Note over BD,BDS: projectName: libxlio<br/>projectVersion: ${sha1}
        BDS-->>BD: Scan complete
        BD->>ReleaseJob: Attach report artifact
    end
    
    ReleaseJob->>Jenkins: Send email notification
    Note over Jenkins: Report build status to<br/>notification_email
Loading

2 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@ntsemah ntsemah force-pushed the HPCINFRA-3964 branch 2 times, most recently from 02b5fe3 to d244869 Compare November 5, 2025 10:16
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Overview

Greptile Summary

Adds Blackduck security scanning to the release pipeline by introducing a new do_blackduck parameter and Blackduck step. The configuration mirrors the existing pattern from .ci/matrix_job.yaml:391.

Key Changes:

  • Added do_blackduck boolean parameter (defaults to true) in release job configuration
  • Introduced Blackduck docker container to runs_on_dockers
  • Added Blackduck scanning step that scans the src directory and generates reports
  • Added containerSelector to Release step to explicitly run on rhel8.6

Critical Issues:

  • Hardcoded Blackduck API token in line 69 exposes credentials in repository history (same token exists in .ci/matrix_job.yaml:391)
  • This creates a security vulnerability as the token is accessible to anyone with read access to the repository

Confidence Score: 1/5

  • This PR contains a critical security vulnerability that must be addressed before merging
  • While the Blackduck integration follows existing patterns and the CI configuration changes are straightforward, the hardcoded API token in line 69 represents a critical security issue. This exposes credentials in the repository history and violates security best practices, even though it mirrors the existing vulnerability in .ci/matrix_job.yaml:391
  • .ci/pipeline/release_matrix_job.yaml requires immediate attention due to hardcoded API credentials

Important Files Changed

File Analysis

Filename Score Overview
.ci/pipeline/release_jjb.yaml 5/5 Added do_blackduck boolean parameter to control Blackduck execution - straightforward configuration change
.ci/pipeline/release_matrix_job.yaml 1/5 Added Blackduck step with hardcoded API token (critical security issue), plus added container selector to Release step

Sequence Diagram

sequenceDiagram
    participant Jenkins
    participant ReleaseJob as Release Job
    participant RHEL as RHEL 8.6 Container
    participant BD as Blackduck Container
    participant BDS as Blackduck Server

    Jenkins->>ReleaseJob: Trigger release with parameters
    Note over ReleaseJob: Parameters: release_tag, do_blackduck=true
    
    ReleaseJob->>RHEL: Clone libdpcp repository
    RHEL->>RHEL: Build and install dpcp
    
    ReleaseJob->>RHEL: Execute Release step
    RHEL->>RHEL: Run .ci/do_release.sh
    RHEL->>ReleaseJob: Archive build logs and RPM packages
    
    alt do_blackduck == true
        ReleaseJob->>BD: Execute Blackduck step
        Note over BD: Uses hardcoded API token
        BD->>BD: Scan src directory
        BD->>BDS: Upload scan results to blackduck.mellanox.com
        BDS->>BD: Return scan report
        BD->>ReleaseJob: Attach Blackduck report artifact
    end
    
    ReleaseJob->>Jenkins: Send email notification with build status
Loading

2 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@ntsemah ntsemah changed the base branch from master to vNext November 5, 2025 16:43
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Overview

Greptile Summary

Adds Blackduck security scanning to the release CI pipeline with a new do_blackduck toggle parameter and scan step using NGCIBlackDuckScan.

Major Issues Found:

  • Critical Security Vulnerability: Hardcoded base64-encoded Blackduck API token exposed in .ci/pipeline/release_matrix_job.yaml:73 - token is permanently visible in git history to anyone with repository access
  • Missing Infrastructure: No credentials: section to inject the blackduck_api_token credential (pattern exists in .ci/matrix_job.yaml:28)
  • Configuration Mismatch: Step references git credentials (swx-jenkins3-svc_git-nbu_token) but requires API token credentials

Recommended Fix Pattern:
The existing .ci/matrix_job.yaml shows the correct approach: define credentials in a credentials: section, inject as environment variable BLACKDUCK_API_TOKEN, then reference via ${BLACKDUCK_API_TOKEN} in the JSON config.

Confidence Score: 0/5

  • This PR is NOT safe to merge - contains critical security vulnerability that exposes API credentials
  • Score of 0 reflects the hardcoded API token in line 73 which creates an immediate security risk. The base64-encoded token (decodes to UUID format) is permanently exposed in git history. The existing codebase shows the correct pattern in .ci/matrix_job.yaml using Jenkins credentials injection, but this PR implements a completely different insecure approach.
  • .ci/pipeline/release_matrix_job.yaml requires immediate attention - must add credentials section and remove hardcoded token before merge

Important Files Changed

File Analysis

Filename Score Overview
.ci/pipeline/release_jjb.yaml 5/5 Added boolean parameter do_blackduck to control Blackduck scan execution - clean change with no issues
.ci/pipeline/release_matrix_job.yaml 0/5 Added Blackduck scan step with hardcoded API token (critical security issue), missing credentials injection section, and unclear git credentials usage

Sequence Diagram

sequenceDiagram
    participant User
    participant Jenkins
    participant ReleaseJob
    participant RHEL8Container
    participant BlackduckContainer
    participant BlackduckServer

    User->>Jenkins: Trigger Release Job
    Jenkins->>Jenkins: Load release_jjb.yaml parameters
    Note over Jenkins: do_blackduck=true (default)
    Jenkins->>ReleaseJob: Start LIBXLIO-release
    
    ReleaseJob->>ReleaseJob: Check credentials section
    Note over ReleaseJob: WARNING: No credentials defined
    
    ReleaseJob->>RHEL8Container: Execute Build-dpcp step
    RHEL8Container->>RHEL8Container: Clone & build libdpcp
    RHEL8Container-->>ReleaseJob: Build complete
    
    ReleaseJob->>RHEL8Container: Execute Release step
    RHEL8Container->>RHEL8Container: Run .ci/do_release.sh
    RHEL8Container-->>ReleaseJob: Archive artifacts
    
    alt do_blackduck enabled
        ReleaseJob->>BlackduckContainer: Execute Blackduck step
        Note over BlackduckContainer: Use NGCIBlackDuckScan
        BlackduckContainer->>BlackduckContainer: Load SPRING_APPLICATION_JSON
        Note over BlackduckContainer: CRITICAL: Hardcoded API token!
        BlackduckContainer->>BlackduckServer: Scan source code (src/)
        BlackduckServer-->>BlackduckContainer: Scan results
        BlackduckContainer-->>ReleaseJob: Archive report
    end
    
    ReleaseJob->>User: Send notification email
Loading

Additional Comments (1)

  1. .ci/pipeline/release_matrix_job.yaml, line 20-21 (link)

    logic: Missing credentials: section to inject Blackduck API token. Add after env: section:

    credentials:
      - {credentialsId: 'blackduck_api_token', type: 'string', variable: 'BLACKDUCK_API_TOKEN'}
    

2 files reviewed, 3 comments

Edit Code Review Agent Settings | Greptile

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Overview

Greptile Summary

Adds Blackduck security scanning to the release pipeline with a new do_blackduck toggle parameter and NGCI module integration.

Key Changes:

  • Added do_blackduck boolean parameter in .ci/pipeline/release_jjb.yaml (defaults to true)
  • Configured blackduck_api_token credential injection
  • Added blackduck tool container from harbor
  • Created Blackduck step using NGCIBlackDuckScan module to scan src directory

Issues Found:

  • Critical JSON syntax error: Line 76 has unquoted variable in JSON causing invalid syntax
  • Architectural concern: NGCIBlackDuckScan was intentionally removed from main CI pipeline (commit 4e0289f) due to Gerrit credential rotation issues. Using the manual script approach (.ci/blackduck_source.sh) would be more reliable and consistent with the rest of the codebase

Confidence Score: 2/5

  • Critical JSON syntax error will cause runtime failure
  • The unquoted variable in JSON (line 76) creates invalid JSON that will fail when parsed. Additionally, the use of NGCIBlackDuckScan contradicts the architectural decision in commit 4e0289f to replace it with a manual script due to reliability issues
  • .ci/pipeline/release_matrix_job.yaml requires immediate attention - JSON syntax fix is mandatory, and architectural approach should be reconsidered

Important Files Changed

File Analysis

Filename Score Overview
.ci/pipeline/release_jjb.yaml 5/5 Added do_blackduck boolean parameter to control Blackduck scanning in release pipeline
.ci/pipeline/release_matrix_job.yaml 2/5 Added Blackduck step using NGCIBlackDuckScan module with credential injection, but has JSON syntax error and questionable module choice

Sequence Diagram

sequenceDiagram
    participant Jenkins
    participant ReleaseJob as Release Job
    participant Credentials as Jenkins Credentials
    participant BlackduckContainer as Blackduck Container
    participant NGCI as NGCI Module
    participant BlackduckAPI as Blackduck API

    Jenkins->>ReleaseJob: Trigger with do_blackduck=true
    ReleaseJob->>Credentials: Request blackduck_api_token
    Credentials->>ReleaseJob: Inject BLACKDUCK_API_TOKEN
    ReleaseJob->>BlackduckContainer: Start blackduck tool container
    BlackduckContainer->>NGCI: Execute NGCIBlackDuckScan
    NGCI->>NGCI: Parse SPRING_APPLICATION_JSON (FAILS if not valid JSON)
    NGCI->>BlackduckAPI: Authenticate and scan src directory
    BlackduckAPI->>NGCI: Return scan results
    NGCI->>ReleaseJob: Archive report as artifact
    ReleaseJob->>Jenkins: Complete with results
Loading

2 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Overview

Greptile Summary

This PR adds BlackDuck security scanning to the release pipeline, mirroring the existing implementation in the main CI pipeline.

Key changes:

  • Added do_blackduck boolean parameter to control BlackDuck execution in the release job
  • Configured BlackDuck step in release_matrix_job.yaml with proper credentials injection (blackduck_api_token)
  • Added xlio_static.bduck Docker container definition for running BlackDuck scans
  • Added explicit container selectors to existing Build-dpcp and Release steps for clarity
  • Updated .ci/blackduck_source.sh with improved bash variable quoting (cosmetic consistency fix)

The implementation follows the pattern established in commit 4e0289f, which replaced NGCI BlackDuck scanning with a manual script approach to avoid Gerrit token rotation issues. The release pipeline now uses the same reliable script-based method.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk - adds security scanning to release pipeline using proven implementation.
  • The changes mirror the existing, proven BlackDuck implementation from the main CI pipeline (.ci/matrix_job.yaml:510-522). The script-based approach was already validated in commit 4e0289f to resolve token rotation issues. Credentials are properly injected via Jenkins secrets, and the implementation follows established patterns.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
.ci/blackduck_source.sh 5/5 Improved bash variable quoting consistency - variables now properly quoted with ${}
.ci/pipeline/release_jjb.yaml 5/5 Added do_blackduck boolean parameter for controlling BlackDuck execution
.ci/pipeline/release_matrix_job.yaml 5/5 Added BlackDuck scanning step to release pipeline with proper credentials and container configuration

Sequence Diagram

sequenceDiagram
    participant User
    participant Jenkins
    participant ReleaseJob as Release Job
    participant Docker as Docker Container
    participant BlackDuck as BlackDuck Server
    
    User->>Jenkins: Trigger release with do_blackduck=true
    Jenkins->>ReleaseJob: Start release_matrix_job.yaml
    ReleaseJob->>Jenkins: Inject BLACKDUCK_API_TOKEN credential
    
    ReleaseJob->>Docker: Start xlio_static.bduck container
    Docker->>Docker: Run .ci/blackduck_source.sh
    
    Docker->>Docker: Validate WORKSPACE and BLACKDUCK_API_TOKEN
    Docker->>Docker: Create SPRING_APPLICATION_JSON with token
    
    Docker->>Docker: Clone blackduck tools from git-nbu.nvidia.com
    Docker->>BlackDuck: Run ./run_bd_scan.sh signature
    BlackDuck-->>Docker: Return scan results
    
    Docker->>Docker: Copy logs and PDF report to ${WORKSPACE}/logs/
    Docker->>ReleaseJob: Exit with scan status
    
    ReleaseJob->>Jenkins: Archive logs/ artifacts
    Jenkins->>User: Display results
Loading

3 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@ntsemah
Copy link
Author

ntsemah commented Nov 5, 2025

Copy link
Contributor

@NirWolfer NirWolfer left a comment

Choose a reason for hiding this comment

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

Im not seeing changes to the opensource_jjb.yaml and matrix_job.yaml to remove the current blackduck step from the main CI

@dpressle
Copy link
Collaborator

dpressle commented Nov 9, 2025

bot:retest

@dpressle
Copy link
Collaborator

dpressle commented Nov 9, 2025

Im not seeing changes to the opensource_jjb.yaml and matrix_job.yaml to remove the current blackduck step from the main CI

i told Noam not to remove it for now

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Overview

Greptile Summary

Adds BlackDuck security scanning to the release pipeline by introducing a new optional step that runs signature scanning on released packages, mirroring the existing BlackDuck implementation from the main CI pipeline (.ci/matrix_job.yaml).

Key changes:

  • Added do_blackduck boolean parameter (default: true) to control BlackDuck execution
  • Configured BlackDuck container (xlio_static.bduck) and credentials (blackduck_api_token)
  • Added BlackDuck step that executes .ci/blackduck_source.sh and archives scan logs
  • Minor style improvements to .ci/blackduck_source.sh (consistent variable wrapping)
  • Updated jnlp image to use nbu-harbor.gtm.nvidia.com registry
  • Added explicit container selectors for Build-dpcp and Release steps

Confidence Score: 4/5

  • Safe to merge with one minor note about container selector consistency
  • Implementation correctly mirrors the proven pattern from .ci/matrix_job.yaml:510-522. Credentials are properly managed via Jenkins credential injection. The BlackDuck step is optional (controlled by do_blackduck parameter) and uses the same battle-tested script (.ci/blackduck_source.sh) that replaced the problematic NGCI BlackDuck scan in commit 4e0289f. Minor deduction for adding container selectors to existing steps which wasn't part of the stated PR objective
  • No files require special attention - all changes follow established patterns

Important Files Changed

File Analysis

Filename Score Overview
.ci/blackduck_source.sh 5/5 Shell style improvements: consistently wrap variable references in ${}
.ci/pipeline/release_jjb.yaml 5/5 Added do_blackduck boolean parameter to control BlackDuck execution
.ci/pipeline/release_matrix_job.yaml 4/5 Added BlackDuck scanning step with credentials and container configuration; mirrors existing pattern from .ci/matrix_job.yaml

Sequence Diagram

sequenceDiagram
    participant Jenkins
    participant ReleaseJob as Release Job
    participant JJB as JJB Config
    participant MatrixJob as Matrix Job YAML
    participant BuildContainer as RHEL 8.6 Container
    participant BDContainer as Blackduck Container
    participant BDScript as blackduck_source.sh
    participant BDServer as BlackDuck Server
    
    Jenkins->>JJB: Trigger release with params
    JJB->>JJB: Check do_blackduck param (default: true)
    JJB->>MatrixJob: Load config & inject credentials
    MatrixJob->>MatrixJob: Inject BLACKDUCK_API_TOKEN credential
    
    MatrixJob->>BuildContainer: Step 1: Build-dpcp
    BuildContainer-->>MatrixJob: Complete
    
    MatrixJob->>BuildContainer: Step 2: Release
    BuildContainer->>BuildContainer: Run .ci/do_release.sh
    BuildContainer-->>MatrixJob: Archive build artifacts
    
    alt do_blackduck is true
        MatrixJob->>BDContainer: Step 3: Blackduck
        BDContainer->>BDScript: Execute .ci/blackduck_source.sh
        BDScript->>BDScript: Validate WORKSPACE & BLACKDUCK_API_TOKEN
        BDScript->>BDScript: Generate JSON config with token
        BDScript->>BDScript: Clone blackduck tools repo
        BDScript->>BDServer: Run signature scan (timeout 3600s)
        BDServer-->>BDScript: Scan results & PDF report
        BDScript->>BDScript: Copy logs & report to WORKSPACE/logs/
        BDScript-->>BDContainer: Exit with scan status
        BDContainer-->>MatrixJob: Archive logs/
    else do_blackduck is false
        MatrixJob->>MatrixJob: Skip Blackduck step
    end
    
    MatrixJob-->>Jenkins: Complete release pipeline
Loading

3 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@ntsemah ntsemah force-pushed the HPCINFRA-3964 branch 2 times, most recently from 76bfe81 to 1484761 Compare November 12, 2025 13:15
@greptile-apps
Copy link

greptile-apps bot commented Nov 12, 2025

Greptile Overview

Greptile Summary

This PR adds Blackduck security scanning to the release pipeline, mirroring the implementation already present in the regular CI pipeline (.ci/matrix_job.yaml). The changes include adding a do_blackduck parameter to control execution, defining the Blackduck container, injecting credentials securely via Jenkins, and executing the existing .ci/blackduck_source.sh script.

Key changes:

  • Added do_blackduck boolean parameter in release_jjb.yaml to enable/disable the scan
  • Configured Blackduck container (xlio_static.bduck) with proper user permissions (UID 6213)
  • Properly injected blackduck_api_token credential via Jenkins credentials system
  • Updated harbor registry URL from harbor.mellanox.com to nbu-harbor.gtm.nvidia.com for consistency
  • Improved shell script with consistent variable syntax and removed unnecessary sudo

The implementation correctly uses Jenkins credential injection rather than hardcoded tokens, and follows the established pattern from commit 4e0289f which replaced the problematic NGCI module with a manual script approach.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The implementation correctly mirrors the existing Blackduck integration from .ci/matrix_job.yaml, uses proper credential injection via Jenkins (not hardcoded tokens), and makes sensible improvements to the shell script. All changes follow established patterns in the codebase.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
.ci/blackduck_source.sh 5/5 Style improvements: consistent variable syntax and removed unnecessary sudo
.ci/pipeline/release_jjb.yaml 5/5 Added do_blackduck boolean parameter to control Blackduck scan execution
.ci/pipeline/release_matrix_job.yaml 5/5 Added Blackduck step with proper credential injection, container definition, and harbor URL update

Sequence Diagram

sequenceDiagram
    participant Jenkins
    participant ReleaseJob as Release Job
    participant RhelContainer as RHEL8.6 Container
    participant BduckContainer as Blackduck Container
    participant BlackduckServer as Blackduck Server
    participant GitRepo as Git Repo (DevOps/Tools/blackduck)

    Jenkins->>ReleaseJob: Trigger release with do_blackduck=true
    ReleaseJob->>Jenkins: Inject BLACKDUCK_API_TOKEN credential
    
    ReleaseJob->>RhelContainer: Build-dpcp step
    RhelContainer->>RhelContainer: Clone and build libdpcp
    
    ReleaseJob->>RhelContainer: Release step
    RhelContainer->>RhelContainer: Execute .ci/do_release.sh
    RhelContainer->>ReleaseJob: Archive RPM packages and logs
    
    alt do_blackduck is enabled
        ReleaseJob->>BduckContainer: Blackduck step (with credentials)
        BduckContainer->>BduckContainer: Validate BLACKDUCK_API_TOKEN
        BduckContainer->>BduckContainer: Create JSON config with jq
        BduckContainer->>GitRepo: git clone blackduck tools (SSH)
        GitRepo-->>BduckContainer: Blackduck scanning tools
        BduckContainer->>BduckContainer: Execute run_bd_scan.sh signature
        BduckContainer->>BlackduckServer: Upload scan results (with API token)
        BlackduckServer-->>BduckContainer: Scan report and PDF
        BduckContainer->>ReleaseJob: Archive logs and PDF report
    end
    
    ReleaseJob->>Jenkins: Send email notification
Loading

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

3 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@ntsemah
Copy link
Author

ntsemah commented Nov 12, 2025

@ntsemah
Copy link
Author

ntsemah commented Nov 12, 2025

bot:retest

dpressle
dpressle previously approved these changes Nov 13, 2025
@dpressle
Copy link
Collaborator

@galnoam the xlio-tools-ci is a mistake please ignore it

@dpressle dpressle requested a review from galnoam November 17, 2025 07:41
@ntsemah ntsemah force-pushed the HPCINFRA-3964 branch 2 times, most recently from 59f61c8 to b1624e2 Compare November 18, 2025 13:43
@greptile-apps
Copy link

greptile-apps bot commented Nov 18, 2025

Greptile encountered an error while reviewing this PR. Please reach out to [email protected] for assistance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants