-
Notifications
You must be signed in to change notification settings - Fork 2
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
Tech 4449 appraisal phase 1 #19
Changes from 8 commits
1444364
3b7b196
6655319
0741b2a
c268c40
9ce8f93
f84a689
aa8e993
8b5ff4f
c3410ad
a3ea1aa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
version: 1 | ||
update_configs: | ||
- package_manager: "ruby:bundler" | ||
directory: "/" | ||
update_schedule: "live" | ||
version_requirement_updates: "off" | ||
commit_message: | ||
prefix: "No-Jira" | ||
include_scope: true | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,3 +51,6 @@ build-iPhoneSimulator/ | |
|
||
# rubocop | ||
.rubocop-https---raw-githubusercontent-com-Invoca-style-guide-master-ruby--rubocop-yml | ||
|
||
# appraisal | ||
gemfiles/*.lock | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interesting--I'd missed this subtlety. The appraisals generate a fresh There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yea, this is a best practice set by the appraisals gem to make sure that the appraisal is always tested against the most recent version of the lock. it leans very heavily on semantic versioning and locking. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
#!/usr/bin/groovy | ||
@Library('jenkins-pipeline@v0.4.5') | ||
import com.invoca.docker.*; | ||
pipeline { | ||
agent { | ||
kubernetes { | ||
defaultContainer "ruby" | ||
yamlFile ".jenkins/ruby_build_pod.yml" | ||
} | ||
} | ||
|
||
environment { GITHUB_TOKEN = credentials('github_token') } | ||
|
||
stages { | ||
stage('Setup') { | ||
steps { | ||
script { | ||
updateGitHubStatus('clean-build', 'pending', 'Unit tests.') | ||
sh 'bundle install' | ||
sh 'bundle exec appraisal install' | ||
} | ||
} | ||
} | ||
stage('Appraisals') { | ||
parallel { | ||
stage('Current') { | ||
steps { | ||
sh 'bundle exec rspec --format RspecJunitFormatter --out spec/reports/current/rspec.xml' | ||
} | ||
|
||
post { | ||
always { junit 'spec/reports/current/*.xml' } | ||
} | ||
} | ||
|
||
stage('Rails 4') { | ||
steps { | ||
sh 'bundle exec appraisal rails-4 rspec --format RspecJunitFormatter --out spec/reports/rails4/rspec.xml' | ||
} | ||
|
||
post { | ||
always { junit 'spec/reports/rails4/*.xml' } | ||
} | ||
} | ||
|
||
stage('Rails 5') { | ||
steps { | ||
sh 'bundle exec appraisal rails-5 rspec --format RspecJunitFormatter --out spec/reports/rails5/rspec.xml' | ||
} | ||
|
||
post { | ||
always { junit 'spec/reports/rails5/*.xml' } | ||
} | ||
} | ||
|
||
stage('Rails 6') { | ||
steps { | ||
sh 'bundle exec appraisal rails-6 rspec --format RspecJunitFormatter --out spec/reports/rails6/rspec.xml' | ||
} | ||
|
||
post { | ||
always { junit 'spec/reports/rails6/*.xml' } | ||
} | ||
} | ||
} | ||
|
||
post { | ||
success { updateGitHubStatus('clean-build', 'success', 'Unit tests.') } | ||
failure { updateGitHubStatus('clean-build', 'failure', 'Unit tests.') } | ||
} | ||
} | ||
} | ||
} | ||
|
||
void updateGitHubStatus(String context, String status, String description) { | ||
gitHubStatus([ | ||
repoSlug: 'Invoca/contextual_logger', | ||
sha: env.GIT_COMMIT, | ||
description: description, | ||
context: context, | ||
targetURL: env.RUN_DISPLAY_URL, | ||
token: env.GITHUB_TOKEN, | ||
status: status | ||
]) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
labels: | ||
jenkins/contextual-logger: 'true' | ||
namespace: jenkins | ||
name: contextual_logger | ||
spec: | ||
containers: | ||
- name: ruby | ||
image: ruby:2.6.5 | ||
tty: true | ||
resources: | ||
requests: | ||
memory: "100Mi" | ||
command: | ||
- cat |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
2.6.5 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the hyphen file best practice? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
appraise 'rails-4' do | ||
gem 'activesupport', '~> 4.2' | ||
end | ||
|
||
appraise 'rails-5' do | ||
gem 'activesupport', '~> 5.2' | ||
end | ||
|
||
appraise 'rails-6' do | ||
gem 'activesupport', '~> 6.0' | ||
end | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💯 So clean! |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,18 @@ | |
Inspired by [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). | ||
Note: this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
## [0.7.0] - Unreleased | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. BTW I have 0.7.0 also in a branch. We may be able to release those together. |
||
### Added | ||
- Added support for rails 5 and 6. | ||
- Added appraisal tests for all supported rails version: 4/5/6 | ||
|
||
### Changed | ||
- Updated various test to be compatible with rails version 4/5/6 | ||
- Updated the CI pipeline to test against all three supported versions of rails | ||
|
||
### Fixed | ||
- Fixed undefined method `delegate` bug in ActiveSupport version 4 | ||
|
||
## [0.6.1] - 2020-04-03 | ||
### Fixed | ||
- Gemspec to point to correct source code uri | ||
|
@@ -35,6 +47,7 @@ Note: this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0 | |
- Extracted `ContextualLogger.normalize_log_level` into a public class method so we can call it elsewhere where we allow log_level to be | ||
configured to text values like 'debug'. | ||
|
||
[0.7.0]: https://github.com/Invoca/contextual_logger/compare/v0.6.1...v0.7.0 | ||
[0.6.1]: https://github.com/Invoca/contextual_logger/compare/v0.6.0...v0.6.1 | ||
[0.6.0]: https://github.com/Invoca/contextual_logger/compare/v0.5.1...v0.6.0 | ||
[0.5.1]: https://github.com/Invoca/contextual_logger/compare/v0.5.0...v0.5.1 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,18 +6,15 @@ gemspec | |
|
||
gem 'coveralls', require: false | ||
|
||
group :development do | ||
gem 'activesupport' | ||
gem 'bump', '~> 0.6.1' | ||
gem 'pry' | ||
gem 'rake' | ||
gem 'rubocop', '0.54.0' | ||
gem 'rubocop-git' | ||
gem 'ruby-prof' | ||
gem 'ruby-prof-flamegraph' | ||
end | ||
gem 'activesupport' | ||
gem 'appraisal' | ||
gem 'bump', '~> 0.6.1' | ||
gem 'pry' | ||
gem 'rake' | ||
gem 'rubocop', '0.54.0' | ||
gem 'rubocop-git' | ||
gem 'ruby-prof' | ||
gem 'ruby-prof-flamegraph' | ||
|
||
group :test do | ||
gem 'rspec' | ||
gem 'rspec_junit_formatter' | ||
end | ||
gem 'rspec' | ||
gem 'rspec_junit_formatter' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for simplifying here! |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
BUNDLE_RETRY: "1" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# This file was generated by Appraisal | ||
|
||
source "http://rubygems.org" | ||
|
||
gem "coveralls", require: false | ||
gem "activesupport", "~> 4.2" | ||
gem "appraisal" | ||
gem "bump", "~> 0.6.1" | ||
gem "pry" | ||
gem "rake" | ||
gem "rubocop", "0.54.0" | ||
gem "rubocop-git" | ||
gem "ruby-prof" | ||
gem "ruby-prof-flamegraph" | ||
gem "rspec" | ||
gem "rspec_junit_formatter" | ||
|
||
gemspec path: "../" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# This file was generated by Appraisal | ||
|
||
source "http://rubygems.org" | ||
|
||
gem "coveralls", require: false | ||
gem "activesupport", "~> 5.2" | ||
gem "appraisal" | ||
gem "bump", "~> 0.6.1" | ||
gem "pry" | ||
gem "rake" | ||
gem "rubocop", "0.54.0" | ||
gem "rubocop-git" | ||
gem "ruby-prof" | ||
gem "ruby-prof-flamegraph" | ||
gem "rspec" | ||
gem "rspec_junit_formatter" | ||
|
||
gemspec path: "../" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# This file was generated by Appraisal | ||
|
||
source "http://rubygems.org" | ||
|
||
gem "coveralls", require: false | ||
gem "activesupport", "~> 6.0" | ||
gem "appraisal" | ||
gem "bump", "~> 0.6.1" | ||
gem "pry" | ||
gem "rake" | ||
gem "rubocop", "0.54.0" | ||
gem "rubocop-git" | ||
gem "ruby-prof" | ||
gem "ruby-prof-flamegraph" | ||
gem "rspec" | ||
gem "rspec_junit_formatter" | ||
|
||
gemspec path: "../" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module ContextualLogger | ||
VERSION = '0.6.1' | ||
VERSION = '0.7.0' | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,9 +9,10 @@ | |
describe 'ContextualLogger::Overrides::ActiveSupport::TaggedLogging::Formatter' do | ||
before do | ||
Time.now_override = Time.now | ||
@logger = ContextualLogger.new(Logger.new('/dev/null')) | ||
@logger = Logger.new('/dev/null') | ||
@logger.formatter = ->(_, _, _, msg_with_context) { "#{msg_with_context.to_json}\n" } | ||
@logger = ActiveSupport::TaggedLogging.new(@logger) | ||
@logger = ContextualLogger.new(@logger) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yuck, I hadn't noticed how this overwrites |
||
end | ||
|
||
it 'should log log_tags as additional context' do | ||
|
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.
Missing newline here I think?
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 like my script isn't adding the newline to the end 👎 i've gone ahead and added it