feat: store coder_workspace_tags in the database (#13294)

This commit is contained in:
Marcin Tojek
2024-05-20 13:30:19 +00:00
committed by GitHub
parent 45b45f1107
commit b8b80fe6d2
30 changed files with 1052 additions and 397 deletions
+1
View File
@@ -501,6 +501,7 @@ const createTemplateVersionTar = async (
templateVariables: [],
error: "",
readme: new Uint8Array(),
workspaceTags: {},
...response.parse,
} as ParseComplete;
tar.addFile(
+27
View File
@@ -250,6 +250,12 @@ export interface ParseComplete {
error: string;
templateVariables: TemplateVariable[];
readme: Uint8Array;
workspaceTags: { [key: string]: string };
}
export interface ParseComplete_WorkspaceTagsEntry {
key: string;
value: string;
}
/** PlanRequest asks the provisioner to plan what resources & parameters it will create */
@@ -881,6 +887,27 @@ export const ParseComplete = {
if (message.readme.length !== 0) {
writer.uint32(26).bytes(message.readme);
}
Object.entries(message.workspaceTags).forEach(([key, value]) => {
ParseComplete_WorkspaceTagsEntry.encode(
{ key: key as any, value },
writer.uint32(34).fork(),
).ldelim();
});
return writer;
},
};
export const ParseComplete_WorkspaceTagsEntry = {
encode(
message: ParseComplete_WorkspaceTagsEntry,
writer: _m0.Writer = _m0.Writer.create(),
): _m0.Writer {
if (message.key !== "") {
writer.uint32(10).string(message.key);
}
if (message.value !== "") {
writer.uint32(18).string(message.value);
}
return writer;
},
};