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

[feature:] setup github actions to build main branch and dev branch case studies #51

Open
2 of 3 tasks
k-doering-NOAA opened this issue Jan 15, 2025 · 4 comments
Open
2 of 3 tasks
Assignees
Labels
kind: feature New feature or request status: triage_needed This is not approved for this milestone, do not work on it yet

Comments

@k-doering-NOAA
Copy link
Member

k-doering-NOAA commented Jan 15, 2025

Describe the situation that led to the request and a solution

initiating GitHub actions to:

  • update the FIMS package to the latest main branch version and rerun the main branch of the case-studies repository on a regular basis (already set up this way)
  • update the FIMS pkg to the latest dev branch version and rerun the dev branch of the case-studies repository run on a regular basis, maybe even every push to dev
  • Have Kelli push the commit to set up the CRON jobs so that the email notifications go to her.

Alternative solutions

use the send email action to send Kelli notifications instead.

Statistical validity

No response

Additional context

No response

@k-doering-NOAA k-doering-NOAA added kind: feature New feature or request status: triage_needed This is not approved for this milestone, do not work on it yet labels Jan 15, 2025
@k-doering-NOAA k-doering-NOAA self-assigned this Jan 15, 2025
@k-doering-NOAA
Copy link
Member Author

@kellijohnson-NOAA , to make it so you can get a notification for the cron run, could you make a push to main that edits this line?

- cron: '0 0 * * 0' # runs At 00:00 on Sunday

For example, I think you could simply change the time at which it runs, e.g., At 01:30 on Sunday. Times are in UTC, I believe.

@k-doering-NOAA
Copy link
Member Author

@Bai-Li-NOAA I think you may be able to help here - I'm trying to figure out how to " update the FIMS pkg to the latest dev branch version and rerun the dev branch of the case-studies repository run on a regular basis, maybe even every push to dev".

It looks like the version of FIMS download is defined here:

remotes::install_github("NOAA-FIMS/FIMS")

By default, it will be installing the main branch. Can you think of a way to keep installation of FIMS in this file, but install the main version of FIMS if the GHA is running on main, and install the dev version of FIMS if the GHA is running on a branch called dev? One hacky solution would be to have the GHA on dev edit this file before it runs, it seems like there should be a more transparent way.

Other thoughts are I'm not sure what the default should be for feature branches, or if the case studies qmd is running on someone's local computer.

@kellijohnson-NOAA I think this question is for you: Is the goal of the dev branch for case studies is just a place for the dev version of FIMS to be installed, or will case study developments happen in dev before they are pushed to main?

@Bai-Li-NOAA
Copy link
Contributor

@k-doering-NOAA, I was thinking we could modify line 15 in the setup.qmd file with the following code to ensure that when folks are running case studies on a non-main branch, FIMS is always installed from the dev branch:

on_main_branch <- system("git branch --show-current") == "main"

if (on_main_branch){
  remotes::install_github("NOAA-FIMS/FIMS")
} else {
  remotes::install_github("NOAA-FIMS/FIMS", ref = "dev")
}

Not sure if this will work on all OSs or if the git command is usable in R setup on GitHub Actions. If that’s an issue, we could adjust the "Install packages" step in .github/workflows/render.yml to include remotes::install_github("NOAA-FIMS/FIMS", ref = "dev"). Let me know if you would like me to test either approach in a branch!

@kellijohnson-NOAA
Copy link
Contributor

@k-doering-NOAA regarding "Is the goal of the dev branch for case studies is just a place for the dev version of FIMS to be installed, or will case study developments happen in dev before they are pushed to main?" My response is I would like main to be static in between releases and have the case-studies repository operate a bit more like the FIMS repository where changes happen in branches off of dev and the pull requests go to dev. Then when there is a FIMS release, the case studies dev branch is ready to be merged into main at the same time.

kellijohnson-NOAA added a commit that referenced this issue Jan 16, 2025
Pushing to make sure that I get notifications from this GitHub action.
Part of #51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: feature New feature or request status: triage_needed This is not approved for this milestone, do not work on it yet
Projects
None yet
Development

No branches or pull requests

3 participants