Skip to content

Commit 062f2b3

Browse files
alias struct fields
1 parent 6856e59 commit 062f2b3

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

backend/graph-proxy/src/graphql/workflow_templates.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,12 @@ enum WorkflowTemplateParsingError {
3838
MalformParameterSchema(#[from] serde_json::Error),
3939
}
4040

41-
#[derive(Debug, Serialize, Deserialize, Default, Clone, SimpleObject, Eq, PartialEq)]
41+
#[derive(Debug, Serialize, Deserialize, Default, Clone, SimpleObject, Eq, PartialEq)]
4242
struct GitHubPath {
4343
path: String,
44+
#[serde(rename = "repoURL")]
4445
repo_url: String,
46+
#[serde(rename = "targetRevision")]
4547
target_revision: String,
4648
}
4749

@@ -115,7 +117,6 @@ impl WorkflowTemplate {
115117
}
116118

117119
async fn template_url(&self) -> Result<GitHubPath, WorkflowTemplateParsingError> {
118-
119120
let instance = match self.metadata.labels.get("argocd.argoproj.io/instance") {
120121
Some(val) => val,
121122
None => return Err(WorkflowTemplateParsingError::MissingInstanceLabel),
@@ -141,9 +142,13 @@ impl WorkflowTemplate {
141142
let source: GitHubPath = match last_config_val.get("spec") {
142143
Some(val) => match val.get("source") {
143144
Some(src) => serde_json::from_value(src.clone()).unwrap(),
144-
None => GitHubPath {..Default::default()}
145-
}
146-
None => GitHubPath {..Default::default()}
145+
None => GitHubPath {
146+
..Default::default()
147+
},
148+
},
149+
None => GitHubPath {
150+
..Default::default()
151+
},
147152
};
148153

149154
Ok(source)

charts/graph-proxy/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ image:
22
registry: ghcr.io
33
repository: diamondlightsource/workflows-graph-proxy
44
tag: "jamesdoingstuff"
5-
digest: "sha256:b3354b17d4973da11a482d15913f7ca31be4dceac866b32395af6dce8759c5a8"
5+
digest: "sha256:402c265cd724b7598136cb5f06b4db6adf8a26b1488478e35048072ca165f539"
66
pullPolicy: IfNotPresent
77
pullSecrets: []
88

0 commit comments

Comments
 (0)