Skip to content

Commit

Permalink
Merge release/2024.05.09T11.46.19 into master
Browse files Browse the repository at this point in the history
  • Loading branch information
TakayukiCho committed May 9, 2024
2 parents 1c039cb + 44ce264 commit e14bacf
Show file tree
Hide file tree
Showing 18 changed files with 162 additions and 76 deletions.
48 changes: 1 addition & 47 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,33 +147,6 @@ jobs:
- slack/status:
fail_only: true

ui_test:
executor:
name: build
steps:
- run:
name: Request Ui Test
command: |
if [ $EXEC_ENV = 'private' ]; then
curl -f -u ${CIRCLECI_KEY} \
-d build_parameters[CIRCLE_JOB]=e2e_test \
-d build_parameters[RELEASE_BRANCH]=${CIRCLE_BRANCH} \
${UI_TEST_ENDPOINT}
fi
spm_test:
executor:
name: build
steps:
- run:
name: Request Swift-PM link Test
command: |
if [ $EXEC_ENV = 'private' ]; then
curl -f -u ${CIRCLECI_KEY} \
-d build_parameters[CIRCLE_JOB]=spm_link_test \
${UI_TEST_ENDPOINT}
fi
generate_docs:
executor:
name: build
Expand Down Expand Up @@ -259,23 +232,11 @@ workflows:
- test:
requires:
- build
- ui_test:
filters:
branches:
only:
- develop
- publish:
filters:
branches:
only:
- master
- spm_test:
requires:
- build
filters:
branches:
only:
- master

manual_deploy:
when:
Expand All @@ -290,16 +251,9 @@ workflows:
- test:
requires:
- build
- ui_test:
requires:
- build
- spm_test:
requires:
- build
- publish_pods:
requires:
- ui_test
- spm_test
- test

dry_run:
when:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/danger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: macos-latest
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.1
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ secrets.GH_ACCESS_TOKEN }}
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-finish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
completed: ${{ steps.check_completion.outputs.completed }}
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.1
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ secrets.GH_ACCESS_TOKEN }}
all_but_latest: true
Expand Down
19 changes: 13 additions & 6 deletions .github/workflows/release-start.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,16 @@ jobs:
### Update
${{ steps.find-release-targets.outputs.targets }}
- name: Request beta release
run : |
curl -u ${{ secrets.CIRCLECI_KEY }} \
-d build_parameters[CIRCLE_JOB]=release \
-d build_parameters[RELEASE_BRANCH]=release/${{ steps.date.outputs.date }} \
-d build_parameters[RELEASE_TARGET]=KarteTracker \
${{ secrets.UI_TEST_ENDPOINT }}
uses: actions/github-script@v7
with:
github-token: ${{ secrets.SHARED_GITHUB_ACCESS_TOKEN }}
script: |
await github.rest.actions.createWorkflowDispatch({
owner: 'plaidev',
repo: '${{vars.UITEST_REPO}}',
workflow_id: 'release-test-app.yml',
ref: 'master',
inputs: {
sdkBranch: 'release/${{ steps.date.outputs.date }}',
},
})
2 changes: 1 addition & 1 deletion .github/workflows/spm_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
id-token: write
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.1
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ secrets.GH_ACCESS_TOKEN }}
- name: Checkout master
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/spm_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "SPM Test"
on:
push:
branches:
- master

jobs:
kick_spm_link_test:
runs-on: ubuntu-latest
if: ${{ vars.UITEST_REPO }}
steps:
- uses: actions/github-script@v7
with:
github-token: ${{ secrets.SHARED_GITHUB_ACCESS_TOKEN }}
script: |
await github.rest.actions.createWorkflowDispatch({
owner: 'plaidev',
repo: '${{vars.UITEST_REPO}}',
workflow_id: 'spm-link-test.yml',
ref: 'master',
})
20 changes: 20 additions & 0 deletions .github/workflows/uitest-before-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "UI Test before release"
on:
pull_request:
types: [opened, reopend]
branches:
- 'master'

