Skip to content

Conversation

@Schiano-NOAA
Copy link
Collaborator

  • add ghaction workflow for automating example data and create script to run
  • assures that the example data is always up to date with asar::convert_output()
  • might be able to change tests to use this example data instead

# Defaults to checking out the current repo (Repo B) into the workspace root

- name: Install R and dependencies (Example)
uses: r-lib/actions/setup-r@v2

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow Medium

Unpinned 3rd party Action '2. Run Function from Released Package' step
Uses Step
uses 'r-lib/actions/setup-r' with ref 'v2', not a pinned commit hash
@Schiano-NOAA
Copy link
Collaborator Author

@k-doering-NOAA any help/advice with this action is also appreciated! This is the one that the asar action is linked to

@github-actions
Copy link
Contributor

Code Metrics Report

Coverage Code to Test Ratio Test Execution Time
74.9% 1:0.2 42s

Reported by octocov

@Schiano-NOAA Schiano-NOAA marked this pull request as draft October 17, 2025 18:31
@k-doering-NOAA
Copy link
Contributor

@Schiano-NOAA Happy to take a look by COB Nov 21 - does that work for you?

@Schiano-NOAA
Copy link
Collaborator Author

@k-doering-NOAA that works great! If you need more time though, there is no time crunch for this feature and can get pushed into December. Thanks :)

@k-doering-NOAA
Copy link
Contributor

Thanks @Schiano-NOAA, I think I will take you up on pushing this to Dec! I'll get it done by 12/5.

@Schiano-NOAA
Copy link
Collaborator Author

@e-perl-NOAA

@e-perl-NOAA
Copy link
Contributor

@Schiano-NOAA Is this GHA working for you? Like have you tested it and have it do what you wanted? Because this looks good to me, you have the action you need in ASAR, and then this. If not, I fork repos to test new GHAs with them and troubleshoot them there. The warning from github you are seeing is just a suggestion, most of our workflows aren't using a specific hash.

@Schiano-NOAA
Copy link
Collaborator Author

@Schiano-NOAA Is this GHA working for you? Like have you tested it and have it do what you wanted? Because this looks good to me, you have the action you need in ASAR, and then this. If not, I fork repos to test new GHAs with them and troubleshoot them there. The warning from github you are seeing is just a suggestion, most of our workflows aren't using a specific hash.

Ah okay that makes sense! I haven't tried it out as I wasn't sure how I could test it. The forking makes a lot of sense and I could probably try it out that way.

@e-perl-NOAA
Copy link
Contributor

Yeah, with GHA's you never really know until you test it. Just make sure you enable GHAs on your forks. I also have a separate GHA test repo for testing actions that are less complicated and don't require direct repo access.

@k-doering-NOAA
Copy link
Contributor

Linking the corresponding ASAR action: nmfs-ost/asar#385

I agree with with @e-perl-NOAA that testing it (or testing a simpler version with a similar structure) is the only way to know. It looks ok, but I'm assuming this was partially AI generated based on the comments. For me, I've found that the gemini created github actions\ are a helpful starting point, but it sometimes gets some details wrong. Testing helps you know for sure if complicated set-ups like this will work!

Let me know if you would like some help testing it in an example repo or in forked versions of the real repositories. Perhaps we can schedule some coworking time to set it up!

@Schiano-NOAA
Copy link
Collaborator Author

@k-doering-NOAA This is super helpful to know! I think setting up some coworking time would be super helpful to me. While I can fork these repos and try to test it out, I do not know where to start to approach it to make it simpler. I used Gemini to help me link it and when making correction, I found myself worried that I would stray from parts that were necessary to the action (without me really understanding it).

@k-doering-NOAA
Copy link
Contributor

just sent a coworking invite!

@Schiano-NOAA
Copy link
Collaborator Author

@k-doering-NOAA Sophie and I had a discussion and we will be moving convert_output from asar into stockplotr soon. In light of this news, it would be helpful in our coworking time to adjust this action to run the conver_output function then within the package to update the example data on each new release of stockplotr. This I think should be a more straightforward action.

Thanks for your help!

@Bai-Li-NOAA
Copy link
Collaborator

@Schiano-NOAA and @k-doering-NOAA , I’m working on some tasks I owe {ghactions4r} and realized I’ve already written a GHA that might be adaptable here 🤣. The main workflow is update-data-r.yml, and I call it from call-update-data-r.yml. These workflows automatically detect changes in /data-raw, update the corresponding files in /data, and commit the changes directly to the working branch.

@Schiano-NOAA
Copy link
Collaborator Author

@Bai-Li-NOAA Ooo that does sound like it would align very well!

@k-doering-NOAA
Copy link
Contributor

Oh, awesome!! @Schiano-NOAA if everything is in 1 repo, that will be much easier to deal with (and maintain over time!)

@Bai-Li-NOAA maybe we could try using your reusable workflow? Either where it is now or once it is in ghactions4r?

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.

5 participants