Skip to content

Commit

Permalink
Let you specify beta group access to all builds at creation
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentisambart committed Aug 25, 2023
1 parent dbb84f9 commit 0a5c52e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions spaceship/lib/spaceship/connect_api/models/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -387,15 +387,16 @@ def get_beta_groups(client: nil, filter: {}, includes: nil, limit: nil, sort: ni
return resps.flat_map(&:to_models)
end

def create_beta_group(client: nil, group_name: nil, is_internal_group: false, public_link_enabled: false, public_link_limit: 10_000, public_link_limit_enabled: false)
def create_beta_group(client: nil, group_name: nil, is_internal_group: false, public_link_enabled: false, public_link_limit: 10_000, public_link_limit_enabled: false, has_access_to_all_builds: nil)
client ||= Spaceship::ConnectAPI
resps = client.create_beta_group(
app_id: id,
group_name: group_name,
is_internal_group: is_internal_group,
public_link_enabled: public_link_enabled,
public_link_limit: public_link_limit,
public_link_limit_enabled: public_link_limit_enabled
public_link_limit_enabled: public_link_limit_enabled,
has_access_to_all_builds: has_access_to_all_builds
).all_pages
return resps.flat_map(&:to_models).first
end
Expand Down
5 changes: 3 additions & 2 deletions spaceship/lib/spaceship/connect_api/testflight/testflight.rb
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,14 @@ def delete_beta_groups_from_build(build_id: nil, beta_group_ids: [])
test_flight_request_client.delete("builds/#{build_id}/relationships/betaGroups", nil, body)
end

def create_beta_group(app_id: nil, group_name: nil, is_internal_group: false, public_link_enabled: false, public_link_limit: 10_000, public_link_limit_enabled: false)
def create_beta_group(app_id: nil, group_name: nil, is_internal_group: false, public_link_enabled: false, public_link_limit: 10_000, public_link_limit_enabled: false, has_access_to_all_builds: nil)
has_access_to_all_builds = is_internal_group ? true : false if has_access_to_all_builds.nil?
body = {
data: {
attributes: {
name: group_name,
isInternalGroup: is_internal_group,
hasAccessToAllBuilds: is_internal_group ? true : false, # Undocumented of 2021-08-02 in ASC API docs and ASC Open API spec. This is the default behavior on App Store Connect and does work with both Apple ID and API Token
hasAccessToAllBuilds: has_access_to_all_builds, # Undocumented of 2021-08-02 in ASC API docs and ASC Open API spec. This is the default behavior on App Store Connect and does work with both Apple ID and API Token
publicLinkEnabled: public_link_enabled,
publicLinkLimit: public_link_limit,
publicLinkLimitEnabled: public_link_limit_enabled
Expand Down

0 comments on commit 0a5c52e

Please sign in to comment.