You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add new machine types to response of GetWorkflowRunUsageByID #2595
Hi! As we're all probably aware, Github has added a bumch of different machine sizes to the actions runners. The timings endpoint returns these under keys like UBUNTU_4_CORE, etc. But the present version of this package only supports the 'vanilla' WINDOWS, MACOS and UBUNTU runners. It would be helpful to add the others if possible. Would obviously be a breaking change - not sure what the process is for handling that but happy to throw a PR together if someone can point me to all that.
I'm now wondering if instead of hard-coding these billing environments like we do now, we should instead make a flexible map where we don't restrict the key names, since GitHub at any time could add a new type of billing environment. In fact, their current documentation doesn't even mention the one you are showing, so this is very likely the case.
So instead of this:
// WorkflowRunUsage represents a usage of a specific workflow run.typeWorkflowRunUsagestruct {
Billable*WorkflowRunEnvironment`json:"billable,omitempty"`RunDurationMS*int64`json:"run_duration_ms,omitempty"`
}
// WorkflowRunEnvironment represents different runner environments available for a workflow run.typeWorkflowRunEnvironmentstruct {
Ubuntu*WorkflowRunBill`json:"UBUNTU,omitempty"`MacOS*WorkflowRunBill`json:"MACOS,omitempty"`Windows*WorkflowRunBill`json:"WINDOWS,omitempty"`
}
maybe this would make more sense?
// WorkflowRunUsage represents a usage of a specific workflow run.typeWorkflowRunUsagestruct {
Billablemap[string]*WorkflowRunBill`json:"billable,omitempty"`RunDurationMS*int64`json:"run_duration_ms,omitempty"`
}
Activity
gmlewis commentedon Dec 9, 2022
Thank you, @tragiclifestories !
I'm now wondering if instead of hard-coding these billing environments like we do now, we should instead make a flexible map where we don't restrict the key names, since GitHub at any time could add a new type of billing environment. In fact, their current documentation doesn't even mention the one you are showing, so this is very likely the case.
So instead of this:
maybe this would make more sense?
Thoughts?
tragiclifestories commentedon Dec 9, 2022
I think that's probably the way to go - surely only a matter of time before there's GPU machines and all sorts.
Of course, that becomes an even bigger API change for existing users ...
gmlewis commentedon Dec 9, 2022
OK, cool. Feel free to make a PR if you would like, @tragiclifestories - and this will force us to bump to version
v49.0.0.😄
Change actions billing structs to maps
Change actions billing structs to maps
Change actions billing structs to maps (#2597)
Change actions billing structs to maps (google#2597)