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 round_id expected pattern match check #88

Merged
merged 14 commits into from
Dec 18, 2024

Conversation

annakrystalli
Copy link
Member

@annakrystalli annakrystalli commented Dec 13, 2024

In schema v4.0.1 we are formalising the requirement of round_id values to match the pattern of either being an ISO formatted date (YYYY-MM-DD) or alphanumerics separated by underscores (_).
This PR resolves #68 by:

  • Dynamically validating that values in the round_id variable match the expected pattern match check when validating config.
  • Validating either the round_id argument value when round_id_from_variable = FALSE or the values in the round_id variable round_id_from_variable = TRUE when creating round objects programmatically.

Note that a large portion of the PR is new example config files.

Also note that I know there are some unrelated failing tests that I'm hoping to get some help with but would be great to get some feedback on the contents of the PR to keep things moving.

Note: unrelated test failures still exist and will need resolving before merging Found solution @zkamvar had applied in #86 and cherry picked into here!

Copy link

github-actions bot commented Dec 13, 2024

@annakrystalli
Copy link
Member Author

annakrystalli commented Dec 16, 2024

@zkamvar , I'm getting some weird test failures surfacing from what I think is strange behaviour of make_config_error(), namely no applicable method for 'conditionMessage' applied to an object of class "c('conval', 'error')". I'm not sure what's going on. Could you take a look please?

Note that I don't get these failures locally

@annakrystalli annakrystalli requested a review from elray1 December 16, 2024 12:11
@annakrystalli annakrystalli marked this pull request as ready for review December 16, 2024 15:39
Copy link
Contributor

@elray1 elray1 left a comment

Choose a reason for hiding this comment

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

I had a couple of very minor comments.

R/validate-config-utils.R Show resolved Hide resolved
R/create_round.R Show resolved Hide resolved
R/validate_config.R Show resolved Hide resolved
@annakrystalli annakrystalli requested a review from elray1 December 17, 2024 14:51
@annakrystalli
Copy link
Member Author

Thanks for the review @elray1 ! I responded to your questions, added some comments and additional info and also asked for some help on thinking through something.

Copy link
Contributor

@elray1 elray1 left a comment

Choose a reason for hiding this comment

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

one minor indentation fix required to satisfy the linter

tests/testthat/test-get_error_path.R Outdated Show resolved Hide resolved
Copy link
Contributor

@elray1 elray1 left a comment

Choose a reason for hiding this comment

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

approved; tests failing for unrelated reasons

A weird bug just popped up and I don't know where it's coming from, but
effectively, when a value with a class of "error" is passed to
`encodeString()`, it fails with:

Error in UseMethod("conditionMessage") :
  no applicable method for 'conditionMessage' applied to an object of class "error"

This never used to happen, so I'm fixing it here.
@annakrystalli annakrystalli merged commit 725c22b into main Dec 18, 2024
8 checks passed
@annakrystalli annakrystalli deleted the ak/round-id-regex-val/68 branch December 18, 2024 11:00
Copy link

codecov bot commented Dec 18, 2024

Codecov Report

Attention: Patch coverage is 97.95918% with 2 lines in your changes missing coverage. Please review.

Project coverage is 89.25%. Comparing base (b809161) to head (34f2624).
Report is 66 commits behind head on main.

Files with missing lines Patch % Lines
R/view_config_val_errors.R 81.81% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #88      +/-   ##
==========================================
+ Coverage   89.24%   89.25%   +0.01%     
==========================================
  Files          29       30       +1     
  Lines        2185     2420     +235     
==========================================
+ Hits         1950     2160     +210     
- Misses        235      260      +25     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

Add dynamic regex pattern validation of round IDs when round_id_from_variable: true
3 participants