Skip to content

Support for writing params of type List during discovery #1283

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Dec 19, 2022
Merged

Conversation

Berlioz
Copy link
Contributor

@Berlioz Berlioz commented Oct 27, 2022

No description provided.

@Berlioz Berlioz requested review from mbleigh and taeold October 27, 2022 23:29
Copy link
Member

@inlined inlined left a comment

Choose a reason for hiding this comment

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

Let's discuss offline whether this should be a JSON array, as presented, or a string + delimiter, as originally designed

expect(p1.equals(p2).value()).to.be.false;
expect(p1.notEquals(p2).value()).to.be.true;

expect(() => p1.greaterThan(p1).value()).to.throw;
Copy link
Member

Choose a reason for hiding this comment

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

This is why I wish we had done operators in the type system with strong types for each expression type =/

@@ -159,6 +164,7 @@ type ParamValueType = "string" | "list" | "boolean" | "int" | "float" | "secret"
type ParamInput<T> =
| { text: TextInput<T> }
| { select: SelectInput<T> }
| { selectList: SelectListInput }
Copy link
Member

Choose a reason for hiding this comment

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

I thought this was called MultiSelect in the spec since that name has been common since the days of jQuery.

Copy link
Contributor

@taeold taeold left a comment

Choose a reason for hiding this comment

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

Can we add a changelog entry?

});

it("falls back on the javascript zero values in case a list param's is unparsable as string[]", () => {
const notAllStrings = params.defineList("BAD_LIST");
Copy link
Contributor

Choose a reason for hiding this comment

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

no action required - but i can see this being pretty frustrating if we silent fall back to an empty list if the list isn't made up of all string elements :/.

I don't think we expect this to happen in real life since environment variable will almost always be strings anyway?

@Berlioz Berlioz merged commit 0ec9895 into master Dec 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants