Closed m7pr closed 1 year ago
@pawelru do you know something about this?
I was trying to investigate it, and it looks like tlg-catalog is a repository that has a package inside a subdir. And it looks like staged.dependencies
is looking for DESCRIPTION in the root of the repository, and not in the subdir. I did try to rerun it a couple of times and at some point it did run with a successful run, without this error, but I'm not sure what was the cause
@pawelru do you know something about this?
Nope. New discovery to me.
I looked in the log and it relates to the already dead repo teal.devel
. Maybe that's the thing?
No it's not related to teal.devel
. teal.devel
is required by biomarker-catalog
https://github.com/insightsengineering/biomarker-catalog/blob/main/staged_dependencies.yaml#L17
I run the same function it in a couple of other repositories with different parameters settings/specification and it was always other package that was last at the fetch phase, but always the same issue with tlg-catalog besides one run when it was positive
I think remotes/devtools
call something like rprojroot::is_r_package$testfun('.')
on tlg-catalog repository and returns FALSE
rprojroot::is_r_package
Root criterion: contains a file "DESCRIPTION" with contents matching "^Package: "
becuase it should be run in tlg-catalog/package
subdir and not in tlg-catalog
directory.
If it relates to tlg-catalog and you have a reprex then I will be able to help. That was recently changed my me. In such case you have to have a following syntax:
repo: insightsengineering/tlg-catalog
host: https://github.com
subdir: package
Yeah. I saw that in tern https://github.com/insightsengineering/tern/commit/1492a4593bded7d44f3b40c73726936b62f262cb and it looks like it is causing some issues on my end
@pawelru I think the code from this issue is the reprex
staged.dependencies::dependency_table(
project = "insightsengineering/teal@https://github.com",
project_type = "repo@host",
ref = "refactor",
verbose = 1
) |> staged.dependencies::install_deps()
It is weird bc the only dependencies in instightsengineering have this highlighted: https://github.com/search?q=org%3Ainsightsengineering+insightsengineering%2Ftlg-catalog&type=code (i.e. it seems like only tern has this dep.... but what about rlistings? I am puzzled)
Created an issue: https://github.com/insightsengineering/rlistings/issues/148 feel free to close it if highlighting this direct dep is deemed unnecessary
Why would you like to add tlg-catalog
package to rlistings
package? tlg-catalog
package is not listed in DESCRIPTION
of rlistings
so I guess it is not used at all by rlistings
Why would you like to add
tlg-catalog
package torlistings
package?tlg-catalog
package is not listed inDESCRIPTION
ofrlistings
so I guess it is not used at all byrlistings
there are downstream dependencies to be added. Besides that we are missing these for tlg-catalog (@m7pr check scda.test
to see an analog situation), I think the source of the problem is that somehow the subdir directive is missing when the dep tree is retrieved indirectly. So we have two solutions: either we propagate the subdir internally in staged.deps methods or we add the downstream dependencies that are currently missing (I would do both). What do you think @pawelru?
I have just re-run snippet and it all worked well without error. Can you please clear the cache (staged.dependencies::clear_cache()
) and try again?
r$> packageVersion("staged.dependencies")
[1] ‘0.3.1.9001’
Ok, now I get you. So it's rlistings
listed in tlg-catalog/package/staged.dependencies.yml
but tlg-catalog
is not listed in rlistings/staged.dependencies.yml
.
To clean this up, I reckon we move forward with https://github.com/insightsengineering/nestdevs-tasks/issues/34
Thanks for the hint with staged.dependencies::clear_cache()
@pawelru .
Just run it, after cache clearing and i get the same. I'm so confused.
Me too... I cannot reproduce what you got. I am afraid that you would have to debug it yourself. Some hints from my side:
This is the line of code that generates the error: https://github.com/openpharma/staged.dependencies/blob/fb124997306b35d44a0225bb4b400bf7258c4c75/R/utils.R#L240-L242
It's a one-liner function used only in one place: https://github.com/openpharma/staged.dependencies/blob/fb124997306b35d44a0225bb4b400bf7258c4c75/R/dependencies.R#L121-L122
Thanks for pointing this out. I will debug more as I already tried various things, thanks : D
Ugh, I think I have outdated staged.dependencies
version, which is 0.2.8 which does not have the subdir
support introduced in 0.2.8.900
https://github.com/openpharma/staged.dependencies/commit/db7a13c26570f475c02bfd1898ca36152364fc4a
When I was debugging with devtools::load_all(".")
it loaded the state of the staged.dependencies
package in version 0.3.1.9001
which had the subdir
support and I could not reproduce the issue (and probably this is the only time that the staged.dependencies::install_deps
worked for me).
So I guess I will reinstall, and this will hopefully solve the issue. So stupid :)
> library(staged.dependencies)
> packageVersion('staged.dependencies')
[1] ‘0.2.8’
> devtools::load_all(".")
ℹ Loading staged.dependencies
Warning message:
package ‘testthat’ was built under R version 4.3.1
> packageVersion('staged.dependencies')
[1] ‘0.3.1.9001’
Yes, update to 0.3.1.9001 obviously fixed the issue