github-actions-dhall icon indicating copy to clipboard operation
github-actions-dhall copied to clipboard

Rename `actions/foo` to `actions.foo`?

Open JackKelly-Bellroy opened this issue 5 years ago • 2 comments

There are an increasing number of record keys of the form actions/foo. This gives a quasi-namespacing effect but maybe we want to push them into a separate record, since AFAIK we can't assemble record keys from Text or anything.

Should we have actions = { setup-haskell = ..., setup-java = ... } etc instead?

JackKelly-Bellroy avatar Aug 28 '20 10:08 JackKelly-Bellroy

A normalization would be very beneficial as we add more actions I'm pushing forward versioned actions

let step : ∀(ref : Text) → ∀(opts : Input.Type) → GithubActions.Step.Type

{- [...] -}

let `v1.8.0` = "f3364599c6aa293cdc2b8391b1b56d0c30e45c8a"

in { `v1.8.0` = step `v1.8.0`, step }

see https://github.com/SocialGouv/.github/blob/d77a500804bb164021edefb85b2de0da13a6c945/dhall/steps/docker/login-action/action.dhall#L56-L64

This might be another topic 🤔

douglasduteil avatar Apr 30 '21 09:04 douglasduteil

I don't want to rearrange the namespace if we'll end up wanting to rearrange it again, so it's probably worth talking about it now, at least for a little while. I find your example a little surprising as I'd expect actions.docker.login-action.`v1.8.0` to generate docker/[email protected], but it looks like it's splicing in an explicit git ref?

The design principles I'm thinking about lead me to a question:

  1. .steps.actions.foo should be a function taking arguments that match the action, generating a .Step.Type
  2. It might be nice to have a way to support "alternate" versions of actions, in case migration between two action major versions becomes difficult
  3. The obvious place to put these would be .steps.actions.foo.`vX.Y.Z`.
  4. This means we'd need .steps.actions.foo.default or something, because .steps.actions.foo needs to be a record.
  5. Do we get enough value from (4) to make everyone type .default on every other step, most of the time? If the default version of a step is unsuitable, then the programmer can always write a raw .Step::{ ... }.

I think that if we agree on an answer to (5), we get a good answer for how to proceed. Might be good if @regadas is able to weigh in, but he might be busy.

JackKelly-Bellroy avatar May 03 '21 00:05 JackKelly-Bellroy