Skip to content

Add new machine types to response of GetWorkflowRunUsageByID #2595

Closed

Description

@tragiclifestories

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.

Activity

  1. gmlewis commented on Dec 9, 2022

    @gmlewis
    Collaborator

    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:

    // WorkflowRunUsage represents a usage of a specific workflow run.
    type WorkflowRunUsage struct {
    	Billable      *WorkflowRunEnvironment `json:"billable,omitempty"`
    	RunDurationMS *int64                  `json:"run_duration_ms,omitempty"`
    }
    
    // WorkflowRunEnvironment represents different runner environments available for a workflow run.
    type WorkflowRunEnvironment struct {
    	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.
    type WorkflowRunUsage struct {
    	Billable      map[string]*WorkflowRunBill `json:"billable,omitempty"`
    	RunDurationMS *int64                  `json:"run_duration_ms,omitempty"`
    }

    Thoughts?

  2. tragiclifestories commented on Dec 9, 2022

    @tragiclifestories
    ContributorAuthor

    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 ...

  3. gmlewis commented on Dec 9, 2022

    @gmlewis
    Collaborator

    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.
    😄

  4. added a commit that references this issue on Dec 13, 2022
    f666662
  5. added
    Breaking API Change
    on Dec 13, 2022
  6. added a commit that references this issue on Dec 14, 2022
    5b2e965
  7. added a commit that references this issue on Dec 26, 2022
    84cc7d5
  8. added a commit that references this issue on Jun 28, 2026
    c8368c5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Breaking API Change

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions