Skip to content

Gdr 3286#189

Merged
darsoo merged 8 commits intomainfrom
GDR-3286
Feb 17, 2026
Merged

Gdr 3286#189
darsoo merged 8 commits intomainfrom
GDR-3286

Conversation

@darsoo
Copy link
Contributor

@darsoo darsoo commented Feb 16, 2026

Description

What changed?

Related JIRA issue: GDR-3286

Why was it changed?

More info in discusion in analogous PR: gdrplatform/gDRimport#114

Logistic checklist

  • Package version bumped
  • Changelog updated

@darsoo darsoo requested a review from a team as a code owner February 16, 2026 18:21
@darsoo darsoo requested review from bczech, gladkia and j-smola and removed request for a team February 16, 2026 18:21
@gemini-code-assist
Copy link

Summary of Changes

Hello @darsoo, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request primarily focuses on refactoring the package's internal structure by consolidating initialization logic and global variable declarations into a dedicated R/zzz.R file. This change was implemented to resolve byte-compilation warnings and improve code organization. The package version has been incremented, and minor updates were applied to vignette code chunk labels for clarity.

Highlights

  • Package Initialization Refactoring: The package initialization logic, including the .onLoad function and global variable declarations, was refactored and moved from R/packages.R and R/constants.R into a new R/zzz.R file.
  • Byte-Compilation Warning Fix: Stack imbalance warnings encountered during byte-compilation were addressed, as noted in the updated changelog.
  • Version Bump: The package version was updated to 1.9.5 and the release date was adjusted in both DESCRIPTION and NEWS.md.
  • Vignette Code Chunk Naming: Unnamed R code chunks in several vignettes (gDR-annotation.Rmd, gDRcore.Rmd) were renamed to more descriptive labels for improved readability and maintainability.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • DESCRIPTION
    • Version updated from 1.9.4 to 1.9.5.
    • Date updated to 2026-02-16.
  • NEWS.md
    • Added a new entry for gDRcore 1.9.5 detailing the fix for stack imbalance warnings during byte-compilation.
  • R/constants.R
    • Removed the file containing constant definitions.
  • R/packages.R
    • Removed the .onLoad function, patterns assignment, and globalVariables calls.
  • R/zzz.R
    • Added a new file containing the .onLoad function, initialization of constants (.drugNameRegex, .untreated_tag_patterns, .untreatedDrugNameRegex, patterns), and globalVariables declarations.
  • vignettes/gDR-annotation.Rmd
    • Renamed R code chunks from generic to descriptive names like init, set_envvar, set_envvar_2, and annotation.
  • vignettes/gDR-data-model.Rmd
    • Updated the VignetteIndexEntry from "Vignette Title" to "gDRcore".
  • vignettes/gDRcore.Rmd
    • Renamed R code chunks from generic to descriptive names like init, get_testdata, load_data, run_pipeline, mae, and single-agent.
Activity
  • Linked to JIRA issue GDR-3286.
  • Referenced an analogous pull request in gDRimport for additional context.
  • Completed logistic checklist items, including bumping the package version and updating the changelog.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the package loading mechanism to resolve byte-compilation warnings. The changes involve moving initialization code from R/constants.R and R/packages.R into a new R/zzz.R file, using the .onLoad hook. This is a good approach. I've suggested a minor improvement to use assignInNamespace() instead of <<- for modifying the package namespace, which is considered a best practice for clarity and safety. The updates to the vignettes to name R chunks are also a welcome improvement for maintainability.

Copy link
Contributor

@j-smola j-smola left a comment

Choose a reason for hiding this comment

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

What is the role of zzz.R file? Why this function was moved from packages.R? Why globalVariables was hidden in .onLoad?

@darsoo
Copy link
Contributor Author

darsoo commented Feb 17, 2026

What is the role of zzz.R file? Why this function was moved from packages.R? Why globalVariables was hidden in .onLoad?

Keeping .onLoad in zzz.R is a typical practice in R. It allows this function to be called last after everything is loaded. This was done to minimize the amount of code retrieved outside of functions, especially calls to functions from other packages with a namespace prefix.

@darsoo darsoo merged commit b003686 into main Feb 17, 2026
3 of 4 checks passed
@darsoo darsoo deleted the GDR-3286 branch February 17, 2026 11:45
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