Skip to content

Conversation

@hillalex
Copy link
Contributor

@hillalex hillalex commented Oct 6, 2022

This adds a new entrypoint that exposes the function for generating an orderly demo based on a source directory and a demo.yml file. See this in use in OrderlyWeb: vimc/orderly-web#479

R/testing.R is a bit of a tangle tbh, but rather than unpicking it I've just added a new function for what we want in OW.

@codecov
Copy link

codecov bot commented Oct 6, 2022

Codecov Report

Merging #320 (efa0c81) into master (5b12ff9) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head efa0c81 differs from pull request most recent head ea8e611. Consider uploading reports for the commit ea8e611 to get more accurate results

@@           Coverage Diff           @@
##           master     #320   +/-   ##
=======================================
  Coverage   99.95%   99.95%           
=======================================
  Files          41       41           
  Lines        4524     4535   +11     
=======================================
+ Hits         4522     4533   +11     
  Misses          2        2           
Impacted Files Coverage Δ
R/testing.R 98.80% <100.00%> (+0.08%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@hillalex hillalex changed the title Mrc 3665 mrc-3665 way for orderly web to control demo data Oct 17, 2022
@@ -0,0 +1,9 @@
#!/bin/sh
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the existing create_orderly_demo script is still in use by things other than OW (e.g. for testing in this repo), so I've left that as is and just added a new one for the usage we want in OW.

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like create_orderly_demo script is used in test set in many places, like montagu-proxy, montagu-reporting-api, montagu-webapps. If we are not using create_orderly_demo in orderly-web any more then possibly worth backing out commit d7922bd from this PR to avoid potentially breaking the other components which use it

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 yep, let's do that.

Copy link
Contributor

@r-ash r-ash left a comment

Choose a reason for hiding this comment

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

New function for running git example from source looks good. Small comment about the changes to create_orderly_demo script.

It would be nice to review all the setup functions in R/testing.R at some point as they have all expanded since first being added and I think probably have some overlap in functionality. The differences between them are quite confusing. Can see that is out of scope for what you want to do in this ticket though

@@ -0,0 +1,9 @@
#!/bin/sh
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like create_orderly_demo script is used in test set in many places, like montagu-proxy, montagu-reporting-api, montagu-webapps. If we are not using create_orderly_demo in orderly-web any more then possibly worth backing out commit d7922bd from this PR to avoid potentially breaking the other components which use it

@hillalex
Copy link
Contributor Author

New function for running git example from source looks good. Small comment about the changes to create_orderly_demo script.

It would be nice to review all the setup functions in R/testing.R at some point as they have all expanded since first being added and I think probably have some overlap in functionality. The differences between them are quite confusing. Can see that is out of scope for what you want to do in this ticket though

Agree that adding a further function feels like adding more complication on top of an already confusing collection of code. I'd be happy to have a go at refactoring the whole file in another ticket.

@hillalex
Copy link
Contributor Author

Ok, I've backed out the previous change @r-ash had made, and this just adds the new entrypoint.

@hillalex hillalex requested a review from r-ash October 18, 2022 12:58
@hillalex
Copy link
Contributor Author

I'm a little puzzled as to why the windows R-CMD-check is failing, given that it seems to be passing for other branches...

@richfitz
Copy link
Member

quite likely it's failing because openssl has been updated on cran, GHA is trying and failing to install it from source - probably something in that vignette is using openssl indirectly

@richfitz
Copy link
Member

indeed that is what's going on:

Error: Error: processing vignette 'orderly.Rmd' failed with diagnostics:
there is no package called 'openssl'
--- failed re-building 'orderly.Rmd'
--- re-building 'patterns.Rmd' using rmarkdown
--- finished re-building 'patterns.Rmd'
--- re-building 'remote.Rmd' using rmarkdown
--- finished re-building 'remote.Rmd'
SUMMARY: processing the following files failed:
  'bundles.Rmd' 'orderly.Rmd'
Error: Error: Vignette re-building failed.

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.

Don't worry about the windows failing build, this is affecting lots of things atm and it's very unlikely this set of changes will break that build specifically

}


prepare_git_example_from_source <- function(source_path, path) {
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a test for this within the testthat tests please?

@@ -0,0 +1,9 @@
#!/bin/sh
Copy link
Member

Choose a reason for hiding this comment

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

Generally I think it's nicer to avoid using extensions on scripts as then we can reimplement them in another language later without having to update uses. Your editor should pick up syntax highlighting properly based on the first line

@r-ash
Copy link
Contributor

r-ash commented Oct 20, 2022

quite likely it's failing because openssl has been updated on cran, GHA is trying and failing to install it from source - probably something in that vignette is using openssl indirectly

There is a fix for this in #321 https://github.com/vimc/orderly/pull/321/files#diff-9c940e8ad2b7bc4c26ec3da57b94bc00e73e2166cfed689da51a4c59bcc0a310R80

RUN R CMD INSTALL /orderly && \
Rscript -e 'orderly:::write_script("/usr/bin")' && \
cp /orderly/inst/create_orderly_demo.sh /usr/bin/ && \
cp /orderly/inst/run_orderly_demo /usr/bin/ && \
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've left the old script create_orderly_demo.sh with the extension, since it could be in use by other repos

@hillalex hillalex requested a review from richfitz October 20, 2022 13:53
@richfitz
Copy link
Member

richfitz commented Oct 20, 2022

Any idea why all GHA checks suddenly stopped running here?

Edit: these ones do look like they're running but not posting back - https://github.com/vimc/orderly/actions/runs/3290165552

@hillalex
Copy link
Contributor Author

Huh, weird. Also looks like there are some strange test failures, will investigate.

@hillalex hillalex merged commit 7d469c5 into master Oct 26, 2022
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