Skip to content

chore: Migrate Skaffold presubmits to new Kokoro instance#9952

Open
menahyouyeah wants to merge 18 commits intomainfrom
presubmit
Open

chore: Migrate Skaffold presubmits to new Kokoro instance#9952
menahyouyeah wants to merge 18 commits intomainfrom
presubmit

Conversation

@menahyouyeah
Copy link
Contributor

Description
This PR updates the Skaffold build and test infrastructure to run presubmit checks on the new dedicated Kokoro instance (skaffold-presubmit) and GCP project (skaffold-ci-cd).

Key changes:

  • Updates Makefile to conditionally use Artifact Registry in skaffold-ci-cd for presubmits, while retaining GCR for CI/Release in k8s-skaffold.

CI and Release processes remain on the existing infrastructure for now.

@menahyouyeah menahyouyeah requested a review from a team as a code owner January 16, 2026 21:34
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @menahyouyeah, 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 orchestrates a significant infrastructure update for Skaffold's presubmit checks. The core objective is to transition these checks to a new, dedicated Kokoro environment and GCP project, leveraging Google Artifact Registry for image storage. This change enhances the build and test pipeline's scalability and organization by separating presubmit workflows from the main CI/Release infrastructure, ensuring that development iterations benefit from the new setup without disrupting existing production pipelines.

Highlights

  • Migration to New Kokoro Instance: Skaffold presubmit checks are now configured to run on a new, dedicated Kokoro instance (skaffold-presubmit) and a new GCP project (skaffold-ci-cd).
  • Conditional Artifact Registry Usage: The Makefile has been updated to conditionally use Google Artifact Registry (AR) for presubmit builds within the skaffold-ci-cd project, while retaining Google Container Registry (GCR) for existing CI/Release processes in the k8s-skaffold project.
  • Dynamic Image Repository Configuration: Introduced dynamic setting of IMAGE_REPO_BASE, GCLOUD_AUTH_CONFIG, and GKE_LOCATION_FLAG in the Makefile, allowing the build system to adapt to either GCR or Artifact Registry based on the active GCP project.
  • Updated Docker Commands and Environment Variables: All relevant docker build and docker push commands, as well as integration test invocations, have been modified to leverage the new IMAGE_REPO_BASE variable and pass necessary environment variables (GCP_PROJECT, AR_REGION, GKE_REGION, GKE_ZONE) for proper configuration.
  • Presubmit Script Update: The hack/kokoro/presubmit.sh script now explicitly sets DOCKER_NAMESPACE to the Artifact Registry path for presubmit builds, ensuring images are pushed to the correct new registry.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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
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 migrates the Skaffold presubmits to a new Kokoro instance and GCP project, introducing conditional logic in the Makefile to switch between GCR and Artifact Registry based on the GCP_PROJECT variable. The changes are logical and follow the PR's goal.

However, I've found a few critical issues that would cause the build to fail or behave incorrectly:

  • The Makefile has a logic error where a variable (DEPS_DIGEST) is used without being defined in the skaffold-builder-ci target.
  • Another docker build command is broken due to a missing line continuation character and inconsistent indentation.
  • The presubmit script (hack/kokoro/presubmit.sh) is missing required environment variables to trigger the new build logic in the Makefile.

I've also included a high-severity suggestion to make the Makefile more robust by adding checks for required variables, and a medium-severity comment for a typo. Please address these issues to ensure the new presubmit pipeline works as expected.

-t gcr.io/$(GCP_PROJECT)/skaffold:$(VERSION) \
-t gcr.io/$(GCP_PROJECT)/skaffold:latest \
-t $(IMAGE_REPO_BASE)/skaffold:$(VERSION) \
-t $(IMAGE_REPO_BASE)/skaffold:latest \
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

This line has two issues:

  1. It uses spaces for indentation, while the surrounding lines and Makefile conventions use tabs. This is inconsistent.
  2. It is missing a trailing \ to continue the docker build command on the next line. This will cause the build to fail.

Please fix the indentation and add the line continuation character.

		-t $(IMAGE_REPO_BASE)/skaffold:latest \

docker push $(IMAGE_REPO_BASE)/build_deps:$(DEPS_DIGEST)


skaffold-builder-ci:
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 skaffold-builder-ci target uses the DEPS_DIGEST variable in a --cache-from flag, but DEPS_DIGEST is not defined within this target's scope. This will result in DEPS_DIGEST being empty, causing the cache to be missed or pointing to an incorrect image tag. You should define DEPS_DIGEST within the skaffold-builder-ci target.

skaffold-builder-ci:
	$(eval DEPS_DIGEST := $(shell ./hack/skaffold-deps-sha1.sh))


# hanges the current directory to where Kokoro has checked out the GitHub repository.
pushd $KOKORO_ARTIFACTS_DIR/github/skaffold >/dev/null
GCP_ONLY=true make integration-in-docker
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

This make command is missing essential environment variables (GCP_PROJECT, AR_REGION, GKE_REGION) required to trigger the new presubmit logic in the Makefile.

  • GCP_PROJECT will default to k8s-skaffold, and the skaffold-ci-cd specific logic will not be used.
  • AR_REGION and GKE_REGION will be unset, causing errors or incorrect behavior in the Makefile.

Please provide these variables to the make command to ensure the new presubmit infrastructure is used.

