Skip to content

Commit bedafa2

Browse files
qmuntaldagood
andauthored
Apply batched suggestions from code review
Co-authored-by: Davis Goodin <dagood@users.noreply.github.com>
1 parent 38e78d2 commit bedafa2

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

‎eng/_util/cmd/submodule-refresh/submodule-refresh.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ var (
3030
skipPatch = flag.Bool("skip-patch", false, "Skip applying patches.")
3131
take = flag.Int("take", -1, "Only apply the first N patches. -1 means apply all.")
3232
origin = flag.String("origin", "", "Use this origin instead of the default defined in '.gitmodules' to fetch the repository.")
33-
ref = flag.String("ref", "", "Fetch this commit or ref instead of the recorded submodule commit, and stage it in the outer repository for subsequent refreshes.")
33+
ref = flag.String("ref", "", "Fetch this commit or ref instead of the recorded submodule commit, and stage it in the outer repository so subsequent refreshes use it rather than restoring the original commit, desirable in some CI scenarios.")
3434
shallow = flag.Bool("shallow", false, "Clone the submodule with depth 1.")
3535
fetchBearerToken = flag.String("fetch-bearer-token", "", "Use this bearer token to fetch the submodule repository.")
3636
)

‎eng/doc/DeveloperGuide.md‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,18 +121,16 @@ go test -short ./...
121121

122122
Manually run a [PR or rolling pipeline](../pipeline/README.md) using **Run pipeline** in Azure DevOps.
123123
Select the outer repository branch (or ref under **Branch/tag**) to test, then set `submoduleRef` to an upstream commit SHA or Gerrit ref, such as `refs/changes/34/123434/2`.
124+
It's fine to select someone else's branch and submodule ref.
124125
Leave it as `nil` to use the recorded submodule commit.
125126
The override applies to both innerloop and outerloop pipelines.
126127

127128
Overrides are fetched anonymously from `https://go.googlesource.com/go`.
128129
Public PR pipelines also accept `submoduleRepository`, for example an HTTPS GitHub fork URL, to test a commit that has not been uploaded to Gerrit.
129130
This parameter is only used when `submoduleRef` is set; internal rolling pipelines always fetch overrides from the public Go repository, without the internal mirror credentials.
130131

131-
The pipeline stages the selected `go` submodule commit in the outer repository's index.
132-
`git submodule update` uses that index entry, so staging preserves the override when later `submodule-refresh` calls reset the submodule and apply the Microsoft patches.
133-
Patches are still applied, and patch conflicts fail the build as usual.
134-
Fresh-agent test retries use the same resolved commit as the original build, even if the ref has advanced.
135-
No branch or commit needs to be created or pushed for this override.
132+
Patches are applied onto the requested commit, and patch conflicts fail the build as usual.
133+
Fresh-agent test retries use the same resolved commit as the first attempt, even if the ref has advanced e.g. on Gerrit.
136134

137135
To use an override locally, see the [`submodule-refresh` options](../README.md#patch-files).
138136

0 commit comments

Comments
 (0)