Skip to content

Add option to run CI with a different submodule commit to test upstream CLs #790

Closed

Description

@dagood

Sometimes it would be useful to run PR CI (or CI from the main branch) but with a different commit in the submodule. Currently, the way to do this is to create a dev branch and update the submodule or add a patch file. This takes medium effort: naming the branch, navigating around the repo to make the change, making a commit, pushing it to the right remote, and finally triggering the build.

Instead, I think we could pretty reasonably add a parameter to the CI trigger that lets you optionally specify a submodule commit, and if specified, the build would run a step after cloning the repo to change the submodule to a new commit. This means:

  • If we want to make sure a CL doesn't break microsoft/main (even a CL we submit ourselves), we could run CI on microsoft/main that points at that CL's commit without any manual Git work.
  • If we have a broken sync PR, and want to confirm that a CL fixes the PR validation build, I believe we could run a build that points at our GitHub ref for the outer repo and the CL commit for the submodule.

Similar to GitHub, Gerrit adds CL commits to the repo, so Git remotes/sources shouldn't be an issue. But we could also add a parameter (in public builds) to configure the source repo for the submodule, so we can also validate changes that aren't even in a CL yet. We could use a GitHub URL, for example. You can find the Gerrit CL refs here:

image

This also shows them: git ls-remote https://go.googlesource.com/go | grep <cl-number>

Note that in all of these cases, the patch files are still being applied. We could consider a toggle to disable patching, if we want to validate a change in our infra (machine pool) but don't want to resolve any patch conflicts caused by that change yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions