Skip to content

Commit

Permalink
Fixes #23544: Parameter name in metadata.xml should be its id
Browse files Browse the repository at this point in the history
  • Loading branch information
amousset committed Oct 8, 2023
1 parent bf5127f commit dc23c6c
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 23 deletions.
6 changes: 3 additions & 3 deletions policies/rudderc/src/backends/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ impl From<Parameter> for Input {
};

Self {
name: p.name.clone(),
description: p.description.unwrap_or(p.name),
long_description: p.documentation,
name: p.id.to_string(),
description: p.name,
long_description: p.description,
constraint: Constraint {
_type: type_constraint.to_string(),
may_be_empty: if p.constraints.allow_empty {
Expand Down
5 changes: 3 additions & 2 deletions policies/rudderc/tests/cases/general/escaping/metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@
<SECTIONS>
<SECTION name="Technique parameters">
<INPUT>
<NAME>server</NAME>
<DESCRIPTION>${sys.host} . | / ${sys.${host}} &apos; &apos;&apos; &apos;&apos;&apos; $ $$ &quot; &quot;&quot; \ \\😋aà3</DESCRIPTION>
<NAME>3439bbb0-d8f1-4c43-95a9-0c56bfb8c27e</NAME>
<DESCRIPTION>server</DESCRIPTION>
<LONGDESCRIPTION>${sys.host} . | / ${sys.${host}} &apos; &apos;&apos; &apos;&apos;&apos; $ $$ &quot; &quot;&quot; \ \\😋aà3</LONGDESCRIPTION>
<CONSTRAINT>
<TYPE>textarea</TYPE>
</CONSTRAINT>
Expand Down
33 changes: 17 additions & 16 deletions policies/rudderc/tests/cases/general/form/metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,17 @@
<SECTIONS>
<SECTION name="Technique parameters">
<INPUT>
<NAME>server_a</NAME>
<DESCRIPTION>description</DESCRIPTION>
<NAME>3439bbb0-d8f1-4c43-95a9-0c56bfb8c27a</NAME>
<DESCRIPTION>server_a</DESCRIPTION>
<LONGDESCRIPTION>description</LONGDESCRIPTION>
<CONSTRAINT>
<TYPE>textarea</TYPE>
</CONSTRAINT>
</INPUT>
<INPUT>
<NAME>server_b</NAME>
<DESCRIPTION>The server hostname</DESCRIPTION>
<LONGDESCRIPTION>This is markdown</LONGDESCRIPTION>
<NAME>3439bbb0-d8f1-4c43-95a9-0c56bfb8c27b</NAME>
<DESCRIPTION>server_b</DESCRIPTION>
<LONGDESCRIPTION>The server hostname</LONGDESCRIPTION>
<CONSTRAINT>
<TYPE>textarea</TYPE>
<MAYBEEMPTY>true</MAYBEEMPTY>
Expand All @@ -60,80 +61,80 @@
</CONSTRAINT>
</SELECT1>
<INPUT>
<NAME>server_d</NAME>
<NAME>3439bbb0-d8f1-4c43-95a9-0c56bfb8c27d</NAME>
<DESCRIPTION>server_d</DESCRIPTION>
<CONSTRAINT>
<TYPE>mail</TYPE>
</CONSTRAINT>
</INPUT>
<INPUT>
<NAME>server_e</NAME>
<NAME>3439bbb0-d8f1-4c43-95a9-0c56bfb8c27e</NAME>
<DESCRIPTION>server_e</DESCRIPTION>
<CONSTRAINT>
<TYPE>boolean</TYPE>
</CONSTRAINT>
</INPUT>
<INPUT>
<NAME>server_f</NAME>
<NAME>3439bbb0-d8f1-4c43-95a9-0c56bfb8c27f</NAME>
<DESCRIPTION>server_f</DESCRIPTION>
<CONSTRAINT>
<TYPE>password</TYPE>
<PASSWORDHASH>pre-hashed,unix-crypt-des,linux-shadow-sha512</PASSWORDHASH>
</CONSTRAINT>
</INPUT>
<INPUT>
<NAME>server_g</NAME>
<NAME>3439bbb0-d8f1-4c43-95a9-0c56bfb8c27g</NAME>
<DESCRIPTION>server_g</DESCRIPTION>
<CONSTRAINT>
<TYPE>password</TYPE>
<PASSWORDHASH>pre-hashed,linux-shadow-sha256,linux-shadow-sha512,aix-ssha256,aix-ssha512</PASSWORDHASH>
</CONSTRAINT>
</INPUT>
<INPUT>
<NAME>server_h</NAME>
<NAME>3439bbb0-d8f1-4c43-95a9-0c56bfb8c27h</NAME>
<DESCRIPTION>server_h</DESCRIPTION>
<CONSTRAINT>
<TYPE>perm</TYPE>
</CONSTRAINT>
</INPUT>
<INPUT>
<NAME>server_i</NAME>
<NAME>3439bbb0-d8f1-4c43-95a9-0c56bfb8c27i</NAME>
<DESCRIPTION>server_i</DESCRIPTION>
<CONSTRAINT>
<TYPE>size-gb</TYPE>
</CONSTRAINT>
</INPUT>
<INPUT>
<NAME>server_j</NAME>
<NAME>3439bbb0-d8f1-4c43-95a9-0c56bfb8c27j</NAME>
<DESCRIPTION>server_j</DESCRIPTION>
<CONSTRAINT>
<TYPE>textarea</TYPE>
</CONSTRAINT>
</INPUT>
<INPUT>
<NAME>server_k</NAME>
<NAME>3439bbb0-d8f1-4c43-95a9-0c56bfb8c27k</NAME>
<DESCRIPTION>server_k</DESCRIPTION>
<CONSTRAINT>
<TYPE>ipv6</TYPE>
</CONSTRAINT>
</INPUT>
<INPUT>
<NAME>server_l</NAME>
<NAME>3439bbb0-d8f1-4c43-95a9-0c56bfb8c27l</NAME>
<DESCRIPTION>server_l</DESCRIPTION>
<CONSTRAINT>
<TYPE>textarea</TYPE>
</CONSTRAINT>
</INPUT>
<INPUT>
<NAME>server_m</NAME>
<NAME>3439bbb0-d8f1-4c43-95a9-0c56bfb8c27m</NAME>
<DESCRIPTION>server_m</DESCRIPTION>
<CONSTRAINT>
<TYPE>integer</TYPE>
<DEFAULT>42</DEFAULT>
</CONSTRAINT>
</INPUT>
<INPUT>
<NAME>server_n</NAME>
<NAME>3439bbb0-d8f1-4c43-95a9-0c56bfb8c27n</NAME>
<DESCRIPTION>server_n</DESCRIPTION>
<CONSTRAINT>
<TYPE>textarea</TYPE>
Expand Down
5 changes: 3 additions & 2 deletions policies/rudderc/tests/cases/general/ntp/metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@
<SECTIONS>
<SECTION name="Technique parameters">
<INPUT>
<NAME>server</NAME>
<DESCRIPTION>The server hostname</DESCRIPTION>
<NAME>3439bbb0-d8f1-4c43-95a9-0c56bfb8c27e</NAME>
<DESCRIPTION>server</DESCRIPTION>
<LONGDESCRIPTION>The server hostname</LONGDESCRIPTION>
<CONSTRAINT>
<TYPE>textarea</TYPE>
</CONSTRAINT>
Expand Down

0 comments on commit dc23c6c

Please sign in to comment.