jobs:
wait_uitest:
runs-on: ubuntu-latest
if: ${{ vars.UITEST_REPO }}
steps:
- name: Kick UI Test and wait
uses: aurelien-baudet/workflow-dispatch@v2
with:
workflow: uitest.yml
repo: plaidev/${{vars.UITEST_REPO}}
token: ${{ secrets.SHARED_GITHUB_ACCESS_TOKEN }}
ref: master
inputs: '{ "sdkBranch": "${{github.head_ref}}", "slackChannel": "${{vars.SLACK_CHANNEL}}", "notifyOnlyFail": true }'
26 changes: 26 additions & 0 deletions .github/workflows/uitest-on-develop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: "UI Test on develop"
on:
push:
branches:
- develop

jobs:
kick_uitest:
runs-on: ubuntu-latest
if: ${{ vars.UITEST_REPO }}
steps:
- uses: actions/github-script@v7
with:
github-token: ${{ secrets.SHARED_GITHUB_ACCESS_TOKEN }}
script: |
await github.rest.actions.createWorkflowDispatch({
owner: 'plaidev',
repo: '${{vars.UITEST_REPO}}',
workflow_id: 'uitest.yml',
ref: 'master',
inputs: {
slackChannel: '${{vars.SLACK_CHANNEL}}',
notifyOnlyFail: true,
minimumOnly: true,
},
})
2 changes: 1 addition & 1 deletion .spm-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.13.0
2.14.0
19 changes: 17 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,31 @@

| モジュール名 | Description | 最新のバージョン |
| :-- | :-- | :-- |
| KarteCore | イベントトラッキング機能を提供します。 | 2.26.0 |
| KarteCore | イベントトラッキング機能を提供します。 | 2.27.0 |
| KarteInAppMessaging | アプリ内メッセージ機能を提供します。 | 2.17.0 |
| KarteRemoteNotification | プッシュ通知の受信および効果測定機能を提供します。 | 2.11.0 |
| KarteVariables | 設定値配信機能を提供します。 | 2.9.0 |
| KarteVariables | 設定値配信機能を提供します。 | 2.10.0 |
| KarteVisualTracking | ビジュアルトラッキング機能を提供します。 | 2.12.0 |
| KarteInbox | Push通知の送信履歴を取得する機能を提供します(β版)。 | 0.1.0 |
| KarteCrashReporting | クラッシュイベントのトラッキング機能を提供します。 | 2.7.1 |
| KarteUtilities | KarteCore モジュール等が利用するUtility機能を提供します。通常直接参照する必要はありません。 | 3.12.0 |
| KarteNotificationServiceExtension | リッチプッシュ通知機能を提供します。 | 1.2.0 |


# Releases - 2024.05.09
## Version 2.14.0

### Core 2.27.0
** 🔨CHANGED**
- サポート改善のため、ログにタイムスタンプを出力するようにしました。

### Veriables 2.10.0
** 🔨CHANGED**
- 特定の条件にマッチする変数オブジェクトをリスト形式で取得できるメソッドを追加しました。

** 💊FIXED**
- getAllKeysでシステムが利用しているlastFetchTimeとlastFetchStatusが返されるのを修正しました

# Releases - 2024.04.18
## Version 2.13.0

