Skip to content

chore: update protobuf to reuse file request#21447

Merged
Emyrk merged 1 commit intomainfrom
01-07-chore_update_protobuf_to_reuse_file_request
Jan 9, 2026
Merged

chore: update protobuf to reuse file request#21447
Emyrk merged 1 commit intomainfrom
01-07-chore_update_protobuf_to_reuse_file_request

Conversation

@Emyrk
Copy link
Member

@Emyrk Emyrk commented Jan 7, 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.

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.

Copy link
Member Author

Emyrk commented Jan 7, 2026

Comment on lines -162 to -166
message UploadFileRequest {
oneof type {
provisioner.DataUpload data_upload = 1;
provisioner.ChunkPiece chunk_piece = 2;
}
Copy link
Member Author

Choose a reason for hiding this comment

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

This was moved to provisioner.proto

@Emyrk Emyrk force-pushed the stevenmasley/remove_exp branch from 408096b to 5d02ba2 Compare January 7, 2026 14:51
@Emyrk Emyrk force-pushed the 01-07-chore_update_protobuf_to_reuse_file_request branch 9 times, most recently from 259ab00 to 19a5a3b Compare January 8, 2026 18:07
@Emyrk Emyrk force-pushed the stevenmasley/remove_exp branch 2 times, most recently from a91dd17 to 482752b Compare January 8, 2026 18:11
@Emyrk Emyrk force-pushed the 01-07-chore_update_protobuf_to_reuse_file_request branch 2 times, most recently from c2c8425 to 5b0df75 Compare January 8, 2026 19:17
@Emyrk Emyrk force-pushed the stevenmasley/remove_exp branch 2 times, most recently from 81867ee to 4ad4e85 Compare January 8, 2026 19:33
@Emyrk Emyrk force-pushed the 01-07-chore_update_protobuf_to_reuse_file_request branch from 5b0df75 to ecf4457 Compare January 8, 2026 19:33
@Emyrk Emyrk marked this pull request as ready for review January 8, 2026 19:39
@Emyrk Emyrk removed the request for review from spikecurtis January 8, 2026 19:40
@Emyrk Emyrk force-pushed the 01-07-chore_update_protobuf_to_reuse_file_request branch from ecf4457 to 9f5aab4 Compare January 9, 2026 14:23
Copy link
Member Author

Emyrk commented Jan 9, 2026

Merge activity

  • Jan 9, 5:12 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jan 9, 5:15 PM UTC: Graphite rebased this pull request as part of a merge.
  • Jan 9, 5:23 PM UTC: @Emyrk merged this pull request with Graphite.

@Emyrk Emyrk changed the base branch from stevenmasley/remove_exp to graphite-base/21447 January 9, 2026 17:13
@Emyrk Emyrk changed the base branch from graphite-base/21447 to main January 9, 2026 17:13
@Emyrk Emyrk force-pushed the 01-07-chore_update_protobuf_to_reuse_file_request branch from 9f5aab4 to 684f734 Compare January 9, 2026 17:14
@Emyrk Emyrk merged commit d2044c2 into main Jan 9, 2026
32 of 34 checks passed
@Emyrk Emyrk deleted the 01-07-chore_update_protobuf_to_reuse_file_request branch January 9, 2026 17:23
@github-actions github-actions bot locked and limited conversation to collaborators Jan 9, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants