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

mrc 5087: Add endpoint to list parameters on a report #4

Merged
merged 4 commits into from
Mar 8, 2024
Merged

Conversation

r-ash
Copy link
Contributor

@r-ash r-ash commented Feb 29, 2024

Note this uses mrc-ide/orderly2#129 and should be merged after that

This PR will add an endpoint to list the parameters available on a report for a particular name and hash

Builds on #3 so should be merged after that

Copy link

codecov bot commented Feb 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (abbf115) to head (b1237df).

Additional details and impacted files
@@            Coverage Diff            @@
##              main        #4   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            6         7    +1     
  Lines          111       142   +31     
=========================================
+ Hits           111       142   +31     

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

@r-ash r-ash requested review from M-Kusumgar and richfitz February 29, 2024 16:52
@M-Kusumgar M-Kusumgar changed the base branch from main to mrc-5105 March 5, 2024 16:31
@r-ash r-ash changed the base branch from mrc-5105 to main March 5, 2024 17:12
To indicate when a particular report has modifications from the default
branch
Copy link
Contributor

@M-Kusumgar M-Kusumgar left a comment

Choose a reason for hiding this comment

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

Code looks good, see tiny comment, approving pending that orderly2 change which might change the function name depending on the way you choose to do it!

R/reports.R Outdated
contents <- gert::git_ls(root, ref = ref)
re <- sprintf("^src/%s/(%s|orderly)\\.R$", name, name)
matches <- grep(re, contents$path, value = TRUE, perl = TRUE)
if (length(matches) > 1) {
Copy link
Contributor

Choose a reason for hiding this comment

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

should we care about the case where they have none? or assumed to have at least one at this point?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

API should only call this for directories which have an orderly.R script. So this shouldn't be triggered with matches 0. That said, better to not rely on that knowledge as the error message raised if there is no file is quite ugly. So I've expanded this check to test if != 0

Copy link
Member

@richfitz richfitz left a comment

Choose a reason for hiding this comment

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

LGTM with the mrc-ide/orderly2#129 merged and DESCRIPTION here updated

DESCRIPTION Outdated
@@ -32,7 +32,7 @@ Suggests:
testthat (>= 3.0.0)
Config/testthat/edition: 3
Remotes:
mrc-ide/orderly2,
mrc-ide/orderly2@add-ast-read,
Copy link
Member

Choose a reason for hiding this comment

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

This is ready to be merged now

Suggested change
mrc-ide/orderly2@add-ast-read,
mrc-ide/orderly2,

DESCRIPTION Outdated
@@ -18,7 +18,7 @@ Imports:
gert (>= 2.0.1),
ids,
jsonlite,
orderly2,
orderly2 (>= 1.99.12),
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
orderly2 (>= 1.99.12),
orderly2 (>= 1.99.13),

@r-ash r-ash merged commit 0c8dfbd into main Mar 8, 2024
9 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.

3 participants