Skip to content

Conversation

@tenfyzhong
Copy link
Contributor

This pull request updates the skip_if_only_changed pattern for the pull-check job.

The updated pattern make_check_skip_if_only_changed specifically excludes common non-code file extensions and Dockerfiles, ensuring that the pull-check job will run when relevant code changes are made.

Changes include:

  • Defined a new skip pattern make_check_skip_if_only_changed that is more precise.
  • Applied this new pattern to the pull-check job.

The `pull-check` job should not be skipped if only Go files are changed.
The existing `skip_if_only_changed` definition was too broad and included Go files.

- Created a new `make_check_skip_if_only_changed` definition.
- Updated the `pull-check` job to use the new definition.

Signed-off-by: tenfyzhong <tenfy@tenfy.cn>
@ti-chi-bot
Copy link

ti-chi-bot bot commented Dec 11, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign purelind for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found 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

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @tenfyzhong, 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 refines the presubmit configuration for the pull-check job by introducing a more granular skip pattern. The primary goal is to prevent the make check step from running when changes are limited to non-code files like documentation or Dockerfiles, thereby streamlining the CI process and saving computational resources.

Highlights

  • New Skip Pattern Defined: A new global definition, make_check_skip_if_only_changed, has been introduced in the Prow job configuration. This pattern is designed to be more precise for specific checks.
  • Optimized pull-check Job: The pull-check presubmit job now utilizes the newly defined make_check_skip_if_only_changed pattern. This change ensures that the make check step is skipped when only documentation files (md, png, jpeg, jpg, gif, svg, pdf) or Dockerfiles, OWNERS, or OWNERS_ALIASES files are modified.
  • Improved CI Efficiency: By specifically excluding non-code changes from triggering the make check process, this update aims to reduce unnecessary CI run times and improve the efficiency of the presubmit checks.
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.

Copy link

@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 refines the skip_if_only_changed pattern used by the pull-check presubmit job by introducing a new pattern make_check_skip_if_only_changed. The new pattern excludes markdown and common image file extensions, Dockerfiles, and owner files, aiming to skip the make check step when only documentation or Dockerfiles are changed. The change is straightforward and improves the accuracy of skipping unnecessary jobs, which can save CI resources. The code change is minimal and clean.


Code Improvements

  • Regex consistency and correctness

    • File: prow-jobs/pingcap/ticdc/latest-presubmits.yaml, lines 6-7
    • The original skip_if_only_changed pattern includes .yaml and .json, but the new make_check_skip_if_only_changed pattern excludes these extensions. If this is intentional (i.e., .yaml and .json changes should cause the job to run), this should be explicitly documented in a comment to avoid confusion. Otherwise, it may cause unexpected skipping of checks on .yaml or .json changes which might affect configuration files.
    • Suggestion: Add a comment above the new pattern explaining why .yaml and .json are excluded, or reconsider including them if they are relevant to code correctness.
    # Skips make check if only documentation, images, Dockerfiles, or owner files changed.
    # Note: YAML and JSON files are excluded here to ensure make check runs on config changes.
    make_check_skip_if_only_changed: &make_check_skip_if_only_changed "(\\.(md|png|jpeg|jpg|gif|svg|pdf)|Dockerfile|OWNERS|OWNERS_ALIASES)$"
  • Regex pattern formatting

    • The regex pattern is quoted but uses double backslashes \\. which is correct for YAML string escaping, but it’s a bit hard to read. Consider using single quotes to reduce escaping or add a comment explaining the regex, improving maintainability.

Best Practices

  • Documentation

    • File: prow-jobs/pingcap/ticdc/latest-presubmits.yaml, lines 5-7
    • Currently, there is no explanation in the YAML about the purpose of make_check_skip_if_only_changed or its difference from the existing skip_if_only_changed. Adding a short comment describing the intent and scope of each pattern would help future maintainers.
  • Testing coverage

    • The PR does not mention any tests or validation of the new skip pattern. It would be beneficial to add or verify existing tests that ensure the presubmit job is correctly skipped or triggered based on different file changes, especially for Dockerfile and documentation files.

Summary of Suggestions

# Define skip patterns for presubmit jobs
# `skip_if_only_changed` skips jobs if only docs, images, configs, or owner files changed
skip_if_only_changed: &skip_if_only_changed "(\\.(md|png|jpeg|jpg|gif|svg|pdf|yaml|json)|Dockerfile|OWNERS|OWNERS_ALIASES)$"

# `make_check_skip_if_only_changed` is more restrictive, skipping make check on docs, images, Dockerfiles, and owner files only.
# YAML and JSON files are excluded here to ensure make check runs on config changes.
make_check_skip_if_only_changed: &make_check_skip_if_only_changed "(\\.(md|png|jpeg|jpg|gif|svg|pdf)|Dockerfile|OWNERS|OWNERS_ALIASES)$"
  • Add or verify CI tests that validate the skipping behavior based on file changes.
  • Clarify the intent of each pattern with comments for maintainability.

No critical issues identified; the change is minimal and clear. Adding documentation and test validation will make this improvement more robust.

@tenfyzhong tenfyzhong changed the title Update presubmit job to skip make check on documentation and Dockerfile changes TiCDC: Update presubmit job to skip make check on documentation and Dockerfile changes Dec 11, 2025
@ti-chi-bot ti-chi-bot bot added the size/XS label Dec 11, 2025
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 correctly updates the pull-check job to run when configuration files like .yaml or .json are changed, which improves CI coverage. The change is implemented by introducing a new, more specific skip_if_only_changed pattern. My review includes a suggestion to apply this logic consistently across other relevant Prow job configuration files to ensure uniform behavior.

- ^release-8\.5$
- ^feature/.+
skip_if_only_changed: &skip_if_only_changed "(\\.(md|png|jpeg|jpg|gif|svg|pdf|yaml|json)|Dockerfile|OWNERS|OWNERS_ALIASES)$"
make_check_skip_if_only_changed: &make_check_skip_if_only_changed "(\\.(md|png|jpeg|jpg|gif|svg|pdf)|Dockerfile|OWNERS|OWNERS_ALIASES)$"
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For consistency, this change should also be applied to other presubmit configurations. The file prow-jobs/pingcap/ticdc/release-9.0-beta-presubmits.yaml also contains a pull-check job that uses the broader skip pattern. Consider adding this new anchor to that file and updating its pull-check job to use it, ensuring consistent CI behavior across branches.

- name: pull-check
decorate: true # need add this.
skip_if_only_changed: *skip_if_only_changed
skip_if_only_changed: *make_check_skip_if_only_changed
Copy link
Contributor

Choose a reason for hiding this comment

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

if there is only one place use this pattern, put the value directly here rather than use yaml anchor.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can merge this PR after the skip_if_only_changed rule works for other pipelines.

@tenfyzhong tenfyzhong marked this pull request as draft December 12, 2025 13:28
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