Skip to content

Render each case study separately - #117

Merged
iantaylor-NOAA merged 40 commits into
mainfrom
render-case-studies-separately
Aug 4, 2026
Merged

Render each case study separately#117
iantaylor-NOAA merged 40 commits into
mainfrom
render-case-studies-separately

Conversation

@e-perl-NOAA

@e-perl-NOAA e-perl-NOAA commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

@kellijohnson-NOAA While this is not exactly the logic you outlined in #113, it does have some similarities and makes it so that you don't have to manually update workflow names for specific case studies

Right now none of the case studies are rendering because of the following error, is that error the same one we saw in code club yesterday due to changes in FIMS? If so, I think I missed what the fix was...though looking back it's changing fleet_name to fleet?

Error in `FIMS::FIMSFrame()`:
! Check the columns of your data, the following are missing:
data must contain 'fleet'
Backtrace:
    ▆
 1. └─global prepare_pollock_data(...)
 2.   └─FIMS::FIMSFrame(res)

1. Render Case Studies workflow

  • triggered on push to main (and everything else right now to test) or pull request to main when anything in content/** changes
  • build matrix of case studies qmd files
  • render separately via matrix the case studies
  • records status of successful or failing
  • uploads successful artifacts
  • uploads status artifacts
  • upload artifacts for successful ones
  • the action will fail if any case study doesn't render BUT will still create artifacts

2. Deploy Case Studies workflow

  • triggered by the render case studies workflow finishing if it's on a push to main REGARDLESS of the status of the render
  • downloads the artifacts produced by the render workflow
  • gets the current website docs from gh-pages
  • overlays website with successful case studies renders
  • gets artifacts of status
  • updates the readme with the status
  • creates PR for the updated readme
  • deploys site to gh-pages with updated case studies

3. Render and Deploy Full Site workflow

  • Only on push to main for everything BUT the case studies
  • Builds site
  • Grabs current gh-pages site and gets the case studies
  • Combines the new site with the case studies from the current gh-pages
  • Uploads artifact and deploys the site

4. Removes previous build and deploy case studies workflow

@e-perl-NOAA e-perl-NOAA added the github_actions Pull requests that update GitHub Actions code label Jul 22, 2026

@iantaylor-NOAA iantaylor-NOAA left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@e-perl-NOAA, thanks for working on this. I can do a more detailed review later, but if the GOA pollock error is causing none of the case studies to render, then we might need to rethink the approach. My hope was that whichever case studies successfully render could be published while producing a warning or notification listing any case studies that failed.

@e-perl-NOAA

e-perl-NOAA commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

@iantaylor-NOAA, the GOA pollock one as well as the other ones are all failing, they mostly have the same error about fleet that I included above (though petrale has a stockplotr one and hake has a different one). The action still runs each qmd separately regardless of if others fail.

Petrale error:

Error in `stockplotr::convert_output()`:
Invalid URL.
Backtrace:
    ▆
 1. └─stockplotr::convert_output(...)
 2.   └─cli::cli_abort(c(message = "Invalid URL."))
 3.     └─rlang::abort(...)

Quitting from NWFSC-petrale.qmd:37-69 [setup-objects]
Execution halted
WARN: Error encountered when rendering files

Hake error:

Error in `dplyr::mutate()`:
ℹ In argument: `uncertainty = ifelse(...)`.
Caused by error:
! object 'name' not found
Backtrace:
     ▆
  1. ├─dplyr::mutate(...)
  2. ├─dplyr:::mutate.data.frame(...)
  3. │ └─dplyr:::mutate_cols(.data, dplyr_quosures(...), by)
  4. │   ├─base::withCallingHandlers(...)
  5. │   └─dplyr:::mutate_col(dots[[i]], data, mask, new_columns)
  6. │     └─mask$eval_all_mutate(quo)
  7. │       └─dplyr (local) eval()
  8. ├─base::ifelse(...)
  9. └─base::.handleSimpleError(`<fn>`, "object 'name' not found", base::quote(NULL))
 10.   └─dplyr (local) h(simpleError(msg, call))
 11.     └─rlang::abort(message, class = error_class, parent = parent, call = error_call)

Quitting from pacific-hake.qmd:93-133 [prepare-fims-data]

@iantaylor-NOAA

Copy link
Copy Markdown
Contributor

@e-perl-NOAA, I can try to clean up these errors to get them working again. That way we can focus on refining the workflow instead of having everything fail. Do you think it's better to push fixes to this branch or a separate one? Pushing here avoids requiring this to rebase, but also makes changes more complex to review.

@e-perl-NOAA

Copy link
Copy Markdown
Contributor Author

I'm fine with changes being made to this branch to get the case studies working. Really we just need one working to show proof of concept.

@e-perl-NOAA
e-perl-NOAA force-pushed the render-case-studies-separately branch from bf7b4d7 to 4043e94 Compare July 23, 2026 13:54
@e-perl-NOAA

Copy link
Copy Markdown
Contributor Author

Some of the case studies are rendering which is good enough for a test of the deploy which I was able to do and create an artifact here

@iantaylor-NOAA

Copy link
Copy Markdown
Contributor

@e-perl-NOAA, the opakapaka, petrale, and sardine qmd files are now all running through the rendering step but run into errors with "Upload rendered artifact" like the following, copied from https://github.com/NOAA-FIMS/case-studies/actions/runs/30409569678/job/90442603805. Any ideas on what needs to change?

Node 20 is being deprecated. This workflow is running with Node 24 by default. If you need to temporarily use Node 20, you can set the ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION=true environment variable. For more information see: https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/
Run actions/upload-artifact@v4
  with:
    name: SWFSC-sardine-site
    path: _site
    if-no-files-found: error
    compression-level: 6
    overwrite: false
    include-hidden-files: false
  env:
    R_LIBS_USER: /home/runner/work/_temp/Library
    TZ: UTC
    _R_CHECK_SYSTEM_CLOCK_: FALSE
    NOT_CRAN: true
    RSPM: https://packagemanager.posit.co/cran/__linux__/noble/latest
    RENV_CONFIG_REPOS_OVERRIDE: https://packagemanager.posit.co/cran/__linux__/noble/latest
    R_LIB_FOR_PAK: /home/runner/work/case-studies/case-studies/renv/library/linux-ubuntu-noble/R-4.6/x86_64-pc-linux-gnu
    BUNDLE_EXT: linux-amd64.deb
(node:10890) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Error: No files were found with the provided path: _site. No artifacts will be uploaded.

@e-perl-NOAA

Copy link
Copy Markdown
Contributor Author

@iantaylor-NOAA

In the _quarto.yml file, only the following are actually included in the quarto site:

project:
type: website
render:
- index.qmd
- content/AFSC-GOA-pollock.qmd
- content/NEFSC-yellowtail.qmd
- content/pacific-hake.qmd
- content/acknowledgements.qmd

So those aren't actually deployed/used for the website despite being rendered. I don't do enough with the case studies to know if they should be rendered and included in the _quarto.yml file ... @kellijohnson-NOAA?

@iantaylor-NOAA

Copy link
Copy Markdown
Contributor

@e-perl-NOAA and @kellijohnson-NOAA, I think it makes sense that the final published site only includes the case studies that we humans choose to include (via _quarto.yml as you say), where the choice of what we include will evolve over time. However, I think it's really valuable to see which of the case studies are passing and failing, whether we choose to include them in the published site or not.

The Error: No files were found with the provided path: _site. No artifacts will be uploaded. doesn't seem to have anything to do with the FIMS or R code for those failing case studies, rather the design of the github action, so hopefully we can find a way to make it work.

…tifact

Added a check for published case studies before uploading artifacts.
Retain existing files during deployment to gh-pages.
@e-perl-NOAA

Copy link
Copy Markdown
Contributor Author

@iantaylor-NOAA I made some changes so that there aren't failures when it doesn't upload artifacts for case studies not included in the _quarto.yml file.

- name to fleet
- fleet_name to fleet
- replace set_all_estimable() and set_all_random() with set_estimation_types()
@iantaylor-NOAA

Copy link
Copy Markdown
Contributor

@e-perl-NOAA, this is perfect, thank you!

@kellijohnson-NOAA, pacific hake was the only one that was still failing, and I've attempted some changes in 16303fe but am not confident about how I've changed set_all_estimable() and set_all_random() to set_estimation_types(), so please refine as appropriate when you have time.

@iantaylor-NOAA

Copy link
Copy Markdown
Contributor

Looks like my changes to pacific hake now have everything passing in the Render Case Studies GHA. I'm not sure if there's a way to test the Deploy Case Studies GHA before merging this PR since I think it depends on push to main, but as far as I'm concerned, we can merge this any time and revise from there. It doesn't seem like a big deal with we temporarily break the case-studies github.io site for a little while at this stage of FIMS development.

I see that @kellijohnson-NOAA is out today, so probably better to give her final say on when this is ready.

Thanks for all your work on this @e-perl-NOAA!

@kellijohnson-NOAA

Copy link
Copy Markdown
Contributor

I glanced this over quickly. The only thing that is slightly concerning to me, not a blocker though, is the addition of code that is not functionized to the R folder. Everything still works because the default is to not run it, i.e., if (FALSE) {}, but that part of the code should really be in the petrale.qmd file in a code chunk. @iantaylor-NOAA feel free to merge in now and change that later though.

@e-perl-NOAA

Copy link
Copy Markdown
Contributor Author

@iantaylor-NOAA, if you merge this in and get the message that the deploy workflow has failed, please let me know and I'll work on trying to fix it. Anything in terms of deploying to a github site is hard to test because you often don't want the test deployed to the main site. I found a way around this for the fims website but not all site need a preview feature. However if you would find it useful to have a preview workflow/feature in this repo too, let me know.

@iantaylor-NOAA

Copy link
Copy Markdown
Contributor

Thanks @kellijohnson-NOAA. I modified (in 579db39) the \content\R\NWFSC-petrale_simplify_assessment.R script to be a function instead of wrapping in if(FALSE){}. Since that function will not be called anywhere, it's essentially the same outcome but better coding practices, so I'm not going to ask you to look over the changes before merging. As you note, we can evolve from here as needed.

@iantaylor-NOAA
iantaylor-NOAA merged commit 8e7fbf9 into main Aug 4, 2026
8 checks passed
@iantaylor-NOAA
iantaylor-NOAA deleted the render-case-studies-separately branch August 4, 2026 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github_actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants