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

2288-Input and internal config validation #2289

Conversation

ychoquet
Copy link
Contributor

@ychoquet ychoquet commented Jun 21, 2024

Description

Making input and internal config validation uniform.

Fixes #2288

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Using chrome Devtool to trace and debug the code.

Deploy URL: https://ychoquet.github.io/GeoView/config-sandbox.html

Checklist:

  • I have build (rush build) and deploy (rush host) my PR
  • I have connected the issues(s) to this PR
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have created new issue(s) related to the outcome of this PR is needed
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

This change is Reviewable

@ychoquet ychoquet force-pushed the Input-and-internal-validator branch from 6b967e1 to c5e9ce3 Compare June 21, 2024 15:33
@DamonU2 DamonU2 requested review from DamonU2 and Alex-NRCan June 24, 2024 14:17
Copy link
Member

@jolevesq jolevesq left a comment

Choose a reason for hiding this comment

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

Reviewed 7 of 7 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Alex-NRCan, @DamonU2, and @ychoquet)


packages/geoview-core/src/api/config/types/config-validation-schema.json line 330 at r1 (raw file):

          "type": "string"
        },
        "useInternalSchema": {

Should it be a flag in the schema? Should we encapsulate the internal validation inside the object? The function should always deal with validate input (user schema). The output of this call can be use to validate against internal. There should be no way to ask for internal validation from a user schema.

Lets discuss about this

Copy link
Member

@Alex-NRCan Alex-NRCan left a comment

Choose a reason for hiding this comment

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

Reviewed 7 of 7 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @DamonU2 and @ychoquet)

Copy link
Contributor Author

@ychoquet ychoquet left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Alex-NRCan, @DamonU2, and @jolevesq)


packages/geoview-core/src/api/config/types/config-validation-schema.json line 330 at r1 (raw file):

Previously, jolevesq (Johann Levesque) wrote…

Should it be a flag in the schema? Should we encapsulate the internal validation inside the object? The function should always deal with validate input (user schema). The output of this call can be use to validate against internal. There should be no way to ask for internal validation from a user schema.

Lets discuss about this

Schema validation has the ability to execute conditionnal instructions ("if") using properties. We can test for existance of a property or test the value of a property to decide what kind of validation we want to apply. To my knowledge, there is no way to do that using an external flag. There must be a property in the schema to rely on.

@ychoquet ychoquet force-pushed the Input-and-internal-validator branch from c5e9ce3 to 4324b42 Compare June 26, 2024 15:15
Copy link
Member

@jolevesq jolevesq left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Alex-NRCan and @DamonU2)

@ychoquet ychoquet force-pushed the Input-and-internal-validator branch from 4324b42 to 596ef7b Compare June 26, 2024 17:04
Copy link
Member

@jolevesq jolevesq left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @Alex-NRCan and @DamonU2)

@jolevesq jolevesq merged commit 2b421fb into Canadian-Geospatial-Platform:develop Jun 26, 2024
6 checks passed
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.

Input and internal config validation
3 participants