-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement sync testflight config command #203
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks promising so far.
Sources/AppStoreConnectCLI/Commands/TestFlight/Sync/TestFlightPullCommand.swift
Outdated
Show resolved
Hide resolved
Sources/AppStoreConnectCLI/Commands/TestFlight/Sync/TestFlightPullCommand.swift
Outdated
Show resolved
Hide resolved
Sources/AppStoreConnectCLI/Commands/TestFlight/Sync/TestFlightPullCommand.swift
Outdated
Show resolved
Hide resolved
Sources/AppStoreConnectCLI/Commands/TestFlight/Sync/TestFlightPushCommand.swift
Outdated
Show resolved
Hide resolved
Sources/AppStoreConnectCLI/Commands/TestFlight/Sync/TestFlightPushCommand.swift
Outdated
Show resolved
Hide resolved
Tests/appstoreconnect-cliTests/Sync/SyncTestFlightTestersTests.swift
Outdated
Show resolved
Hide resolved
Tests/appstoreconnect-cliTests/Sync/SyncTestFlightTestersTests.swift
Outdated
Show resolved
Hide resolved
Sources/AppStoreConnectCLI/Services/SyncResourceComparator.swift
Outdated
Show resolved
Hide resolved
16abb0f
to
a4388f4
Compare
try appsFolder.delete() | ||
|
||
try config.forEach { | ||
let appFolder = try appsFolder.createSubfolder(named: $0.app.bundleId!) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Force unwrapping this here seems not ideal. Can an app actually have a nil bundleId? Seems unlikely.
Tests/appstoreconnect-cliTests/Sync/ResourceComparatorCompareGroupsTests.swift
Outdated
Show resolved
Hide resolved
Tests/appstoreconnect-cliTests/Sync/ResourceComparatorCompareGroupsTests.swift
Outdated
Show resolved
Hide resolved
Tests/appstoreconnect-cliTests/Sync/ResourceComparatorCompareGroupsTests.swift
Outdated
Show resolved
Hide resolved
Sources/AppStoreConnectCLI/Commands/TestFlight/Sync/TestFlightPullCommand.swift
Outdated
Show resolved
Hide resolved
Sources/AppStoreConnectCLI/Services/AppStoreConnectService.swift
Outdated
Show resolved
Hide resolved
@@ -798,6 +914,54 @@ class AppStoreConnectService { | |||
.await() | |||
} | |||
|
|||
func pullTestFlightConfigs() throws -> [TestFlightConfiguration] { | |||
let apps = try listApps(bundleIds: [], names: [], skus: [], limit: nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will need to support pulling a subset of apps (filtered by bundleIds probably).
default: "./config/apps", | ||
help: "Path to the folder containing the TestFlight configuration." | ||
) var outputPath: String | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be able to filter the pulled apps by bundleId.
Sources/AppStoreConnectCLI/Commands/TestFlight/Sync/TestFlightPushCommand.swift
Outdated
Show resolved
Hide resolved
Sources/AppStoreConnectCLI/Commands/TestFlight/Sync/TestFlightPushCommand.swift
Outdated
Show resolved
Hide resolved
@Flag(help: "Perform a dry run.") | ||
var dryRun: Bool | ||
|
||
func run() throws { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the fundamental problem with this command is that you're executing the service requests as you're processing. This should be more functional. Eg:
compute(localState, remoteState) -> changeSet
execute(changeSet, isDryRun) -> ()
c103531
to
5be708c
Compare
ae25314
to
3e4f8fe
Compare
Implement Sync TestFlight Configuration Command for syncing local and server TestFlight configs.
Support:
📝 Summary of Changes
Changes proposed in this pull request:
TestFlightConfigLoader
andTestFlightConfiguration
BetaGroup
andBetaTester
in new FileSystem moduleSyncResourceComparator
for comparing local and server resourcesDue to the number of API calls, the pull config from server command will take a considerable amount of time.
Limitations:
🧐🗒 Reviewer Notes
💁 Example
Usage:
asc testflight sync pull [--output-path <output-path>]
asc testflight sync push [--input-path <input-path>] [--dry-run] [--refresh-local]
🔨 How To Test
swift run asc testflight sync pull
swift run asc testflight sync push --dry-run
swift run asc testflight sync push