Suggested change
GCP_ONLY=true make integration-in-docker
GCP_ONLY=true GCP_PROJECT=skaffold-ci-cd AR_REGION=us-central1 GKE_REGION=us-central1 make integration-in-docker

Comment on lines +38 to +40
ifeq ($(GCP_PROJECT),skaffold-ci-cd)
# Presubmit environment: skaffold-ci-cd project with Artifact Registry
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The new logic for GCP_PROJECT=skaffold-ci-cd relies on AR_REGION and GKE_REGION variables. However, these variables are not defined with default values, nor are there any checks to ensure they are set. If they are not provided in the environment, they will be empty, leading to malformed values for IMAGE_REPO_BASE and GKE_LOCATION_FLAG, which can cause silent failures or hard-to-debug issues. It's safer to add checks to ensure these required variables are set.

ifeq ($(GCP_PROJECT),skaffold-ci-cd)
  ifndef AR_REGION
    $(error AR_REGION must be set when GCP_PROJECT is skaffold-ci-cd)
  endif
  ifndef GKE_REGION
    $(error GKE_REGION must be set when GCP_PROJECT is skaffold-ci-cd)
  endif
  # Presubmit environment: skaffold-ci-cd project with Artifact Registry

# Any docker push commands will push images here
export DOCKER_NAMESPACE=us-central1-docker.pkg.dev/skaffold-ci-cd/skaffold-images

# hanges the current directory to where Kokoro has checked out the GitHub repository.
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 comment. "hanges" should be "Changes".

Suggested change
# hanges the current directory to where Kokoro has checked out the GitHub repository.
# Changes the current directory to where Kokoro has checked out the GitHub repository.

@menahyouyeah menahyouyeah added the kokoro:force-run forces a kokoro re-run on a PR label Jan 22, 2026
@kokoro-team kokoro-team removed the kokoro:force-run forces a kokoro re-run on a PR label Jan 22, 2026
@menahyouyeah menahyouyeah added kokoro:force-run forces a kokoro re-run on a PR and removed kokoro:force-run forces a kokoro re-run on a PR labels Jan 22, 2026
@kokoro-team kokoro-team removed the kokoro:force-run forces a kokoro re-run on a PR label Jan 22, 2026
@menahyouyeah menahyouyeah added the kokoro:force-run forces a kokoro re-run on a PR label Jan 23, 2026
@kokoro-team kokoro-team removed the kokoro:force-run forces a kokoro re-run on a PR label Jan 23, 2026
@menahyouyeah menahyouyeah added the kokoro:force-run forces a kokoro re-run on a PR label Jan 26, 2026
@kokoro-team kokoro-team removed the kokoro:force-run forces a kokoro re-run on a PR label Jan 26, 2026
@menahyouyeah menahyouyeah added the kokoro:force-run forces a kokoro re-run on a PR label Jan 26, 2026
@kokoro-team kokoro-team removed the kokoro:force-run forces a kokoro re-run on a PR label Jan 26, 2026
@menahyouyeah menahyouyeah added the kokoro:force-run forces a kokoro re-run on a PR label Jan 26, 2026
@kokoro-team kokoro-team removed the kokoro:force-run forces a kokoro re-run on a PR label Jan 26, 2026
@menahyouyeah menahyouyeah added the kokoro:force-run forces a kokoro re-run on a PR label Jan 26, 2026
@kokoro-team kokoro-team removed the kokoro:force-run forces a kokoro re-run on a PR label Jan 26, 2026
@menahyouyeah menahyouyeah added the kokoro:force-run forces a kokoro re-run on a PR label Jan 27, 2026
@kokoro-team kokoro-team removed the kokoro:force-run forces a kokoro re-run on a PR label Jan 27, 2026
@menahyouyeah menahyouyeah added the kokoro:force-run forces a kokoro re-run on a PR label Jan 27, 2026
@kokoro-team kokoro-team removed the kokoro:force-run forces a kokoro re-run on a PR label Jan 27, 2026
@menahyouyeah menahyouyeah added the kokoro:force-run forces a kokoro re-run on a PR label Jan 27, 2026
@kokoro-team kokoro-team removed the kokoro:force-run forces a kokoro re-run on a PR label Jan 27, 2026
@menahyouyeah menahyouyeah added the kokoro:force-run forces a kokoro re-run on a PR label Jan 28, 2026
@kokoro-team kokoro-team removed the kokoro:force-run forces a kokoro re-run on a PR label Jan 28, 2026
@menahyouyeah menahyouyeah added the kokoro:force-run forces a kokoro re-run on a PR label Jan 28, 2026
@kokoro-team kokoro-team removed the kokoro:force-run forces a kokoro re-run on a PR label Jan 28, 2026
@pull-request-size pull-request-size bot added size/L and removed size/M labels Jan 28, 2026
@menahyouyeah menahyouyeah added the kokoro:force-run forces a kokoro re-run on a PR label Feb 4, 2026
@kokoro-team kokoro-team removed the kokoro:force-run forces a kokoro re-run on a PR label Feb 4, 2026
@menahyouyeah menahyouyeah added the kokoro:force-run forces a kokoro re-run on a PR label Feb 5, 2026
@kokoro-team kokoro-team removed the kokoro:force-run forces a kokoro re-run on a PR label Feb 5, 2026
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