Skip to content

Conversation

@wuhuizuo
Copy link
Collaborator

Add secret for TiDB-X OCI artifact authentication to beta pre
environment via ExternalSecret resource

credentials

Add secret for TiDB-X OCI artifact authentication to beta pre
environment via ExternalSecret resource
@ti-chi-bot ti-chi-bot bot added area/apps env/GCP will deploy on GCP cluster labels Jan 13, 2026
@wuhuizuo
Copy link
Collaborator Author

/approve

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @wuhuizuo, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the Jenkins environment on GCP by adding a new ExternalSecret resource. This secret facilitates secure authentication for TiDB-X OCI artifacts, ensuring that Jenkins can properly access and utilize these artifacts within the beta/pre environment. The change streamlines credential management by integrating with an external secret store.

Highlights

  • New Secret Configuration: A new ExternalSecret resource named tidbx-docker-config has been introduced to manage authentication for TiDB-X OCI artifacts.
  • Jenkins Integration: This secret is specifically configured for Jenkins, allowing it to securely access TiDB-X OCI artifacts by providing a docker.config file credential.
  • Environment Scope: The new secret is deployed within the beta/pre environment of the GCP Jenkins setup.
  • Kustomization Update: The kustomization.yaml file for the beta/pre environment has been updated to include the newly defined secret-tidbx-docker-config.yaml.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@ti-chi-bot ti-chi-bot bot added the size/S label Jan 13, 2026
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Jan 13, 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

Copy link
Contributor

@ti-chi-bot ti-chi-bot bot left a comment

Choose a reason for hiding this comment

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

I have already done a preliminary review for you, and I hope to help you do a better job.

Summary
This PR introduces a new ExternalSecret resource named tidbx-docker-config in the Jenkins beta pre environment to manage TiDB-X OCI artifact authentication credentials. It adds the secret manifest and references it in the relevant kustomization.yaml. The approach follows existing patterns and is straightforward. Overall, the changes appear correct and consistent with the existing setup, but there are a few minor improvements and clarifications needed.


Code Improvements

  • Typo in annotation value

    • File: apps/gcp/jenkins/beta/pre/secret-tidbx-docker-config.yaml (line 15)
    • Issue: The annotation value has a typo: "docker auth credintial for TiDB-X OCI artifacts" (credintialcredential).
    • Suggestion: Correct the spelling to improve clarity and professionalism:
      jenkins.io/credentials-description: docker auth credential for TiDB-X OCI artifacts
  • Potential mismatch in filename convention

    • File: apps/gcp/jenkins/beta/pre/secret-tidbx-docker-config.yaml (line 18)
    • Issue: The filename is set as docker.config, a less common name compared to the standard config.json for Docker credentials files. This might cause confusion or integration issues if Jenkins expects the standard name.
    • Suggestion: Verify that the Jenkins credential provider expects docker.config. If not, rename it to config.json for compatibility, e.g.:
      filename: config.json
  • Clarify the secretKey and remoteRef usage

    • File: apps/gcp/jenkins/beta/pre/secret-tidbx-docker-config.yaml (lines 23-26)
    • Issue: The key gcp_tidbx_dockerconfig_json is referenced without context here; ensure this matches the key in the secret manager exactly.
    • Suggestion: Confirm that the secret key gcp_tidbx_dockerconfig_json exists with proper data, and consider adding a comment to clarify this linkage for future maintainers.

Best Practices

  • Add comments describing the purpose of this secret

    • File: apps/gcp/jenkins/beta/pre/secret-tidbx-docker-config.yaml (top of file)
    • Issue: There is no inline documentation explaining what this secret is for, which would help future readers.
    • Suggestion: Add a short comment describing the purpose and usage context, e.g.:
      # ExternalSecret for TiDB-X Docker authentication credentials stored in GCP Secret Manager
  • Testing and validation

    • Issue: The PR description does not mention if this secret has been tested in Jenkins for proper credential injection and artifact access.
    • Suggestion:
      • Validate that Jenkins can consume this ExternalSecret as expected.
      • Add or update any relevant integration or e2e tests to cover this secret's usage if applicable.
  • Consistency in resource naming

    • File: apps/gcp/jenkins/beta/pre/kustomization.yaml (line 11)
    • Issue: The new secret resource is named secret-tidbx-docker-config.yaml following the existing naming pattern, which is good. Just ensure this pattern is consistently applied in all environments where needed.

Minor style suggestions

  • Align indentation under metadata.annotations and metadata.labels for visual clarity (optional, YAML parsers are fine, but improves readability).
  • Consider sorting keys alphabetically within sections like metadata and spec for consistency.

Overall, this PR is a well-structured addition of a new external secret resource for Jenkins credentials. Addressing the minor typo and clarifying the Docker config filename will improve maintainability and reduce potential confusion. Adding comments and confirming testing will strengthen the change's robustness.

@ti-chi-bot ti-chi-bot bot added the approved label Jan 13, 2026
Copy link
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 adds an ExternalSecret to provide TiDB-X OCI artifact authentication credentials to Jenkins. The implementation has a critical issue in how the Kubernetes secret is templated, which will prevent Jenkins from using it. There is also a minor typo in an annotation. I've provided suggestions to fix these issues.

Comment on lines +19 to +21
data:
filename: docker.config
data: "{{ .data }}"
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

The structure of spec.target.template.data is incorrect for creating a Kubernetes secret that Jenkins can use as a secretFile credential. The data field of a Kubernetes secret is a map of string: string, where the key is the filename and the value is the base64-encoded content. The current structure defines keys named filename and data within the secret's data, which is not the correct format.

To fix this, the data section should directly use the desired filename as the key.

      data:
        docker.config: "{{ .data }}"

type: Opaque
metadata:
annotations:
jenkins.io/credentials-description: docker auth credintial for TiDB-X OCI artifacts
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

There is a typo in the jenkins.io/credentials-description annotation. "credintial" should be "credential".

          jenkins.io/credentials-description: docker auth credential for TiDB-X OCI artifacts

@ti-chi-bot ti-chi-bot bot merged commit 6367da1 into main Jan 13, 2026
5 checks passed
@ti-chi-bot ti-chi-bot bot deleted the chore/add-jenkins-credential-secrets branch January 13, 2026 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants