Skip to content
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

#2525 Use macos-xcode15 image on semaphore #2527

Merged
merged 20 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: FlowCrypt iOS App
agent:
machine:
type: a1-standard-4
os_image: macos-xcode14
os_image: macos-xcode15
execution_time_limit:
minutes: 120
auto_cancel:
Expand Down Expand Up @@ -53,7 +53,6 @@ blocks:
prologue:
commands:
- checkout && cd ~/git/flowcrypt-ios/
- sem-version node 18
- ( cache restore common-npm && npm install && cache store common-npm node_modules )
- ( cd Core && cache restore core-npm && npm install && cache store core-npm node_modules )
- ( cd appium && cache restore appium-npm && npm install && cache store appium-npm node_modules )
Expand All @@ -78,7 +77,7 @@ blocks:
commands:
- checkout && cd ~/git/flowcrypt-ios/
- mv ~/appium-env ~/git/flowcrypt-ios/appium/.env
- sem-version node 20 && cache restore appium-npm && cd ./appium && npm i && cd .. && cache store appium-npm appium/node_modules
- cache restore appium-npm && cd ./appium && npm i && cd .. && cache store appium-npm appium/node_modules
- cd appium
- cache restore FlowCrypt-$SEMAPHORE_GIT_SHA.app
epilogue:
Expand Down
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.8
5.9
227 changes: 115 additions & 112 deletions Core/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion FlowCrypt.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3937,7 +3937,7 @@
repositoryURL = "https://github.com/relatedcode/ProgressHUD.git";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 13.8.6;
minimumVersion = 14.1.1;
};
};
/* End XCRemoteSwiftPackageReference section */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"originHash" : "930974f9ce515f09fa3552320baa442235c0c0ec32152803c76222b16efa82a4",
"pins" : [
{
"identity" : "appauth-ios",
"kind" : "remoteSourceControl",
"location" : "https://github.com/openid/AppAuth-iOS.git",
"state" : {
"revision" : "71cde449f13d453227e687458144bde372d30fc7",
"version" : "1.6.2"
"revision" : "7e2c09cbeb3bb799f26c268dbedb26325ea722a9",
"version" : "1.7.3"
}
},
{
Expand Down Expand Up @@ -50,8 +51,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/gtm-session-fetcher.git",
"state" : {
"revision" : "76135c9f4e1ac85459d5fec61b6f76ac47ab3a4c",
"version" : "3.3.1"
"revision" : "9534039303015a84837090d20fa21cae6e5eadb6",
"version" : "3.3.2"
}
},
{
Expand Down Expand Up @@ -86,26 +87,26 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/relatedcode/ProgressHUD.git",
"state" : {
"revision" : "46792db49f80454879a939f9b2be31bb61c37b0c",
"version" : "13.8.6"
"revision" : "fd18c75d5f650a949e1da5fc725a1c1b523bbf8e",
"version" : "14.1.1"
}
},
{
"identity" : "realm-cocoa",
"kind" : "remoteSourceControl",
"location" : "https://github.com/realm/realm-cocoa",
"state" : {
"revision" : "55466ae0fb29c5f21866792f05c1fc0c590d7c29",
"version" : "10.47.0"
"revision" : "e0c2fbb442979fbf1e4be80e01d142f310a9c762",
"version" : "10.49.1"
}
},
{
"identity" : "realm-core",
"kind" : "remoteSourceControl",
"location" : "https://github.com/realm/realm-core.git",
"state" : {
"revision" : "a5e87a39cffdcc591f3203c11cfca68100d0b9a6",
"version" : "13.26.0"
"revision" : "374dd672af357732dccc135fecc905406fec3223",
"version" : "14.4.1"
}
},
{
Expand Down Expand Up @@ -149,8 +150,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/scinfu/SwiftSoup.git",
"state" : {
"revision" : "1d39e56d364cba79ce43b341f9661b534cccb18d",
"version" : "2.7.1"
"revision" : "028487d4a8a291b2fe1b4392b5425b6172056148",
"version" : "2.7.2"
}
},
{
Expand Down Expand Up @@ -194,10 +195,10 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/jpsim/Yams.git",
"state" : {
"revision" : "0d9ee7ea8c4ebd4a489ad7a73d5c6cad55d6fed3",
"version" : "5.0.6"
"revision" : "8a835d918245ca22f36663dd3862138805d7f707",
"version" : "5.1.0"
}
}
],
"version" : 2
"version" : 3
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,10 @@ extension ComposeViewController {

let deletedSectionsCount = previousSectionsCount - sectionsList.count

let sectionsToReload: [Section]
if let type = selectedRecipientType {
sectionsToReload = sectionsList.filter { $0 != .recipients(type) }
let sectionsToReload: [Section] = if let type = selectedRecipientType {
sectionsList.filter { $0 != .recipients(type) }
} else {
sectionsToReload = sectionsList
sectionsList
}

node.performBatchUpdates {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,10 @@ struct BackupOptionsViewDecorator: BackupOptionsViewDecoratorType {
isSelected: Bool
) -> CheckBoxTextNode.Input {

let title: String

switch part {
case .email: title = "backup_option_screen_email"
case .download: title = "backup_option_screen_download"
default: title = ""
let title = switch part {
case .email: "backup_option_screen_email"
case .download: "backup_option_screen_download"
default: ""
}

return CheckBoxTextNode.Input.common(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,48 +21,46 @@ struct ContactKeyDetailDecorator {
}

private func attributedTitle(for contactKeyPart: ContactKeyDetailViewController.Part) -> NSAttributedString {
let title: String
switch contactKeyPart {
let title = switch contactKeyPart {
case .armored:
title = "contact_key_pub"
"contact_key_pub"
case .signature:
title = "contact_key_signature"
"contact_key_signature"
case .created:
title = "contact_key_created"
"contact_key_created"
case .checked:
title = "contact_key_fetched"
"contact_key_fetched"
case .expire:
title = "contact_key_expires"
"contact_key_expires"
case .longids:
title = "contact_key_longids"
"contact_key_longids"
case .fingerprints:
title = "contact_key_fingerprints"
"contact_key_fingerprints"
case .algo:
title = "contact_key_algo"
"contact_key_algo"
}

return title.localized.attributed(.bold(16))
}

private func content(for pubKey: PubKey, part: ContactKeyDetailViewController.Part) -> NSAttributedString {
let result: String
switch part {
let result: String = switch part {
case .armored:
result = pubKey.armored
pubKey.armored
case .signature:
result = string(from: pubKey.lastSig)
string(from: pubKey.lastSig)
case .created:
result = string(from: pubKey.created)
string(from: pubKey.created)
case .checked:
result = string(from: pubKey.lastChecked)
string(from: pubKey.lastChecked)
case .expire:
result = string(from: pubKey.expiresOn)
string(from: pubKey.expiresOn)
case .longids:
result = pubKey.longids.joined(separator: ", ")
pubKey.longids.joined(separator: ", ")
case .fingerprints:
result = pubKey.fingerprints.joined(separator: ", ")
pubKey.fingerprints.joined(separator: ", ")
case .algo:
result = pubKey.algo?.algorithm ?? "-"
pubKey.algo?.algorithm ?? "-"
}
return result.attributed(.regular(14))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,13 @@ struct KeyDetailViewDecorator {
let titleInsets = UIEdgeInsets.deviceSpecificTextInsets(top: 16, bottom: 16)

func attributedTitle(for keyDetailPart: KeyDetailViewController.Part) -> NSAttributedString {
let title: String
switch keyDetailPart {
case .description: title = "key_settings_subtitle".localized
case .publicInfo: title = "key_settings_detail_show_public".localized
case .copy: title = "key_settings_detail_copy".localized
case .keyDetails: title = "key_settings_detail_show_details".localized
case .save: title = "key_settings_detail_save".localized
case .privateInfo: title = "key_settings_detail_show_private_title".localized
let title = switch keyDetailPart {
case .description: "key_settings_subtitle".localized
case .publicInfo: "key_settings_detail_show_public".localized
case .copy: "key_settings_detail_copy".localized
case .keyDetails: "key_settings_detail_show_details".localized
case .save: "key_settings_detail_save".localized
case .privateInfo: "key_settings_detail_show_private_title".localized
}

if keyDetailPart.isDescription {
Expand Down
42 changes: 18 additions & 24 deletions FlowCrypt/Controllers/Setup/SetupViewDecorator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,11 @@ struct SetupViewDecorator {
}

func title(for titleType: TitleType) -> NSAttributedString {
let text: String

switch titleType {
let text = switch titleType {
case .setup, .createKey, .choosePassPhrase:
text = "setup_title"
"setup_title"
case .enterPassPhrase, .importKey:
text = "import_key_description"
"import_key_description"
}

return text
Expand Down Expand Up @@ -70,19 +68,17 @@ struct SetupViewDecorator {
}

func subtitle(for subtitleType: SubtitleType) -> NSAttributedString {
let subtitle: String

switch subtitleType {
let subtitle = switch subtitleType {
case let .fetchedKeys(count):
subtitle = "Found %@ key backup(s)".localizePluralsWithArguments(count)
"Found %@ key backup(s)".localizePluralsWithArguments(count)
case let .fetchedEKMKeys(count):
subtitle = "Fetched %@ key(s) on EKM".localizePluralsWithArguments(count)
"Fetched %@ key(s) on EKM".localizePluralsWithArguments(count)
case .common:
subtitle = "setup_description".localized
"setup_description".localized
case .choosingPassPhrase:
subtitle = "create_pass_phrase_tips".localized
"create_pass_phrase_tips".localized
case .noBackups:
subtitle = "setup_no_backups".localized // todo - edit
"setup_no_backups".localized // todo - edit
}

return subtitle
Expand All @@ -102,25 +98,23 @@ struct SetupViewDecorator {
}

func buttonTitle(for action: ButtonAction) -> NSAttributedString {
let buttonTitle: String

switch action {
let buttonTitle = switch action {
case .createKey:
buttonTitle = "setup_initial_create_key"
"setup_initial_create_key"
case .importKey:
buttonTitle = "setup_initial_import_key"
"setup_initial_import_key"
case .loadAccount:
buttonTitle = "setup_load"
"setup_load"
case .setPassPhrase:
buttonTitle = "create_pass_phrase_set_title"
"create_pass_phrase_set_title"
case .pasteBoard:
buttonTitle = "import_key_paste"
"import_key_paste"
case .passPhraseContinue:
buttonTitle = "import_key_continue"
"import_key_continue"
case .passPhraseChooseAnother:
buttonTitle = "import_key_choose"
"import_key_choose"
case .fileImport:
buttonTitle = "import_key_file"
"import_key_file"
}

return buttonTitle
Expand Down
13 changes: 6 additions & 7 deletions FlowCrypt/Controllers/SetupImap/SetupImapViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,12 @@ extension SetupImapViewController {
}

var indexPath: IndexPath {
let row: Int
switch self {
case let .account(part): row = part.rawValue
case let .imap(part): row = part.rawValue
case let .smtp(part): row = part.rawValue
case let .other(part): row = part.rawValue
case .connect: row = 0
let row: Int = switch self {
case let .account(part): part.rawValue
case let .imap(part): part.rawValue
case let .smtp(part): part.rawValue
case let .other(part): part.rawValue
case .connect: 0
}
return IndexPath(row: row, section: self.section)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,12 @@ extension ThreadDetailsViewController {
private func draftNode(messageIndex: Int, isExpanded: Bool) -> ASCellNode {
let data = input[messageIndex]

let body: String
if let processedMessage = data.processedMessage {
body = processedMessage.text
let body: String = if let processedMessage = data.processedMessage {
processedMessage.text
} else if data.rawMessage.isPgp {
body = "Waiting for pass phrase to open draft..."
"Waiting for pass phrase to open draft..."
} else {
body = data.rawMessage.body.text
data.rawMessage.body.text
}

return ThreadMessageDraftCellNode(sender: appContext.user.name, draftBody: body, messageIndex: messageIndex, action: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,10 @@ final class ThreadDetailsViewController: TableNodeViewController {
onlyLocalKeys: Bool = false,
forceFetch: Bool = true
) async throws -> ProcessedMessage {
let message: Message

if !forceFetch, let rawMessage = input.first(where: { $0.rawMessage.identifier == identifier })?.rawMessage {
message = rawMessage
let message: Message = if !forceFetch, let rawMessage = input.first(where: { $0.rawMessage.identifier == identifier })?.rawMessage {
rawMessage
} else {
message = try await messageHelper.fetchMessage(
try await messageHelper.fetchMessage(
identifier: identifier,
folder: inboxItem.folderPath
)
Expand Down Expand Up @@ -309,11 +307,10 @@ final class ThreadDetailsViewController: TableNodeViewController {

let processedMessage = try await getAndProcessMessage(identifier: messageId)

let section: Int
if let index = input.firstIndex(where: { $0.rawMessage.identifier == identifier.draftMessageId }) {
section = index + 1
let section: Int = if let index = input.firstIndex(where: { $0.rawMessage.identifier == identifier.draftMessageId }) {
index + 1
} else {
section = input.count + 1
input.count + 1
}

handle(processedMessage: processedMessage, at: IndexPath(row: 0, section: section))
Expand Down
Loading
Loading