Skip to content

Conversation

@wuhuizuo
Copy link
Collaborator

Add new configuration for TiCDC Jenkins operator with separate
authentication and base URL settings to support the TiCDC Jenkins
instance at https://prow.tidb.net/jenkins

Add new configuration for TiCDC Jenkins operator with separate
authentication and base URL settings to support the TiCDC Jenkins
instance at https://prow.tidb.net/jenkins
@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 establishes a new, independent Jenkins operator configuration tailored for TiCDC within the Prow system. The primary goal is to enable Prow to interact with a specific TiCDC Jenkins instance at https://prow.tidb.net/jenkins using its own set of authentication credentials and base URL. This separation enhances the management and isolation of TiCDC-related CI/CD operations, providing greater flexibility for the TiCDC project.

Highlights

  • New TiCDC Jenkins Operator Configuration: Introduced dedicated configuration for a TiCDC Jenkins operator, allowing it to connect to https://prow.tidb.net/jenkins with separate authentication.
  • Environment Variables Added: New environment variables (JENKINS_OPERATOR_AUTH_SEC_NAME_TICDC, JENKINS_OPERATOR_AUTH_SEC_KEY_USER_TICDC, JENKINS_OPERATOR_AUTH_SEC_KEY_TOKEN_TICDC, JENKINS_BASE_URL_TICDC) were added to apps/gcp/prow/release.yaml to support the TiCDC instance.
  • Dedicated Jenkins Operator Instance: A new Jenkins operator instance named dedicated-for-ticdc was configured in apps/gcp/prow/release/release.yaml, utilizing the newly defined TiCDC-specific authentication and URL settings.
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 10, 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 a dedicated Jenkins operator configuration for TiCDC by introducing new variables and a new operator instance. The changes are straightforward and follow the existing pattern. I've included one suggestion in apps/gcp/prow/release/release.yaml to improve maintainability by reducing configuration duplication using YAML anchors, which would make future updates easier.

Comment on lines +161 to +166
replicaCount: 1
autoscaling:
enabled: false
skipReport: true
dryRun: false
csrfProtect: false
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This configuration block is a duplicate of the one for the default instance (lines 149-154). This creates redundancy and can make maintenance more difficult.

