fastlane: Spaceship cannot set dataProtection, and nils out existing entries if you try

New Issue Checklist

Issue Description

Spaceship seems unable to set data_protection. Code snippet:

app = Spaceship::Portal.app.find(bundleId)
services = app.details.features
puts("Initial Features: " + services.to_s)
service = Spaceship::Portal::AppService.data_protection.until_first_auth
app.update_service(service)
app = Spaceship::Portal.app.find(bundleId)
services = app.details.features
puts("Updated Features: " + services.to_s)

Assuming the initial Features show “” for data protection, the updated features will as well, like so:

Initial Features: {"push"=>true, "iCloud"=>false, "inAppPurchase"=>true, "gameCenter"=>true, "LPLF93JG7M"=>false, "passbook"=>false, "IAD53UNK2F"=>false, "V66P55NK2I"=>false, "dataProtection"=>"", "SKC3T5S89Y"=>false, "APG3427HIY"=>true, "HK421J6T7P"=>false, "homeKit"=>false, "WC421J6T7P"=>false, "cloudKitVersion"=>2, "AWEQ28MY3E"=>true}
Updated Features: {"push"=>true, "iCloud"=>false, "inAppPurchase"=>true, "gameCenter"=>true, "LPLF93JG7M"=>false, "passbook"=>false, "IAD53UNK2F"=>false, "V66P55NK2I"=>false, "dataProtection"=>"", "SKC3T5S89Y"=>false, "APG3427HIY"=>true, "HK421J6T7P"=>false, "homeKit"=>false, "WC421J6T7P"=>false, "cloudKitVersion"=>2, "AWEQ28MY3E"=>true}

Notice "dataProtection"=>"" in both cases.

When run against an app that has a dataProtection value, attempting an update will turn that value into the empty string.

Full script
require "spaceship"

appleId = "you@domain.com"
bundleId = "com.domain.portalTest"


def loginOrFail(appleId)

    if appleId.nil?
        puts "You must supply your Apple Developer Portal credentials."
        exit(false)
    end

    begin
        puts("Logging in as " + appleId)
        Spaceship::Portal.login(appleId)

    rescue
        puts "Login has failed. Your username/password may be incorrect."
        exit(false)
    end

    # Just in case the user is a member of multiple teams
    Spaceship::Portal.select_team
    return true
end


begin
    loginOrFail(appleId)
rescue
    abort("Unable to log in.")
end

app = Spaceship::Portal.app.find(bundleId)
if app.nil?
    puts("Could not find an app with bundleId '" + bundleId + "' on the portal.")
    exit(2)
end

services = app.details.features
puts("Initial Features: " + services.to_s)

service = Spaceship::Portal::AppService.data_protection.until_first_auth

puts(service.service_uri.to_s)
puts(service.service_id.to_s)
puts(service.value.to_s)

app.update_service(service)

updatedApp = Spaceship::Portal.app.find(bundleId)
if updatedApp.nil?
    puts("Could not find an app with bundleId '" + bundleId + "' on the portal.")
    exit(2)
end

newServices = updatedApp.details.features
puts("Updated Features: " + newServices.to_s)

Environment

I am specifically scripting just Spaceship, and not using Fastlane on my projects. So fastlane -env does nothing in my current environment, other than try to configure a fastlane directory for a non-existent project.

If there is an alternate thing I can do to supply info you need, please let me know.

  • fastlane --version returns fastlane 2.146.1
  • fastlane spaceship --version returns spaceship 2.146.1

Edit I installed fastlane into a different folder so I could get env:

✅ fastlane environment ✅

Stack

Key Value
OS 10.15.4
Ruby 2.6.3
Bundler? false
Git git version 2.24.2 (Apple Git-127)
Installation Source /usr/local/bin/fastlane
Host Mac OS X 10.15.4 (19E287)
Ruby Lib Dir /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib
OpenSSL Version LibreSSL 2.8.3
Is contained false
Is homebrew false
Is installed via Fabric.app false
Xcode Path /Applications/Xcode.app/Contents/Developer/
Xcode Version 11.4.1

