Skip to content
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

POC ability to return object from select field from api #1037

Closed
wants to merge 1 commit into from

Conversation

punkle
Copy link
Contributor

@punkle punkle commented Jul 10, 2023

POC ability to return object from select field from api

I dont know if this even works, I havent tried to run it..

The select field from api field currently validates that the field returns a string with specific characteristics. The idea with this change is to allow any type to be returned from the api to be presented to the scaffolder action steps.

✔️ Checklist

  • Added tests for new functionality and regression tests for bug fixes
  • Added changeset (run yarn changeset in the root)
  • Screenshots of before and after attached (for UI changes)
  • Added or updated documentation (if applicable)

@punkle punkle requested review from a team as code owners July 10, 2023 08:10
@punkle punkle requested a review from sblausten July 10, 2023 08:10
validation.addError(
'must start and end with an alphanumeric character, and contain only alphanumeric characters, hyphens, underscores, and periods. Maximum length is 63 characters.',
);
if (typeof value === 'string') {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Perhaps we should be using the parameter's schema to be validating this field.

);
if (typeof value === 'string') {
if (!KubernetesValidatorFunctions.isValidObjectName(value)) {
validation.addError(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Honestly.. I think this check is not correct. I dont see why every string returned from the field must be a valid kubernetes object name. It just seems wrong.

I think this validation should look at the schema type and make sure the javascripts types roughly match up.. e.g. a string type returns a string, a number returns a number, a boolean returns a boolean. etc.

@sblausten
Copy link
Contributor

Is it possible to test locally?

@punkle punkle closed this Oct 24, 2023
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.

2 participants