Skip to content

feat(libraries): implement Jenkins run matrix caching#4583

Open
ti-chi-bot wants to merge 8 commits into
mainfrom
feature/matrix-cache
Open

feat(libraries): implement Jenkins run matrix caching#4583
ti-chi-bot wants to merge 8 commits into
mainfrom
feature/matrix-cache

Conversation

@ti-chi-bot
Copy link
Copy Markdown
Collaborator

  • feat(libraries): add matrixCache library for parallel stage caching
  • ci(libraries): remove gitee.groovy library function

@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot Bot commented May 12, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a matrix caching mechanism in Jenkins to skip redundant stage executions by generating unique keys based on build context. Feedback focuses on improving the stability and reliability of this cache. Specifically, the logic for identifying matrix axis variables needs a stricter blacklist to avoid unstable keys, and the synchronization mechanism must be upgraded to handle concurrent builds across the Jenkins controller. Additionally, it is recommended to specify UTF-8 encoding for hash generation and implement atomic file writes to prevent data corruption.

Comment thread libraries/tipipeline/vars/matrixCache.groovy Outdated
Comment thread libraries/tipipeline/vars/matrixCache.groovy Outdated
def rawKey = "${org}/${repo}/${baseSha}/${pullShas}/${stageName}/${matrixContext}/${extras}"

// Use MD5 to compress the key length, preventing overly long filenames or JSON keys.
return MessageDigest.getInstance("MD5").digest(rawKey.getBytes()).encodeHex().toString()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

rawKey.getBytes() uses the platform's default character encoding. To ensure the MD5 hash is consistent across different Jenkins controllers or environments, it is safer to explicitly specify UTF-8.

    return MessageDigest.getInstance("MD5").digest(rawKey.getBytes("UTF-8")).encodeHex().toString()

Comment thread libraries/tipipeline/vars/matrixCache.groovy Outdated
@ti-chi-bot ti-chi-bot Bot added size/XXL and removed size/L labels May 12, 2026
Stop auto-injecting matrix env into cache keys so callers can control key sensitivity through optional parameters, and add presubmit/debug coverage to validate the behavior.
@wuhuizuo wuhuizuo marked this pull request as ready for review May 14, 2026 08:38
@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot Bot commented May 14, 2026

@ti-chi-bot: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-replay-jenkins-pipelines 04334a2 link false /test pull-replay-jenkins-pipelines

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@wuhuizuo
Copy link
Copy Markdown
Contributor

/approve

@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot Bot commented May 15, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: wuhuizuo

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot Bot added the approved label May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants