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

add an action to validate updates to hub config files #9

Closed
elray1 opened this issue Feb 2, 2024 · 4 comments · Fixed by #20
Closed

add an action to validate updates to hub config files #9

elray1 opened this issue Feb 2, 2024 · 4 comments · Fixed by #20
Assignees

Comments

@elray1
Copy link

elray1 commented Feb 2, 2024

this would make me feel better about things when i'm making updates to config files

@zkamvar zkamvar self-assigned this Aug 1, 2024
@zkamvar
Copy link
Member

zkamvar commented Aug 1, 2024

I can give this a shot. I had initially thought this was completed in b59f6bc, but now I understand that doesn't validate the config files, so this action would be, in a sense, validating the validators.

I'm going to implement an action that will use hubValidations::check_config_hub_valid() to validate the config files because it looks like it wraps the validations from hubAdmin

As a side note: I believe a workflow like this would have prevented the config errors I was getting in hubverse-org/hubDocs#152

  • 🤔 Validating config files
    • 👍🏽 installed hubAdmin package
    • 🤔 validate_hub_config() fails for metadata schema because some elements need to be arrays

@annakrystalli
Copy link
Member

annakrystalli commented Aug 1, 2024

Sorry I should have added more detail in the request!

Yes the config is checked during submission validation but that's only triggered when model output or metadata files are submitted.

It would be nice to have a workflow that is triggered by changes to the config.

The hubValidations check function, as you noted, actually only wraps a hubAdmin function specifically hubAdmin::validate_hub_config(). So we only need to run this function.

This returns TRUE or FALSE so we want the workflow to fail if it returns FALSE. If FALSE, an errors table is also attached as an attribute.

There's also function hubAdmin:: view_config_val_errors() that presents any validation errors in a nicely formated gt table. Would be amazing to post that as a comment but not sure how straight forward it will be. If not just printing the errors attribute would be useful instead.

@zkamvar
Copy link
Member

zkamvar commented Aug 1, 2024

@zkamvar
Copy link
Member

zkamvar commented Aug 1, 2024

Okay, I've got something working here:

zkamvar/example-complex-forecast-hub#1

(because I'm going to delete my fork, it looks like this:)

❌ Invalid Configuration

The schema in hub-config/ appear to be invalid. Details about the exact locations of the errors can be found in the table below.

hubUtils config validation error report
Report for directory /home/runner/work/example-complex-forecast-hub/example-complex-forecast-hub/hub-config using schema version v3.0.0
Error location Schema details Config
fileName instancePath schemaPath keyword message schema data
admin.json contactname properties └contact └─properties └──name └───type type ❌ must be string string Maintainer!!!?, name?>??
For more information, please consult the hubDocs documentation.

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 a pull request may close this issue.

3 participants