System Locale

Variable Value
LANG en_US.UTF-8
LC_ALL
LANGUAGE

fastlane files:

`./fastlane/Fastfile`
# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
#     https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
#     https://docs.fastlane.tools/plugins/available-plugins
#

# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane

default_platform(:ios)

platform :ios do
  desc "Description of what the lane does"
  lane :custom_lane do
    # add actions here: https://docs.fastlane.tools/actions
  end
end

`./fastlane/Appfile`
# app_identifier("[[APP_IDENTIFIER]]") # The bundle identifier of your app
# apple_id("[[APPLE_ID]]") # Your Apple email address


# For more information about the Appfile, see:
#     https://docs.fastlane.tools/advanced/#appfile

fastlane gems

Gem Version Update-Status
fastlane 2.146.1 ✅ Up-To-Date

Loaded fastlane plugins:

No plugins Loaded

Loaded gems
Gem Version
did_you_mean 1.4.0
slack-notifier 2.3.2
rouge 2.0.7
xcpretty 0.3.0
terminal-notifier 2.0.0
terminal-table 1.8.0
plist 3.5.0
addressable 2.7.0
multipart-post 2.0.0
word_wrap 1.0.0
public_suffix 2.0.5
babosa 1.0.3
colored 1.2
highline 1.7.10
commander-fastlane 4.4.6
faraday 0.17.3
unf 0.1.4
domain_name 0.5.20190701
http-cookie 1.0.3
faraday-cookie_jar 0.0.6
faraday_middleware 0.13.1
fastimage 2.1.7
gh_inspector 1.1.3
multi_xml 0.6.0
rubyzip 1.3.0
security 0.1.3
xcpretty-travis-formatter 1.0.0
dotenv 2.7.5
bundler 2.1.4
jwt 2.1.0
uber 0.1.0
declarative 0.0.10
declarative-option 0.1.0
representable 3.0.4
retriable 3.1.2
mini_mime 1.0.2
httpclient 2.8.3
google-api-client 0.36.4
emoji_regex 1.0.1
nanaimo 0.2.6
colored2 3.1.2
claide 1.0.3
CFPropertyList 3.0.2
atomos 0.1.3
xcodeproj 1.16.0
unicode-display_width 1.7.0
tty-screen 0.7.1
tty-cursor 0.7.1
tty-spinner 0.9.3
excon 0.73.0
unf_ext 0.0.7.7
json 2.3.0
mini_magick 4.10.1
naturally 2.2.0
simctl 1.6.8
multi_json 1.14.1
signet 0.14.0
os 1.1.0
memoist 0.16.2
googleauth 0.12.0
digest-crc 0.5.1
google-cloud-errors 1.0.0
google-cloud-env 1.3.1
google-cloud-core 1.5.0
google-cloud-storage 1.26.1
aws-eventstream 1.1.0
aws-sigv4 1.1.3
aws-partitions 1.310.0
jmespath 1.4.0
aws-sdk-core 3.94.1
aws-sdk-kms 1.30.0
aws-sdk-s3 1.63.1
forwardable 1.3.1
logger 1.4.2
stringio 0.1.0
ipaddr 1.2.2
openssl 2.1.2
ostruct 0.1.0
strscan 1.0.3
date 3.0.0
fileutils 1.4.1
io-console 0.5.6
zlib 1.1.0
libxml-ruby 3.1.0
rexml 3.2.4
psych 3.1.0
mutex_m 0.1.0
webrick 1.6.0

generated on: 2020-05-07

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 26 (5 by maintainers)

Most upvoted comments

hello,I can not use “fastlane sigh -a xxx -u xxx -q “xxx” --force --adhoc”, terminal puts [!] Please login using Spaceship::Portal.login('user', 'password').I tried a lot of method ,but does not worked. please look picture . thanks image