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

Two Schemas for workflows/config.yaml, package validation, default package name #2364

Merged
merged 63 commits into from Oct 14, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
25adc4d
update ajv
fiskus Sep 27, 2021
6b89d60
update workflows JSON Schema
fiskus Sep 27, 2021
0e14ee9
fix workflows Schema and catalog specific Schema
fiskus Sep 28, 2021
773c5ef
apply new Schema validation for catalog workflows
fiskus Sep 28, 2021
e032908
fix Schema format
fiskus Sep 28, 2021
83cf642
this feature is not ready yet
fiskus Sep 28, 2021
49b4a4b
fix tests according to ajv update
fiskus Sep 29, 2021
7254f02
rewrite ajv options
fiskus Sep 29, 2021
914ba38
fix ajv errors format
fiskus Sep 29, 2021
b778edb
fix schema
fiskus Sep 29, 2021
43d94bd
add package_handle support
fiskus Sep 29, 2021
e5e5b24
add hook for getting package name template
fiskus Sep 29, 2021
0d9d5f3
minor changes
fiskus Sep 30, 2021
10017fe
use new approach for changing name on workflow change
fiskus Sep 30, 2021
60d3f80
add tests
fiskus Sep 30, 2021
1545cc7
add return type
fiskus Oct 4, 2021
907bf40
add object_schema property
fiskus Oct 4, 2021
7a83ab9
handle versioning too
fiskus Oct 4, 2021
3406757
use handle_pattern template
fiskus Oct 5, 2021
191f1f2
show pattern error
fiskus Oct 5, 2021
7c76725
add entries validator
fiskus Oct 5, 2021
956ad11
adjust UI
fiskus Oct 6, 2021
728f98c
show files error
fiskus Oct 6, 2021
3fdb01b
Merge branch 'master' of github.com:quiltdata/quilt into two-schemas
fiskus Oct 6, 2021
919b335
clear error message on files add
fiskus Oct 7, 2021
1d9372f
Update shared/schemas/workflows.yml.json
fiskus Oct 7, 2021
047393e
use object version
fiskus Oct 7, 2021
5607921
use regex format too
fiskus Oct 7, 2021
0b384c5
Merge branch 'two-schemas' of github.com:quiltdata/quilt into two-sch…
fiskus Oct 7, 2021
85ed54a
rename schemas
fiskus Oct 7, 2021
478c0a5
Merge branch 'master' of github.com:quiltdata/quilt into two-schemas
fiskus Oct 7, 2021
0b0805e
add previous version
fiskus Oct 7, 2021
fab09e5
fix uploading valid package
fiskus Oct 7, 2021
cea88dc
Remove extra empty line
fiskus Oct 7, 2021
a5c6e72
remove outdated code
fiskus Oct 7, 2021
9858999
add description
fiskus Oct 8, 2021
42825ce
Apply suggestions from code review
fiskus Oct 8, 2021
58af2e7
Merge branch 'two-schemas' of github.com:quiltdata/quilt into two-sch…
fiskus Oct 8, 2021
846d4fe
omit file extension
fiskus Oct 8, 2021
e5856c9
update example
fiskus Oct 8, 2021
804751b
add console.error
fiskus Oct 8, 2021
4df465c
hide console.logs
fiskus Oct 8, 2021
33a7624
use caret for version
fiskus Oct 8, 2021
9a52687
disable entries validation for package from direcotry
fiskus Oct 8, 2021
20eb08f
validate s3 files too
fiskus Oct 8, 2021
af5f139
Merge branch 'master' of github.com:quiltdata/quilt into two-schemas
fiskus Oct 8, 2021
dabd012
update version Schema
fiskus Oct 11, 2021
660dea7
use workflow value intsead of workflow getter
fiskus Oct 11, 2021
27955f1
Apply suggestions from code review
fiskus Oct 11, 2021
94f1268
add workflow calculation inline
fiskus Oct 11, 2021
0acd939
remove catalog if there is no catalog version in workflows/config.yaml
fiskus Oct 11, 2021
ffae8c5
use all files state to calc actual files
fiskus Oct 11, 2021
6087f56
fix schema
fiskus Oct 11, 2021
bc6f703
Merge branch 'master' of github.com:quiltdata/quilt into two-schemas
fiskus Oct 12, 2021
c6b1fee
Merge branch 'master' of github.com:quiltdata/quilt into two-schemas
fiskus Oct 14, 2021
607df74
fix mistypings
fiskus Oct 14, 2021
89fae6e
catch Ajv errors
fiskus Oct 14, 2021
18b61eb
dont rewrite existing name
fiskus Oct 14, 2021
1e64883
adjust unit-test
fiskus Oct 14, 2021
a5b71c7
divide empty string made on purpose and lack of value
fiskus Oct 14, 2021
fb51a25
fix unit test
fiskus Oct 14, 2021
1ea1d7f
exporting and dont use exported is confusing
fiskus Oct 14, 2021
cb212cf
Merge branch 'master' of github.com:quiltdata/quilt into two-schemas
fiskus Oct 14, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 0 additions & 6 deletions catalog/app/containers/Bucket/PackageCreateDialog.tsx
@@ -1,8 +1,6 @@
import * as R from 'ramda'
import * as React from 'react'
import * as redux from 'react-redux'

