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

Package handle template #2137

Closed
wants to merge 9 commits into from
Closed

Package handle template #2137

wants to merge 9 commits into from

Conversation

fiskus
Copy link
Member

@fiskus fiskus commented Mar 29, 2021

  • Unit tests
  • Automated tests (e.g. Preflight)
  • Documentation
  • Changelog entry

@codecov
Copy link

codecov bot commented Mar 29, 2021

Codecov Report

Merging #2137 (4f49f7c) into master (58bec27) will decrease coverage by 0.01%.
The diff coverage is 28.26%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2137      +/-   ##
==========================================
- Coverage   44.20%   44.19%   -0.02%     
==========================================
  Files         488      488              
  Lines       23640    23678      +38     
  Branches     3014     3019       +5     
==========================================
+ Hits        10450    10464      +14     
- Misses      12344    12368      +24     
  Partials      846      846              
Flag Coverage Δ
api-python 89.82% <ø> (ø)
catalog 14.71% <28.26%> (+0.05%) ⬆️
lambda 94.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...iners/Bucket/PackageDialog/PackageCreationForm.tsx 0.00% <0.00%> (ø)
...g/app/containers/Bucket/PackageDirectoryDialog.tsx 0.00% <0.00%> (ø)
.../containers/Bucket/PackageDialog/PackageDialog.tsx 25.00% <100.00%> (ø)
catalog/app/utils/packageHandle.ts 90.90% <100.00%> (+90.90%) ⬆️
catalog/app/utils/workflows.ts 100.00% <100.00%> (ø)

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 58bec27...4f49f7c. Read the comment docs.

@fiskus fiskus marked this pull request as ready for review March 31, 2021 06:45
hasValidationErrors: true,
form: true,
Copy link
Member Author

Choose a reason for hiding this comment

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

Removed form only, and sort other properties alphabetically

hasValidationErrors: true,
form: true,
initialValues: true,
Copy link
Member Author

Choose a reason for hiding this comment

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

Also, I added initialValues

@fiskus fiskus requested a review from nl0 March 31, 2021 07:59
}
}
}
},
"properties": {
"version": {
"const": "1"
Copy link
Member Author

Choose a reason for hiding this comment

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

@sir-sigurd I don't know should I increment version? I've added additional property package_handle, probably version should be 1.1 now?

Copy link
Member

Choose a reason for hiding this comment

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

i'm not sure if we decided on some global approach to schema versioning, but i'd say we should increment minor version to indicate feature addition while preserving compatibility

Copy link
Member

@nl0 nl0 left a comment

Choose a reason for hiding this comment

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

looks ok, tho i'm not sure about using initialValues object persisted in react state vs granular values for individual fields.

)

const [initialValues, setInitialValues] = React.useState({
files: initialFiles,
Copy link
Member

Choose a reason for hiding this comment

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

this way files initial value wont be updated on input props change (it shouldnt be a problem in practice bc it wont be changing while the dialog is open, but anyways, we should keep that in mind).
btw why did you consolidate all the initial values into one object and put it into state var?
what are the benefits of this vs using separate computed and state vars?

Copy link
Member Author

@fiskus fiskus Mar 31, 2021

Choose a reason for hiding this comment

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

Just one benefit — it works :)
I couldn't make it work with updating initialValue per field, they just don't update

directory: undefined,
username: undefined,
}),
).toBe('/')
Copy link
Member

Choose a reason for hiding this comment

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

this expectation doesnt match the description ("should return null")

Copy link
Member

Choose a reason for hiding this comment

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

seems like this belongs to the it below

}
}
}
},
"properties": {
"version": {
"const": "1"
Copy link
Member

Choose a reason for hiding this comment

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

i'm not sure if we decided on some global approach to schema versioning, but i'd say we should increment minor version to indicate feature addition while preserving compatibility

@@ -7,6 +7,25 @@
"workflows"
],
"additionalProperties": false,
"definitions": {
Copy link
Member

Choose a reason for hiding this comment

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

do we have duplicate schema files in python code and catalog?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes

@nl0
Copy link
Member

nl0 commented Aug 24, 2021

probably workflows and packageHandle stuff belongs to model, since it's our domain logic, but ofc we can move this around later as a part of some future refactoring

@fiskus
Copy link
Member Author

fiskus commented Oct 22, 2021

Was done here #2364

@fiskus fiskus closed this Oct 22, 2021
@fiskus fiskus deleted the package-handle branch October 22, 2021 13:48
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.

None yet

2 participants