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

klmr/box support #526

Merged
merged 36 commits into from
Feb 8, 2024
Merged

klmr/box support #526

merged 36 commits into from
Feb 8, 2024

Conversation

radbasa
Copy link
Contributor

@radbasa radbasa commented Mar 6, 2023

Provide test coverage reports for klmr/box modules.

Closes #491

Coverage reports for box modules work best with covr::file_coverage().

What works:

box::use(
  prefix/module,
  alias = prefix/mod,
  prefix/module[attach_list],
  prefix/module[...],
  prefix/module[alias = attached_function]
)
  • R6 classes as box modules.

Changes:

  1. Modified R/R6.R: replacements_R6 for code reuse in R/box.R R6 class support.
  2. Unit tests and test applications for for the various ways of importing box modules.

Not implemented:

  • S4 and RC. klmr/box does not support S4.

Unfortunately S4 does not, and (I believe) fundamentally cannot ever work with ‘box’. The reason for that is that S4 explicitly only supports defining classes and methods in packages or the R global environment, and nothing else.
klmr/box#284 (comment)

See klmr/box issues:

radbasa and others added 26 commits January 19, 2023 14:25
Co-authored-by: Jakub Nowicki <[email protected]>
Add covr visibility into private box module functions
Tests for box module attached functions, three dots, aliases
@CLAassistant
Copy link

CLAassistant commented Mar 6, 2023

CLA assistant check
All committers have signed the CLA.

@radbasa
Copy link
Contributor Author

radbasa commented Mar 15, 2023

Hi @jimhester, several of the CICD steps fail with Error: Failed to get R 4.2.3: Failed to get R 4.2.3: Failed to download version 4.2.3: Error: Unexpected HTTP response: 403. Is there anything we can do on our end to resolve these?

@jimhester
Copy link
Member

Could you look into the test errors on R-devel? https://github.com/r-lib/rig might be useful to get and use R-devel locally if you don't have it already installed.

@jakubnowicki
Copy link
Contributor

jakubnowicki commented Apr 21, 2023

Could you look into the test errors on R-devel? https://github.com/r-lib/rig might be useful to get and use R-devel locally if you don't have it already installed.

@jimhester we have tried that (up to setting a VM with Ubuntu 20.04 to be closer to the CI environment), but it works there. We will investigate.

jakubnowicki and others added 2 commits October 10, 2023 12:43
* Added `replacements_box()` for `klmr/box` support.
* Extracted `traverse_R6()` from `replacements_R6()` to reuse code in `replacements_box()`.
* R6 class box modules test cases separated to handle a known R6 issues with `r-devel`. `skip_if(is_r_devel())` is used in the R6 test cases.
@radbasa
Copy link
Contributor Author

radbasa commented Oct 10, 2023

Could you look into the test errors on R-devel? https://github.com/r-lib/rig might be useful to get and use R-devel locally if you don't have it already installed.

Hello @jimhester , the test errors on R-devel were caused by R6 classes in the test cases similar to the errors in test-R6.R addressed in commit 2b9b4dd. Like you, we could not replicate the error interactively. We separated the R6 test cases into separate tests and used skip_if(is_r_devel()) for the tests with R6 classes.

Known CI issues:

radbasa and others added 2 commits October 11, 2023 11:57
* Adjusted DESCRIPTION and NEWS.md
* Different condition to skip tests
* Bump version for release

---------

Co-authored-by: Jim Hester <[email protected]>
@radbasa
Copy link
Contributor Author

radbasa commented Oct 11, 2023

@king-of-poppk
Copy link

Hi @radbasa! What is currently blocking this PR?

@radbasa
Copy link
Contributor Author

radbasa commented Jan 10, 2024

Hi @radbasa! What is currently blocking this PR?

Hi @king-of-poppk , I believe it's an R 3.6.3 backports issue. CI is failing on oldrel-4 which is Ubuntu 22.04.3 LTS-R version 3.6.3.

Specifically, the problem is when box 1.1.3 is being installed.

  ℹ Building box 1.1.3
  ✖ Failed to build box 1.1.3
  Error: 
  ! error in pak subprocess
  Caused by error in `stop_task_build(state, worker)`:
  ! Failed to build source package box.
  ---
  Backtrace:
  1. pak::lockfile_install(".github/pkg.lock")
  2. pak:::remote(function(...) { …
  3. err$throw(res$error)

An August 2023 commit on box should unblock this PR. We'll have to wait for @klmr to publish the next version of box to CRAN.

king-of-poppk referenced this pull request in klmr/box Jan 10, 2024
* `activeBindingFunction()` needs to reset the environment’s class after
  clearing it.
* `tryInvokeRestart()` was missing
@king-of-poppk
Copy link

king-of-poppk commented Feb 7, 2024

An August 2023 commit on box should unblock this PR. We'll have to wait for @klmr to publish the next version of box to CRAN.

@radbasa box 1.2.0 which includes klmr/box@9c47553 was just released.

@radbasa
Copy link
Contributor Author

radbasa commented Feb 7, 2024

An August 2023 commit on box should unblock this PR. We'll have to wait for @klmr to publish the next version of box to CRAN.

@radbasa covr 1.2.0 which includes klmr/box@9c47553 was just released.

Thank you for the heads-up, I'll work on it. We'll have to wait for packagemanager.posit.co to serve [email protected].

@king-of-poppk
Copy link

covr 1.2.0

@radbasa Sorry, meant box 1.2.0. Edited.

@radbasa
Copy link
Contributor Author

radbasa commented Feb 8, 2024

Hi @jimhester , the backports issue with CI/CD oldrel-4 has been resolved by the release of [email protected]. All checks now pass. When you have the time, we would appreciate it if you take a look at this PR. Thank you!

@jimhester
Copy link
Member

Thanks for the update, LGTM

@jimhester jimhester merged commit 3ec2edf into r-lib:main Feb 8, 2024
12 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.

Coverage with modules (e.g. klmr/box)
5 participants