Giter VIP home page Giter VIP logo

Comments (7)

pat-s avatar pat-s commented on July 30, 2024 1

tic.R is for R commands, not for system calls.
System libs (and similar required cli calls) need to be made in the YAML.
Theoretically you could call system() from within R though this would also need to happen conditionally on the OS - I would not recommend it.

When you say put it into a custom block, are you referring to make a R6 function as described in Developer Info: Custom Steps?

You can "escape" them by following https://docs.ropensci.org/tic/articles/updating.html.
A bit of reading is required to understand how it works. Let me know if things are still unclear, then we might need to tweak the docs.

from tic.

pat-s avatar pat-s commented on July 30, 2024 1

Thanks, such a detailed feedback is helpful!

there could be a description saying "Paste this anywhere in your tic.yml file directly, under steps, to install xquartz by homebrew (but only for macOS runners)"

I agree that in this case I assume that the reader is to some degree familiar what he/she is doing there and why it might be needed.
I find it a tough challenge to find the best level of detail when explaining such things - as writing too much (detailed) information also bloats the documentation.
This also applies to the your next point

but if you have a rec on a general guide, it might be helpful to have somewhere, "for a general introduction on yaml terminology see [LINK]"

I often get asked to explain the CI concept (and everything releated) from the basics again for people new to all of this.
I usually disagree because I believe that it is not the responsibility of such client packages to re-explain everything again - instead I believe that users (especially in R) need to invest some time to understand the basics of what they want to do.
Coming from an applied stats background I know the dangers of "oh this is so easy, I'll just do it but when I'm honest I've not really an idea what I am doing here".

So great, now that you know what an environment variable is (which is essential for CI stuff) and system libs vs. R packages, I believe everything makes more sense. 👍

But do not get me wrong - links to topics explaining these are very helpful and can be inserted quickly - and there is definitely potential for such in the doc.

But there again, it is hard for me to decided where to start/stop: do I need a link for explaining YAML? Do I need a link to explain what env vars are?
I know that many people here arriving have a different background and for some the terminilogy used might be new.

Thanks again for asking and reporting back - this issue might also help future readers.
Happy to take PRs/recs for improving the documentation :)

Closing here for now, feel free to discuss other unclear things in a new issue.

from tic.

pat-s avatar pat-s commented on July 30, 2024

brew cask install gfortran

Put it into a "custom block" if you want to have support for automated yaml updating.

from tic.

kuriwaki avatar kuriwaki commented on July 30, 2024

Great, it all worked once I added the following to my tic.yml manually.

- name: "[Stage] [macOS] Install gfortran afresh"
  if: runner.os == 'macOS'
  run: brew install --cask gfortran 

But I thought I should never want to manually edit tic.yml manually -- if I understand the goal of the tic package correctly. And I can't write add_step(get_stage("before_install"), ____) into my tic.R file because here what I want to put in is not R code, and it should be only if runner == "macOS".

When you say put it into a custom block, are you referring to make a R6 function as described in Developer Info: Custom Steps?

Any example appreciated as I'm still trying to grasp how tic functions affect the yaml.

from tic.

kuriwaki avatar kuriwaki commented on July 30, 2024

It seems like I should simply add "[Custom block]" in the name, and the ordering does not matter. e.g.

      - name: "[Stage] [macOS] [Custom block] Install gfortran afresh"
        if: runner.os == 'macOS'
        run: brew install --cask gfortran

and, if I understood correctly, this way it won't get deleted even if I change my template and run update_yml.

If the docs could be elaborated that would be great for me -- thank you. Some points that would have made my initial read of the docs much easier:

  • your point about system() being discouraged and I should edit the tic manually for system libraries
  • The Examples (https://docs.ropensci.org/tic/articles/updating.html#examples) were useful but it seemed like an assortment of the cases described (e.g. # [Custom header] and # [Custom block]) and it would be great to have a one-line description of what each does.
  • I still don't know what a custom env var is and if/when I would need to learn what it is

from tic.

pat-s avatar pat-s commented on July 30, 2024

it seems like I should simply add "[Custom block]" in the name, and the ordering does not matter. e.g.

and, if I understood correctly, this way it won't get deleted even if I change my template and run update_yml.

Correct!

your point about system() being discouraged and I should edit the tic manually for system libraries

I agree that this is probably not mentioned very cleary.
It is just a rec. of mine - no total "no".

it would be great to have a one-line description of what each does.

I can't follow what you mean by "what each does" 🤔
Essentially they prevent these YAML blocks from being stripped by update_yml()/use_update_tic().
You described this already in your comment so I assume(d) you understood their purpose - maybe you can clarify again where the misunderstanding here is?

I still don't know what a custom env var is and if/when I would need to learn what it is

A "custom env var" is an environment variable which follows the same logic as described above for "custom block". Is the misunderstanding here that you do not know what an env var is or elsewhere?

from tic.

kuriwaki avatar kuriwaki commented on July 30, 2024

Re:

it would be great to have a one-line description of what each does.

I thought a verbal translation of what each example is doing specifically would help (I already understand the general purpose of preventing things from getting stripped). Even though the page is under "Advanced", I as a non-advanced find myself trying to read it.

For example under this part,

image

there could be a description saying "Paste this anywhere in your tic.yml file directly, under steps, to install xquartz by homebrew (but only for macOS runners)"

Re:

Is the misunderstanding here that you do not know what an env var

I did not know what an env var was but I just read up elsewhere and now I think I have a sense. It's not the scope of the package to describe everything about yaml, but if you have a rec on a general guide, it might be helpful to have somewhere, "for a general introduction on yaml terminology see [LINK]"

Thanks again for responding line by line -- I think I'm resolved on the subject on this issue now.

from tic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.