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

use an option for schema version for create functions #85

Open
zkamvar opened this issue Nov 25, 2024 · 2 comments · May be fixed by #87
Open

use an option for schema version for create functions #85

zkamvar opened this issue Nov 25, 2024 · 2 comments · May be fixed by #87

Comments

@zkamvar
Copy link
Member

zkamvar commented Nov 25, 2024

In reichlab/variant-nowcast-hub#176, the workflow to create a new round began to fail because the default schema for functions like create_task_id is "latest" so it constructed a v4 schema instead of v3.0.1 resulting in the following error:

ℹ Existing config found, adding a new round
Error in `hubAdmin::append_round()`:
✖ Schema version mismatch between `config` and round.
! Must be the same.
• `config`:
  "https://raw.githubusercontent.com/hubverse-org/schemas/main/v3.0.1/tasks-schema.json"
• round:
  "https://raw.githubusercontent.com/hubverse-org/schemas/main/v4.0.0/tasks-schema.json"
Backtrace:
    ▆
 1. └─hubAdmin::append_round(existing_task_config, new_round)
 2.   └─cli::cli_abort(...) at hubAdmin/R/append_round.R:133:5
 3.     └─rlang::abort(...)

I think we should specify schema = getOption("hubAdmin.schema_version", default = "latest") in the function signatures, so that way users can specify one line at the top of their script to set the schema version while they are developing the script.

options(hubAdmin.schema_version = "v3.0.1")
@annakrystalli
Copy link
Member

This is a great idea! Will implement!

@annakrystalli
Copy link
Member

Will also include an option for branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Ready for Review
Development

Successfully merging a pull request may close this issue.

2 participants