Mhurd has submitted this change and it was merged.
Change subject: Adding Change log to builds
......................................................................
Adding Change log to builds
Added 'git' gem
Creating change log from git commit subjects
Adding change log to hockey app and iTunes Connect
You can test by following the "Debugging" instructions in
docs/working-with-ruby.md
Also, added an uncrustify straggler
Bug: T94423
Change-Id: I5268739757067e6fce96cfe618aaba6537201d11
---
M Gemfile
M Gemfile.lock
M Wikipedia/View Controllers/Image Gallery/WMFImageInfoController.m
M docs/working-with-ruby.md
M fastlane/Fastfile
A fastlane/lib/utils.rb
6 files changed, 102 insertions(+), 49 deletions(-)
Approvals:
Fjalapeno: Looks good to me, but someone else must approve
Mhurd: Verified; Looks good to me, approved
Bgerstle: Looks good to me, but someone else must approve
jenkins-bot: Verified
diff --git a/Gemfile b/Gemfile
index ed0858b..449e109 100644
--- a/Gemfile
+++ b/Gemfile
@@ -2,3 +2,4 @@
gem 'cocoapods', '~> 0.36.1'
gem 'fastlane', '~> 0.4.2'
+gem 'git'
diff --git a/Gemfile.lock b/Gemfile.lock
index 48aa94b..fb09ac8 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -108,6 +108,7 @@
fastlane_core (>= 0.2.0)
mini_magick (~> 4.0.2)
fuzzy_match (2.0.4)
+ git (1.2.9.1)
highline (1.7.1)
i18n (0.7.0)
json (1.8.2)
@@ -187,3 +188,4 @@
DEPENDENCIES
cocoapods (~> 0.36.1)
fastlane (~> 0.4.2)
+ git
diff --git a/Wikipedia/View Controllers/Image Gallery/WMFImageInfoController.m
b/Wikipedia/View Controllers/Image Gallery/WMFImageInfoController.m
index 03875d8..d4c38cc 100644
--- a/Wikipedia/View Controllers/Image Gallery/WMFImageInfoController.m
+++ b/Wikipedia/View Controllers/Image Gallery/WMFImageInfoController.m
@@ -138,7 +138,7 @@
- (NSArray*)fetchBatchContainingIndex:(NSInteger)index
withNthNeighbor:(NSUInteger)next {
NSAssert(next >= 0, @"No reason to call this method with next == 0");
- NSMutableIndexSet* indexes = [NSMutableIndexSet indexSetWithIndex:index];
+ NSMutableIndexSet* indexes = [NSMutableIndexSet
indexSetWithIndex:index];
NSUInteger const neighborIndex = index + next;
if (neighborIndex < self.uniqueArticleImages.count) {
[indexes addIndex:index + next];
diff --git a/docs/working-with-ruby.md b/docs/working-with-ruby.md
index 2780aec..c477417 100644
--- a/docs/working-with-ruby.md
+++ b/docs/working-with-ruby.md
@@ -7,3 +7,19 @@
### Usage
Invoking any of the gems installed by Bundler can be done a couple of
different ways. The most reliable way is by using `bundle exec` to prefix your
commands (e.g. `bundle exec pod install`). If this is too cumbersome, you can
use the `Makefile` goals (e.g. `make pod` which runs `bundle exec pod
install`), or configure your `PATH` to discover the local binaries installed by
Bundler.
+
+### Debugging
+The easiest way to interactively debug Ruby-related aspects of the project is
to use the `bundle console` command, which starts an `irb` REPL after
`require`-ing the gems in `Gemfile`. From here, you can `require_relative` the
file you want to debug and tinker with it in the shell. For example:
+
+```
+$ bundle console
+# ...
+irb(main)> Git
+# => Git
+irb(main)> require_relative 'some/local/file.rb'
+# => true
+irb(main)> foo 'bar'
+# => result of calling foo with 'bar'
+# Type Ctrl+D to get back to the command line
+```
+
diff --git a/fastlane/Fastfile b/fastlane/Fastfile
index 660227d..5774519 100644
--- a/fastlane/Fastfile
+++ b/fastlane/Fastfile
@@ -2,37 +2,10 @@
# https://github.com/krausefx/fastlane#customise-the-fastfile
# vim: ft=ruby
-ENV['XCODE_WORKSPACE'] = 'Wikipedia.xcworkspace'
+# Since this file is eval'd, we need to add this file's directory to $LOAD_PATH
+$:.unshift File.dirname(__FILE__)
-# Returns true if the `NO_RESET` env var is set to 1
-def reset_disabled?
- ENV['NO_RESET'] == '1'
-end
-
-# Returns true if the `NO_DEPLOY` env var is set to 1
-def deploy_disabled?
- ENV['NO_DEPLOY'] == '1'
-end
-
-# Runs goals from the project's Makefile, this requires going up to the
project directory.
-# :args: Additional arguments to be passed to `make`.
-# Returns The result of the `make` command
-def make(args)
- # Maybe we should write an "uncrustify" fastlane action?...
- Dir.chdir '..' do
- sh 'make ' + args
- end
-end
-
-def run_unit_tests
- xctest({
- scheme: 'Wikipedia',
- destination: "platform=iOS Simulator,name=iPhone 6,OS=8.2",
- report_formats: [ "html", "junit" ],
- report_path: "build/reports/iOS82/report.xml",
- clean: nil
- })
-end
+require 'lib/utils.rb'
before_all do
p ENV
@@ -44,11 +17,12 @@
lane :test do
make 'lint'
+ run_unit_tests
end
lane :alpha do
run_unit_tests
-
+
# Download the Certificate for signing
cert
@@ -81,16 +55,10 @@
})
unless deploy_disabled?
- # Upload the DSYM to Hockey
- hockey({
- api_token: 'c881c19fd8d0401682c4640b7948ef5e',
- notes: "Changelog",
- notify: 0,
- status: 1, #Means do not make available for download
- })
- # Upload the IPA and DSYM to iTunes Connect
- deliver :testflight, :beta, :skip_deploy, :force
+ ENV['HOCKEY_API_TOKEN'] = 'c881c19fd8d0401682c4640b7948ef5e'
+ deploy_testflight_build
+
end
end
@@ -128,15 +96,10 @@
})
unless deploy_disabled?
- # Upload the DSYM to Hockey
- hockey({
- api_token: 'c881c19fd8d0401682c4640b7948ef5e',
- notes: "Changelog",
- notify: 0,
- status: 1,
- })
- deliver :testflight, :beta, :force
+ ENV['HOCKEY_API_TOKEN'] = 'c881c19fd8d0401682c4640b7948ef5e'
+ deploy_testflight_build
+
end
end
diff --git a/fastlane/lib/utils.rb b/fastlane/lib/utils.rb
new file mode 100644
index 0000000..b1289ca
--- /dev/null
+++ b/fastlane/lib/utils.rb
@@ -0,0 +1,71 @@
+# Utility functions
+
+require 'git'
+
+# Returns true if the `NO_RESET` env var is set to 1
+def reset_disabled?
+ ENV['NO_RESET'] == '1'
+end
+
+# Returns true if the `NO_DEPLOY` env var is set to 1
+def deploy_disabled?
+ ENV['NO_DEPLOY'] == '1'
+end
+
+# Runs goals from the project's Makefile, this requires going up to the
project directory.
+# :args: Additional arguments to be passed to `make`.
+# Returns The result of the `make` command
+def make(args)
+ # Maybe we should write an "uncrustify" fastlane action?...
+ Dir.chdir '..' do
+ sh 'make ' + args
+ end
+end
+
+def run_unit_tests
+ xctest({
+ scheme: 'Wikipedia',
+ destination: "platform=iOS Simulator,name=iPhone 6,OS=8.2",
+ report_formats: [ "html", "junit" ],
+ report_path: "build/reports/iOS82/report.xml",
+ clean: nil
+ })
+end
+
+# Generate a list of commit subjects from `rev` to `HEAD`
+# :rev: The git SHA to start the log from, defaults to `ENV[LAST_SUCCESS_REV']`
+def generate_git_commit_log(rev=ENV['LAST_SUCCESS_REV'])
+ g = Git.open(Dir.getwd)
+ change_log = g.log.between(rev).map { |c| "- " + c.message.lines.first.chomp
}.join "\n"
+ "Commit Log:\n\n#{change_log}\n"
+end
+
+# Memoized version of `generate_git_commit_log` which stores the result in
`ENV['GIT_COMMIT_LOG']`.
+def git_commit_log
+ ENV['GIT_COMMIT_LOG'] || ENV['GIT_COMMIT_LOG'] = generate_git_commit_log
+end
+
+def hockey_api_token
+ ENV['HOCKEY_API_TOKEN']
+end
+
+def deploy_testflight_build
+ # Upload the DSYM to Hockey
+ hockey({
+ api_token: hockey_api_token,
+ notes: git_commit_log,
+ notify: 0,
+ status: 1, #Means do not make available for download
+ })
+
+ #Set "What To Test" in iTunes Connect for Testflight builds, in the future,
reference tickets instead of git commits
+ DELIVER_WHAT_TO_TEST.replace = git_commit_log
+ #Set "App Description" in iTunes Connect for Testflight builds, in the
future set a better description
+ DELIVER_BETA_DESCRIPTION.replace = git_commit_log
+ #Set "Feedback email" in iTunes Connect for Testflight builds
+ DELIVER_BETA_FEEDBACK_EMAIL.replace = '[email protected]'
+
+ # Upload the IPA and DSYM to iTunes Connect
+ deliver :testflight, :beta, :skip_deploy, :force
+end
+
--
To view, visit https://gerrit.wikimedia.org/r/203830
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I5268739757067e6fce96cfe618aaba6537201d11
Gerrit-PatchSet: 4
Gerrit-Project: apps/ios/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Fjalapeno <[email protected]>
Gerrit-Reviewer: Bgerstle <[email protected]>
Gerrit-Reviewer: Dr0ptp4kt <[email protected]>
Gerrit-Reviewer: Fjalapeno <[email protected]>
Gerrit-Reviewer: Mhurd <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits