Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# teal.gallery Development Guide

`teal.gallery` is a set of `teal` applications that provide examples of ready to use apps exploring clinical trial data.
It requires extensive knowledge of the teal framework from the app developer perspective and GitHub workflows.

The automated workflows allow for the apps' dependencies to be updated and deployed.
It deploys a stable and development apps to [shinyapps.io](https://shinyapps.io) that contain essentially the same application, but with different dependencies.

The application code is written in a simple form to allow users to understand how an app is developed and use it as a base for their own work.

Comment thread
llrs-roche marked this conversation as resolved.
### Direct dependencies

- **teal** - Provides the framework and helpers to operate with teal
modules.
- **teal.code** - Bare code generation and evaluation ensuring
reproducibility.
- **teal.data** - Data management and relationships between datasets via
join_keys. (contains sample data for ADaM datasets and default keys to
merge ADaM datasets).
- **teal.picks** - Helpers to select, transform and manipulate them.
- **teal.modules.clinical** - Modules to explore ADaM clinical trial datasets
- **teal.modules.general** - Modules to explore generic datasets
- **teal.modules.hermes** - Modules to explore RNA-seq analysis
- **teal.modules.goshawk** - Modules to explore longitudinal clinical trial data
- **teal.modules.osprey** - Modules to explore community TLGs from the analysis of clinical trials data

## Folder structure

Each application has its own folder which should contain:

- `app.R` file that creates a `shiny::shinyApp` object.
- `renv.lock` file with up-to-date versions of the dependencies necessary to run the application
- `renv` boilerplate folder generated when running `renv::init()` with custom settings if required (such as Bioconductor version)
- `tests` folder with end-to-end tests
- `.Rprofile` generated when running `renv::init()`

Comment thread
llrs-roche marked this conversation as resolved.
## Deployment practices

The app deployment should be automated and allow for the update of dependencies in the teal framework to be kept up to date.
It also updates other dependencies to the latest version from CRAN.

The teal packages used differ from `stable` and `dev` deployment channels on the contents of `renv.lock` and `app.R` file.
The `app.R` file changes should follow the lastest changes and good practices from `teal`, which should be merge to `main` branch once they are released.

- `stable`: Using latest packages releases from CRAN and in cases that the package is not released on CRAN, use latest release channel
- in GitHub it should use `<organization>/<repository>@*release` tag to install from latest GitHub release
- The git branch for `stable` channel is `main`
- `dev`: Using latest development versions from `teal` framework and relevant packages (such as `rtables`, `mmrm`, `tern`, ...)
- The relevant packages should be added especially when there is active development that is closely associated with `teal`
- The git branch for `dev` channel is `dev`

When the update process or any of the end-to-end test fail, it should not re-deploy the app.

The CI/CD should be able to run in each Pull Request on GitHub to test every step with the exceptions of deployment and commiting.
If the pull request targets `main` it should run as if it was the `stable` channel.
When targeting `dev` branch it should run as the `dev` channel.

## Testing

There should be end-to-end tests testing the different applications using cypress.io.
It should cover:

- teal application starts without errors.
- teal application has X number of tabs.
- teal application can change to all tabs without errors.

## Quality Assurance

- **Use `tidyverse` style**: Write clear, readable code using `dplyr`, `ggplot2` patterns
- **Use `magrittr` pipes in reproducible execution**: For code executed for `teal_data`/`qenv` data objects with `eval_code()` and `within()`

## Code Review Process

- **Pull Request Reviews**: All changes require human review and approval
- **Automated Checks**: CI must pass before merging

3 changes: 3 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# teal.gallery Development Guide

The content is on @AGENTS.md
Loading