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

feat: support Struct as a Launch input type #113

Merged
merged 4 commits into from
Oct 23, 2020
Merged

Conversation

schottra
Copy link
Contributor

TL;DR

This adds support for our Struct input type, which is essentially just a Protobuf.Struct object. Users will enter this value as a JSON object string, which will then be parsed and converted to a Protobuf.Struct object using the appropriate types for resulting values.

Type

  • Bug Fix
  • Feature
  • Plugin

Are all requirements met?

  • Code completed
  • Smoke tested
  • Unit tests added
  • Code documentation added
  • Any pending items have an associated Issue

Complete description

  • Added inputHelper code for converting between a JSON object string and a Struct Literal.
  • Updated code for type support to allow Structs.
  • Added a component for entering a Struct value, which is similar to a Collection in that it is a multi-line string input.
  • Added test cases, which involved some refactoring of the unit tests to correctly format the input values and expected outputs.
  • Added a simple wrapper for JSON.stringify to ensure consistent formatting (2 spaces) and updated relevant code to use that instead of JSON.stringify directly

Tracking Issue

flyteorg/flyte#22

Follow-up issue

NA

image

@codecov-io
Copy link

Codecov Report

Merging #113 into master will increase coverage by 0.21%.
The diff coverage is 83.89%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #113      +/-   ##
==========================================
+ Coverage   70.37%   70.59%   +0.21%     
==========================================
  Files         384      387       +3     
  Lines        6404     6516     +112     
  Branches     1017     1044      +27     
==========================================
+ Hits         4507     4600      +93     
- Misses       1897     1916      +19     
Impacted Files Coverage Δ
...omponents/Launch/LaunchForm/inputHelpers/struct.ts 77.77% <77.77%> (ø)
src/components/Launch/LaunchForm/StructInput.tsx 91.66% <91.66%> (ø)
src/common/utils.ts 90.74% <100.00%> (+0.35%) ⬆️
.../components/Launch/LaunchForm/LaunchFormInputs.tsx 85.36% <100.00%> (+1.15%) ⬆️
...onents/Launch/LaunchForm/inputHelpers/constants.ts 100.00% <100.00%> (ø)
...aunch/LaunchForm/inputHelpers/getHelperForInput.ts 100.00% <100.00%> (ø)
...ch/LaunchForm/inputHelpers/test/structTestCases.ts 100.00% <100.00%> (ø)
...s/Launch/LaunchForm/inputHelpers/test/testCases.ts 100.00% <100.00%> (ø)
...components/Launch/LaunchForm/inputHelpers/utils.ts 86.66% <100.00%> (+0.30%) ⬆️
src/components/common/DumpJSON.tsx 66.66% <100.00%> (+6.66%) ⬆️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2a24278...9a9af34. Read the comment docs.

@service-github-lyft-semantic-release
Copy link
Contributor

🎉 This PR is included in version 0.17.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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.

4 participants