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

LITE-27893 Add validation step for PPR upload #19

Merged
merged 1 commit into from
Jul 14, 2023

Conversation

jonatrios
Copy link
Contributor

No description provided.

@jonatrios jonatrios requested review from d3rky and akodelia July 13, 2023 13:54
@jonatrios jonatrios self-assigned this Jul 13, 2023
@jonatrios jonatrios force-pushed the LITE-27893-add-validation-step-on-ppr-creation branch 3 times, most recently from 1a54a8c to 8ba3f9c Compare July 13, 2023 14:29
@rahulmondal
Copy link
Contributor

One general question - why are we not using CBC API for validation?

  1. CBC PPR validation API validates very extensively and more than just column names.
  2. If we use CBC API, then we don't have to worry about future changes in file format.

"enum": [
"OldName_1",
"Name_EN",
"Description_EN",
Copy link
Contributor

Choose a reason for hiding this comment

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

Name and description both can be multilingual.

Copy link
Contributor

Choose a reason for hiding this comment

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

That's great, but only EN is required only

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, will allow additional fields for "ServicePlans" that starts with "Name_" / "Description_"

Copy link
Contributor

Choose a reason for hiding this comment

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

I'll merge the PR, but please check that if any additional column appears we shouldn't fail because of it. The system should be treated as open - which means it retrieves all needed information from the input and ignore others

@d3rky
Copy link
Contributor

d3rky commented Jul 14, 2023

@rahulmondal Nope, on uploading the PPR we don't have the hub to validate against, the only thing that we can do here to check required sheets and fields inside

@jonatrios jonatrios changed the title LITE-27893 Add validation step fro PPR upload LITE-27893 Add validation step for PPR upload Jul 14, 2023
@jonatrios jonatrios force-pushed the LITE-27893-add-validation-step-on-ppr-creation branch from 8ba3f9c to a63e072 Compare July 14, 2023 09:26
try:
jsonschema.validate(dict_file, PPR_SCHEMA)
except jsonschema.ValidationError as ex:
error = ClientError(
Copy link
Contributor

Choose a reason for hiding this comment

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

[SOL-C] Propose to make an error class to store all the errors in one place.
Otherwise we may get confused in the error codes. Do you agree?

"enum": [
"OldName_1",
"Name_EN",
"Description_EN",
Copy link
Contributor

Choose a reason for hiding this comment

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

That's great, but only EN is required only

"enum": [
"OldName_1",
"Name_EN",
"Description_EN",
Copy link
Contributor

Choose a reason for hiding this comment

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

I'll merge the PR, but please check that if any additional column appears we shouldn't fail because of it. The system should be treated as open - which means it retrieves all needed information from the input and ignore others

@d3rky d3rky merged commit 31ff93b into master Jul 14, 2023
8 checks passed
@rahulmondal
Copy link
Contributor

@rahulmondal Nope, on uploading the PPR we don't have the hub to validate against, the only thing that we can do here to check required sheets and fields inside

@d3rky
Actually, we do have the hub details. PPRs are uploaded for a deployment and deployment is associated with single hub as per the models.

@d3rky d3rky deleted the LITE-27893-add-validation-step-on-ppr-creation branch July 25, 2023 13:20
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