Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reduce /gcbrun skip time #833

Open
DavidKorczynski opened this issue Mar 3, 2025 · 1 comment
Open

reduce /gcbrun skip time #833

DavidKorczynski opened this issue Mar 3, 2025 · 1 comment
Assignees

Comments

@DavidKorczynski
Copy link
Collaborator

When we dont need a trial run for a PR we use /gcbrun skip. However, there is still a lot of processing time for this workflow. We should reduce this.

@DavidKorczynski DavidKorczynski self-assigned this Mar 3, 2025
@KKSurendran06
Copy link

Hi @DavidKorczynski

I looked into this issue and noticed that /gcbrun skip does not currently prevent all processing. Specifically:

There are no checks for /gcbrun skip in pypresubmit.yaml or in the helper/ scripts (presubmit and py_presubmit.py).

To address this, I’m considering two possible fixes:

  1. Modify pypresubmit.yaml to completely skip the job if /gcbrun skip is in the PR body:
    if: "!contains(github.event.pull_request.body, '/gcbrun skip')"

2)Modify py_presubmit.py to exit early if /gcbrun skip is detected in the PR message:

pr_message = subprocess.check_output(['git', 'log', '-1', '--pretty=%B']).decode()
if "/gcbrun skip" in pr_message:
    print("Skipping Python presubmit checks due to /gcbrun skip")
    return 0 

Would this be the correct approach? Or should only specific parts of the process be skipped rather than the entire presubmit check?

I’d love to contribute a PR for this, any guidance would be greatly appreciated

Thanks!

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

No branches or pull requests

2 participants