To keep the configuration DRY (Don't Repeat Yourself), consider using a YAML anchor to define this common block once and reuse it for both instances. This would involve a small refactor of the existing default instance as well.

Example:

...
      jenkinsOperator:
        instances:
          - name: default
            <<: &commonConfig
              replicaCount: 1
              autoscaling:
                enabled: false
              skipReport: true
              dryRun: false
              csrfProtect: false
            ...
          - name: dedicated-for-ticdc
            <<: *commonConfig
            ...

Update prow-gcs-credentials.yaml from secrets.yaml Add
prow-jenkins-operator-auths.yaml with two ExternalSecret resources
Update JENKINS_OPERATOR_AUTH_SEC_NAME_TICDC reference in release.yaml
@ti-chi-bot ti-chi-bot bot added size/M and removed size/S labels Jan 11, 2026
@wuhuizuo wuhuizuo marked this pull request as ready for review January 11, 2026 13:25
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 adds a new dedicated Jenkins operator configuration for TiCDC in the GCP Prow setup. It introduces separate authentication secrets and distinct base URL settings, allowing integration with the TiCDC Jenkins instance at https://prow.tidb.net/jenkins. The approach is clean and mostly configuration-driven, adding new ExternalSecret manifests and environment variables without touching core logic. Overall, the changes are well-structured and consistent with existing patterns.


Critical Issues

  • Potential typo in secret naming consistency

    • Files:
      • apps/gcp/prow/release.yaml (lines ~31-40)
      • apps/gcp/prow/release/release.yaml (lines ~160-172)
    • Issue: The secret key and secret name environment variables use prow-jenkins-operator-ticdc-auth (in secrets manifest) but in release.yaml the env var is named JENKINS_OPERATOR_AUTH_SEC_NAME_TICDC with value prow-jenkins-operator-ticdc-auth — this is consistent. However, in release/release.yaml, the secretName field references ${JENKINS_OPERATOR_AUTH_SEC_NAME_TICDC}, which is correct. So no typo here. Just confirming consistency.
    • Conclusion: No critical issue found here.
  • Missing CSRF protection for TiCDC Jenkins operator

    • File: apps/gcp/prow/release/release.yaml line ~166
    • Issue: The TiCDC Jenkins operator config sets csrfProtect: false, whereas the default Jenkins operator config has no explicit csrfProtect setting (likely defaults to true). Disabling CSRF protection can expose security risks unless justified.
    • Suggestion: Confirm if disabling CSRF protection is intentional and safe for TiCDC Jenkins. If not, set csrfProtect: true or document the rationale clearly.

Code Improvements

  • Add comments to clarify purpose of TiCDC Jenkins operator config

    • Files:
      • apps/gcp/prow/release/release.yaml (new block starting ~line 160)
    • Issue: The new dedicated operator config lacks inline comments explaining why it differs from the default (e.g., different base URL, separate auth).
    • Suggestion: Add a brief comment above the TiCDC block, e.g.:
      # Dedicated Jenkins operator configuration for TiCDC Jenkins instance at prow.tidb.net
      # Uses separate authentication secrets and base URL to isolate TiCDC jobs.
  • Use consistent naming for secrets and env vars

    • The current names are consistent, but consider standardizing suffixes/prefixes for clarity, e.g., use ticdc vs ticdc-auth uniformly.
  • Refactor secret keys in external secrets to use explicit keys instead of dataFrom

    • File: apps/gcp/prow/pre/secrets/prow-jenkins-operator-auths.yaml
    • Issue: The ExternalSecrets use dataFrom with extract of a JSON key containing multiple keys (user, token, url). This approach bundles multiple keys into one secret, which can be harder to manage or audit individually.
    • Suggestion: Consider extracting each secret key explicitly, e.g.:
      data:
        - secretKey: user
          remoteRef:
            key: gcp_prow_jenkins_operator_ticdc_auth_json
            property: user
        - secretKey: token
          remoteRef:
            key: gcp_prow_jenkins_operator_ticdc_auth_json
            property: token
        - secretKey: url
          remoteRef:
            key: gcp_prow_jenkins_operator_ticdc_auth_json
            property: url
      This allows finer-grained control and clearer mapping. If dataFrom is required, then ensure it's well documented.

Best Practices

  • Add documentation or README updates

    • Files: none changed, but relevant to the overall repo
    • Issue: The PR adds a new Jenkins operator config requiring new secrets and environment variables but does not update any documentation or README to explain setup or usage.
    • Suggestion: Add or update documentation to explain:
      • Purpose of the TiCDC dedicated Jenkins operator
      • Required secrets and their keys
      • How to deploy and test this configuration
  • Test coverage

    • No test files or automated tests updated to cover the new Jenkins operator config.
    • Suggest adding e2e or integration tests that verify the operator starts correctly with the new TiCDC config and authenticates properly.
  • YAML style and formatting

    • The YAML files are mostly consistent; just ensure comments are aligned and indentation is uniform. For example, in prow-jenkins-operator-auths.yaml, add a blank line between the two ExternalSecret manifests for clarity.

Summary of actionable suggestions:

  • Review and validate CSRF protection setting for TiCDC Jenkins operator.
  • Add explanatory comments above the TiCDC operator config in release/release.yaml.
  • Consider explicit key extraction in ExternalSecret manifests rather than dataFrom.
  • Update documentation to cover the new Jenkins operator configuration and secret setup.
  • Add tests to verify the new Jenkins operator config works as expected.

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 adds a new dedicated Jenkins operator configuration for TiCDC within the Prow GCP app. It introduces separate authentication secrets and base URL settings to support the TiCDC Jenkins instance at prow.tidb.net. The approach includes extending existing Kubernetes manifests and secret management with ExternalSecrets, and updating deployment manifests to include the new operator config. Overall, the changes are clear and appropriately scoped, but some improvements around naming consistency, documentation, and validation could enhance maintainability and reduce the risk of misconfiguration.


Code Improvements

  • Inconsistent Secret Names in Comments and Env Vars
    File: apps/gcp/prow/release.yaml (lines around +30)
    Issue: The comment says the secret is named prow-jenkins-operator-auth-ticdc but the env var references prow-jenkins-operator-ticdc-auth. This inconsistency can confuse operators.
    Suggestion: Standardize on one naming convention, preferably matching the actual secret name (prow-jenkins-operator-ticdc-auth) in both comments and env vars.

  • Missing Validation of Required Secret Keys
    File: apps/gcp/prow/pre/secrets/prow-jenkins-operator-auths.yaml
    Issue: The ExternalSecrets expect JSON keys user, token, and url, but there is no validation or explicit schema to ensure these keys exist. This can cause runtime errors if secrets are misconfigured.
    Suggestion: Add validation steps or document required secret structure clearly. Consider adding template or property fields in ExternalSecret spec if supported, or add a README snippet describing the expected secret JSON structure.

  • Hardcoded Label Selector for the TiCDC Jenkins Operator
    File: apps/gcp/prow/release/release.yaml (around line +160)
    Issue: The label selector master=1 is hardcoded, which may be fragile if labels change or multiple operators are added.
    Suggestion: Consider making label selectors configurable via env vars or Helm values, or document the requirement clearly to avoid conflicts.

  • No Explicit Resource Requests or Limits for TiCDC Operator
    File: apps/gcp/prow/release/release.yaml (new operator config)
    Issue: The new dedicated TiCDC operator does not declare any resource requests or limits, which might lead to resource contention or instability.
    Suggestion: Add resource requests/limits similar to the main Jenkins operator or explicitly set them to avoid surprises in multi-tenant environments.


Best Practices

  • Add Documentation for New Jenkins Operator Configuration
    Files impacted: All new configs and manifest changes
    Issue: There is no documentation or README update explaining the purpose, usage, or deployment steps for the new TiCDC Jenkins operator config. This can cause onboarding friction or misconfiguration.
    Suggestion: Add a short markdown doc or extend existing docs describing:

    • The purpose of the TiCDC Jenkins operator
    • Required secrets and their structure
    • How to deploy and verify the operator
    • Differences compared to the main Jenkins operator config
  • Testing Coverage / Verification Steps Missing
    Issue: The PR does not mention any tests or validation steps to verify the new Jenkins operator config works as intended.
    Suggestion: Add or mention any unit/integration tests or manual verification steps performed to ensure the TiCDC Jenkins operator authenticates and functions correctly.

  • Naming Consistency and Style
    Files: env var names and secret names across multiple files
    Issue: The TiCDC-related variables mix underscores and hyphens, e.g. JENKINS_OPERATOR_AUTH_SEC_NAME_TICDC vs secret named prow-jenkins-operator-ticdc-auth.
    Suggestion: Prefer consistent naming conventions for environment variables and Kubernetes resource names for clarity, e.g., consistently use underscores in env vars and hyphens in K8s resources.


Minor Suggestions

  • Consider adding dryRun: true as a default or configurable option for the new operator during initial rollout/testing to reduce risk.
  • In prow-jenkins-operator-auths.yaml, add comments on how to update or rotate the secrets securely.
  • Rename the renamed secrets.yaml to a more descriptive name reflecting its content (if it’s only GCS credentials, prow-gcs-credentials.yaml is fine, but ensure consistency).

Summary: The PR effectively adds the TiCDC Jenkins operator configuration but would benefit significantly from improved documentation, consistent naming, validation of secret structures, and resource specification to ensure robust and maintainable deployment.

@wuhuizuo
Copy link
Collaborator Author

/approve

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Jan 11, 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 Jan 11, 2026
@ti-chi-bot ti-chi-bot bot merged commit cb087ab into main Jan 11, 2026
5 checks passed
@ti-chi-bot ti-chi-bot bot deleted the feature/another-prow-jenkins-operator branch January 11, 2026 13:38
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