Expand Down
2 changes: 1 addition & 1 deletion Dangerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ $is_hotfix_pr = (github.branch_for_base == "master" || github.branch_for_base ==
#
github.dismiss_out_of_range_messages
swiftlint.config_file = '.swiftlint.yml'
swiftlint.binary_path = '/usr/local/bin/swiftlint'
swiftlint.binary_path = '/opt/homebrew/bin/swiftlint'
swiftlint.lint_files inline_mode: true

#
Expand Down
8 changes: 4 additions & 4 deletions Karte.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3828,7 +3828,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 2.26.0;
MARKETING_VERSION = 2.27.0;
PRODUCT_BUNDLE_IDENTIFIER = io.karte.KarteCore;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -3863,7 +3863,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 2.26.0;
MARKETING_VERSION = 2.27.0;
PRODUCT_BUNDLE_IDENTIFIER = io.karte.KarteCore;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -3960,7 +3960,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 2.9.0;
MARKETING_VERSION = 2.10.0;
PRODUCT_BUNDLE_IDENTIFIER = io.karte.KarteVariables;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -3992,7 +3992,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 2.9.0;
MARKETING_VERSION = 2.10.0;
PRODUCT_BUNDLE_IDENTIFIER = io.karte.KarteVariables;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
Expand Down
2 changes: 1 addition & 1 deletion KarteCore.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'KarteCore'
s.version = '2.26.0'
s.version = '2.27.0'
s.summary = 'KARTE Core SDK'
s.homepage = 'https://karte.io'
s.author = { 'PLAID' => '[email protected]' }
Expand Down
23 changes: 16 additions & 7 deletions KarteCore/Common/Logger/LogLayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,29 @@

import Foundation

internal protocol LogLayout {
func layout(_ log: Logger.Log) -> String
internal class LogLayout {
private static let dateFormatter = {
let formatter = DateFormatter()
formatter.dateFormat = DateFormatter.dateFormat(fromTemplate: "yyyyMMddHHmmssSSS", options: 0, locale: nil)
return formatter
}()
final var timestamp: String {
Self.dateFormatter.string(for: Date()) ?? ""
}
func layout(_ log: Logger.Log) -> String { "" }
deinit {}
}

internal class DevelopmentLogLayout: LogLayout {
func layout(_ log: Logger.Log) -> String {
"\(log.tag.version) - \(log.level.identifier)/KARTE \(log.file):\(log.line) \(log.function) [\(log.tag.rawValue)] \(log.message)"
override func layout(_ log: Logger.Log) -> String {
"\(timestamp) - \(log.tag.version) - \(log.level.identifier)/KARTE \(log.file):\(log.line) \(log.function) [\(log.tag.rawValue)] \(log.message)"
}
deinit {}
}

internal class ProductionLogLayout {
func layout(_ log: Logger.Log) -> String {
"\(log.tag.version) - \(log.level.identifier)/KARTE [\(log.tag.rawValue)] \(log.message)"
internal class ProductionLogLayout: LogLayout {
override func layout(_ log: Logger.Log) -> String {
"\(timestamp) - \(log.tag.version) - \(log.level.identifier)/KARTE [\(log.tag.rawValue)] \(log.message)"
}
deinit {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ class VariablesSpec: QuickSpec {
expect(keys.contains("var2")).to(beTrue())
expect(keys.contains("var3")).to(beTrue())
expect(keys.contains("var4")).to(beFalse())
expect(keys.contains("lastFetchTime")).to(beFalse())
expect(keys.contains("lastFetchStatus")).to(beFalse())
}
}

Expand All @@ -206,6 +208,23 @@ class VariablesSpec: QuickSpec {
}
}

describe("filter") {
it ("return matched variables") {
let filteredVariables = Variables.filter {
$0.hasPrefix("var")
}.sorted { $0.name < $1.name }
expect(filteredVariables.count).to(equal(3))
expect(filteredVariables[0].string).to(equal("変数1"))
expect(filteredVariables[1].string).to(equal("変数2a"))
expect(filteredVariables[2].string).to(equal("変数3a"))
}
it("won't return when not matched") {
let filteredVariables = Variables.filter {
$0.hasPrefix("let")
}
expect(filteredVariables.count).to(equal(0))
}
}

describe("retrieve variable") {
it("var1 is not nil") {
Expand Down
2 changes: 1 addition & 1 deletion KarteVariables.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'KarteVariables'
s.version = '2.9.0'
s.version = '2.10.0'
s.summary = 'KARTE Variables SDK'
s.homepage = 'https://karte.io'
s.author = { 'PLAID' => '[email protected]' }
Expand Down
17 changes: 16 additions & 1 deletion KarteVariables/Variables.swift
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,22 @@ public class Variables: NSObject {
/// - Returns: 全ての設定値のキーの一覧を返します。
@objc
public class func getAllKeys() -> [String] {
return UserDefaults.standard.getAllKeys(forNamespace: .variables)
return UserDefaults.standard.getAllKeys(forNamespace: .variables).filter {
// こちらの2つはシステムで利用している値なので除外する
!["lastFetchTime", "lastFetchStatus"].contains($0)
}
}

/// キーに特定の文字列を持つVariableのリスト取得します。<br>
/// なお事前に `Variables.fetch(completion:)` を呼び出しておく必要があります。
///
/// - Parameter forPredicate: キーマッチ用のブロック
/// - Returns: マッチしたRegexの一覧を返します。
@objc
public class func filter(usingPredicate predicate: (String) -> Bool) -> [Variable] {
let allKeys = Variables.getAllKeys()
let filteredKeys = allKeys.filter(predicate)
return filteredKeys.map { Variable(name: $0) }
}

/// 指定した設定値のキーのキャッシュを削除します<br>
Expand Down
Loading

0 comments on commit e14bacf

Please sign in to comment.