import * as authSelectors from 'containers/Auth/selectors'
import * as AWS from 'utils/AWS'
import AsyncResult from 'utils/AsyncResult'
import * as BucketPreferences from 'utils/BucketPreferences'
Expand Down Expand Up @@ -40,15 +38,11 @@ export function usePackageCreateDialog({
_: R.identity,
})

const username = redux.useSelector(authSelectors.username)
const usernamePrefix = React.useMemo(() => PD.getUsernamePrefix(username), [username])

return PD.usePackageCreationDialog({
bucket,
data,
delayHashing: true,
disableStateDisplay: true,
name: usernamePrefix,
onExited,
ui: {
successTitle: 'Package created',
Expand Down
24 changes: 14 additions & 10 deletions catalog/app/containers/Bucket/PackageDialog/PackageDialog.tsx
Expand Up @@ -268,7 +268,7 @@ export function PackageNameInput({
const readyForValidation = (value && meta.modified) || meta.submitFailed
const errorCode = readyForValidation && meta.error
const error = errorCode ? errors[errorCode] || errorCode : ''
const [modified, setModified] = React.useState(meta.modified)
const [modified, setModified] = React.useState(!!(meta.modified || value))
const handleChange = React.useCallback(
(event) => {
setModified(true)
Expand Down Expand Up @@ -817,15 +817,19 @@ export function getUsernamePrefix(username?: string | null) {
const getDefaultPackageName = (
workflow: { packageName: packageHandleUtils.NameTemplates },
{ directory, username }: { directory?: string; username: string },
) =>
typeof directory === 'string'
? packageHandleUtils.execTemplate(workflow?.packageName, 'files', {
directory: basename(directory),
username: s3paths.ensureNoSlash(getUsernamePrefix(username)),
})
: packageHandleUtils.execTemplate(workflow?.packageName, 'packages', {
username: s3paths.ensureNoSlash(getUsernamePrefix(username)),
})
) => {
const usernamePrefix = getUsernamePrefix(username)
const templateBasedName =
typeof directory === 'string'
? packageHandleUtils.execTemplate(workflow?.packageName, 'files', {
directory: basename(directory),
username: s3paths.ensureNoSlash(usernamePrefix),
})
: packageHandleUtils.execTemplate(workflow?.packageName, 'packages', {
username: s3paths.ensureNoSlash(usernamePrefix),
})
return templateBasedName || usernamePrefix
nl0 marked this conversation as resolved.
Show resolved Hide resolved
}

const usePackageNameWarningStyles = M.makeStyles({
root: {
Expand Down