chore!: send modules archive over the proto messages by Emyrk · Pull Request #21398 · coder/coder

@Emyrk Emyrk mentioned this pull request

Dec 29, 2025

@Emyrk Emyrk changed the base branch from stevenmasley/remove_exp to graphite-base/21398

January 7, 2026 14:49

@Emyrk Emyrk changed the base branch from graphite-base/21398 to 01-07-chore_update_protobuf_to_reuse_file_request

January 7, 2026 14:49

@Emyrk Emyrk mentioned this pull request

Jan 7, 2026

@Emyrk Emyrk marked this pull request as ready for review

January 8, 2026 19:39

johnstcn

@Emyrk Emyrk added the release/breaking

This label is applied to PRs to detect breaking changes as part of the release process

label

Jan 9, 2026

@Emyrk Emyrk changed the title chore: send modules archive over the proto messages chore!: send modules archive over the proto messages

Jan 9, 2026

johnstcn

johnstcn

Emyrk added a commit that referenced this pull request

Jan 9, 2026
Experiment is no longer required, the new method will be released without an experiment and without a toggle

Main PR is: #21398

@Emyrk Emyrk changed the base branch from 01-07-chore_update_protobuf_to_reuse_file_request to graphite-base/21398

January 9, 2026 17:14

Emyrk added a commit that referenced this pull request

Jan 9, 2026
**This is just the protobuf changes for the PR #21398

Moved `UploadFileRequest` from `provisionerd.proto` -> `provisioner.proto`.

Renamed to `FileUpload` because it is now bi-directional.

This **is backwards compatible**. I tested it to confirm the payloads are identical.  Types were just renamed and moved around.

```golang
func TestTypeUpgrade(t *testing.T) {
	t.Parallel()

	x := &proto2.UploadFileRequest{
		Type: &proto2.UploadFileRequest_ChunkPiece{
			ChunkPiece: &proto.ChunkPiece{
				Data:         []byte("Hello World!"),
				FullDataHash: []byte("Foobar"),
				PieceIndex:   42,
			},
		},
	}

	data, err := protobuf.Marshal(x)
	require.NoError(t, err)

	// Exactly the same output
	// EhgKDEhlbGxvIFdvcmxkIRIGRm9vYmFyGCo= on `main`
	// EhgKDEhlbGxvIFdvcmxkIRIGRm9vYmFyGCo= on this branch
	fmt.Println(base64.StdEncoding.EncodeToString(data))
}
```


# What this does

This allows provisioner daemons to download files from `coderd`'s `files` table. This is used to send over cached module files and prevent the need of downloading these modules on each workspace build.

@Emyrk Emyrk changed the base branch from graphite-base/21398 to main

January 9, 2026 17:23

@Emyrk

Serializing modules to disk prevents an external download

@Emyrk Emyrk deleted the stevenmasley/modules_over_the_wire branch

January 9, 2026 17:33