exercism-config 0.36.0 → 0.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/tests.yml +1 -0
- data/.rubocop.yml +4 -0
- data/Rakefile +4 -0
- data/bin/rubocop-quick +2 -2
- data/bin/setup_exercism_config +3 -4
- data/bin/setup_exercism_local_aws +13 -10
- data/lib/exercism-config.rb +1 -1
- data/lib/exercism/config.rb +15 -1
- data/lib/exercism_config/determine_environment.rb +4 -0
- data/lib/exercism_config/environment.rb +1 -1
- data/lib/exercism_config/retrieve.rb +3 -10
- data/lib/exercism_config/setup_dynamodb_client.rb +0 -1
- data/lib/exercism_config/setup_s3_client.rb +1 -2
- data/lib/exercism_config/version.rb +1 -1
- data/settings/{test-ci.yml → ci.yml} +1 -0
- data/settings/docker.yml +1 -0
- data/settings/{development.yml → local.yml} +1 -0
- metadata +4 -7
- data/.github/config/rubocop_linter_action.yml +0 -12
- data/settings/test-docker.yml +0 -9
- data/settings/test-local.yml +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7bef38e1eec4bdc3aec906661dc721b4962ce29c6ea8c28d4d36c8cb229a467
|
4
|
+
data.tar.gz: add38650e6608cbcb0de8cd1ce1c4494e89d5729fec70e3eee5ccdb83ccfeef3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a7eaa5ee84d53f259ed47fc6a3bbd8bc0cd1f91f08ae2d92a555890e00b3dd8d5f31effe69c6311c31c0b5c27bc09c32a77f69b2bd8863d912abc95cf88b0a1
|
7
|
+
data.tar.gz: 545ad525ddaa2b43854dfcf9723c93a958393d0c2d270c82b0b81f1d19d95e2d6c338a9acf269b5b0733bfe1ce3e0f296014793e44c9d5669732039bd2bd2ef6
|
data/.github/workflows/tests.yml
CHANGED
@@ -73,6 +73,7 @@ jobs:
|
|
73
73
|
###
|
74
74
|
# Publish the coverage to CodeClimate
|
75
75
|
- name: Publish code coverage
|
76
|
+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
|
76
77
|
env:
|
77
78
|
GIT_BRANCH: ${GITHUB_REF/refs\/heads\//}
|
78
79
|
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
|
data/.rubocop.yml
CHANGED
data/Rakefile
CHANGED
data/bin/rubocop-quick
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
#!/bin/bash
|
2
2
|
|
3
|
-
git diff --name-status --staged | grep '^[MA]' | grep -o '
|
4
|
-
git diff --name-status --staged | grep '^[MA]' | grep -o '
|
3
|
+
git diff --name-status --staged | grep '^[MA]' | grep -o '\s\+.*rb' | xargs bundle exec rubocop --except Metrics --auto-correct --format quiet --force-exclusion lib/exercism-config.rb && \
|
4
|
+
git diff --name-status --staged | grep '^[MA]' | grep -o '\s\+.*rb' | xargs git add
|
data/bin/setup_exercism_config
CHANGED
@@ -5,8 +5,7 @@ require 'exercism-config'
|
|
5
5
|
require 'erb'
|
6
6
|
require 'yaml'
|
7
7
|
|
8
|
-
|
9
|
-
if env == :production
|
8
|
+
if Exercism.env.production?
|
10
9
|
puts 'Aborted! This script should not be run in production.'
|
11
10
|
exit
|
12
11
|
end
|
@@ -71,9 +70,9 @@ settings_file =
|
|
71
70
|
elsif ENV['EXERCISM_DOCKER']
|
72
71
|
File.expand_path('../settings/docker.yml', __dir__)
|
73
72
|
elsif ENV['EXERCISM_CI']
|
74
|
-
File.expand_path('../settings/
|
73
|
+
File.expand_path('../settings/ci.yml', __dir__)
|
75
74
|
else
|
76
|
-
File.expand_path('../settings/
|
75
|
+
File.expand_path('../settings/local.yml', __dir__)
|
77
76
|
end
|
78
77
|
|
79
78
|
puts "Using settings file: #{settings_file}"
|
@@ -3,7 +3,7 @@ require "bundler/setup"
|
|
3
3
|
require "exercism-config"
|
4
4
|
|
5
5
|
# Only allow this to run in development
|
6
|
-
return
|
6
|
+
return if Exercism.env.production?
|
7
7
|
|
8
8
|
puts "Create AWS/DynamoDB tables..."
|
9
9
|
|
@@ -13,15 +13,18 @@ Exercism.config.dynamodb_client = ExercismConfig::SetupDynamoDBClient.()
|
|
13
13
|
# Setup local s3 #
|
14
14
|
##################
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
16
|
+
unless ENV["EXERCISM_SKIP_S3"]
|
17
|
+
[
|
18
|
+
Exercism.config.aws_iterations_bucket,
|
19
|
+
Exercism.config.aws_tooling_jobs_bucket,
|
20
|
+
].each do |bucket|
|
21
|
+
begin
|
22
|
+
ExercismConfig::SetupS3Client.().create_bucket(bucket: bucket)
|
23
|
+
rescue Seahorse::Client::NetworkingError => e
|
24
|
+
puts "local S3 not up yet..."
|
25
|
+
sleep 2 # slighty retry delaty
|
26
|
+
retry
|
27
|
+
end
|
25
28
|
end
|
26
29
|
end
|
27
30
|
|
data/lib/exercism-config.rb
CHANGED
data/lib/exercism/config.rb
CHANGED
@@ -1,12 +1,26 @@
|
|
1
1
|
module Exercism
|
2
2
|
class Config < OpenStruct
|
3
|
+
PROPS_WITH_TEST_SUFFIX = %i[
|
4
|
+
dynamodb_tooling_jobs_table
|
5
|
+
].freeze
|
6
|
+
|
3
7
|
def initialize(data, aws_settings)
|
4
8
|
super(data)
|
5
9
|
self.aws_settings = aws_settings
|
6
10
|
end
|
7
11
|
|
12
|
+
PROPS_WITH_TEST_SUFFIX.each do |prop|
|
13
|
+
define_method prop do
|
14
|
+
Exercism.env.test? ? "#{super()}-test" : super()
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
8
18
|
def to_json(*_args)
|
9
|
-
to_h
|
19
|
+
hash = to_h
|
20
|
+
PROPS_WITH_TEST_SUFFIX.each do |prop|
|
21
|
+
hash[prop] = send(prop)
|
22
|
+
end
|
23
|
+
hash.to_json
|
10
24
|
end
|
11
25
|
end
|
12
26
|
end
|
@@ -4,6 +4,10 @@ module ExercismConfig
|
|
4
4
|
|
5
5
|
def call
|
6
6
|
env = ENV['EXERCISM_ENV'] || ENV['RAILS_ENV'] || ENV['APP_ENV']
|
7
|
+
unless env
|
8
|
+
env = Rails.env.to_s if Object.const_defined?(:Rails) && Rails.respond_to?(:env)
|
9
|
+
end
|
10
|
+
|
7
11
|
raise Exercism::ConfigError, 'No environment set - set one of EXERCISM_ENV, RAILS_ENV or APP_ENV' unless env
|
8
12
|
|
9
13
|
Environment.new(env)
|
@@ -14,11 +14,11 @@ module ExercismConfig
|
|
14
14
|
require 'yaml'
|
15
15
|
|
16
16
|
filename = if ENV["EXERCISM_CI"]
|
17
|
-
'
|
17
|
+
'ci'
|
18
18
|
elsif ENV["EXERCISM_DOCKER"]
|
19
|
-
'
|
19
|
+
'docker'
|
20
20
|
else
|
21
|
-
'
|
21
|
+
'local'
|
22
22
|
end
|
23
23
|
|
24
24
|
settings_file = File.expand_path("../../../settings/#{filename}.yml", __FILE__)
|
@@ -36,13 +36,6 @@ module ExercismConfig
|
|
36
36
|
h[item['id']] = item['value']
|
37
37
|
end
|
38
38
|
|
39
|
-
# Tweak things for dynamodb when we're running in test mode
|
40
|
-
if Exercism.env.test?
|
41
|
-
%w[dynamodb_tooling_jobs_table].each do |key|
|
42
|
-
data[key] = "#{data[key]}-test"
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
39
|
aws_settings = GenerateAwsSettings.()
|
47
40
|
Exercism::Config.new(data, aws_settings)
|
48
41
|
rescue Exercism::ConfigError
|
@@ -18,11 +18,10 @@ module ExercismConfig
|
|
18
18
|
end
|
19
19
|
|
20
20
|
private
|
21
|
-
|
22
21
|
memoize
|
23
22
|
def config_endpoint
|
24
23
|
return nil if Exercism.env.production?
|
25
|
-
return "http://127.0.0.1:#{ENV['S3_PORT']}" if ENV['EXERCISM_CI']
|
24
|
+
return "http://127.0.0.1:#{ENV['S3_PORT']}" if Exercism.env.test? && ENV['EXERCISM_CI']
|
26
25
|
|
27
26
|
host = ENV['EXERCISM_DOCKER'] ? 's3:9090' : 'localhost:3041'
|
28
27
|
"http://#{host}"
|
@@ -1,6 +1,7 @@
|
|
1
1
|
anycable_redis_url: redis://127.0.0.1:6379/1
|
2
2
|
anycable_rpc_host: 127.0.0.1:50051
|
3
3
|
aws_iterations_bucket: exercism-staging-iterations
|
4
|
+
aws_tooling_jobs_bucket: exercism-staging-tooling-jobs
|
4
5
|
dynamodb_tooling_jobs_table: tooling_jobs
|
5
6
|
spi_url: http://127.0.0.1:3020
|
6
7
|
tooling_orchestrator_url: http://127.0.0.1:3021
|
data/settings/docker.yml
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
anycable_redis_url: redis://redis:6379/1
|
2
2
|
anycable_rpc_host: 0.0.0.0:50051
|
3
3
|
aws_iterations_bucket: exercism-staging-iterations
|
4
|
+
aws_tooling_jobs_bucket: exercism-staging-tooling-jobs
|
4
5
|
dynamodb_tooling_jobs_table: tooling_jobs
|
5
6
|
mysql_master_endpoint: mysql
|
6
7
|
mysql_port: 3306
|
@@ -1,6 +1,7 @@
|
|
1
1
|
anycable_redis_url: redis://127.0.0.1:6379/1
|
2
2
|
anycable_rpc_host: 127.0.0.1:50051
|
3
3
|
aws_iterations_bucket: exercism-staging-iterations
|
4
|
+
aws_tooling_jobs_bucket: exercism-staging-tooling-jobs
|
4
5
|
dynamodb_tooling_jobs_table: tooling_jobs
|
5
6
|
mysql_master_endpoint: localhost
|
6
7
|
mysql_socket: /tmp/mysql.sock
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: exercism-config
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.43.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Walker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-08-
|
11
|
+
date: 2020-08-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-dynamodb
|
@@ -131,7 +131,6 @@ executables:
|
|
131
131
|
extensions: []
|
132
132
|
extra_rdoc_files: []
|
133
133
|
files:
|
134
|
-
- ".github/config/rubocop_linter_action.yml"
|
135
134
|
- ".github/workflows/rubocop.yml"
|
136
135
|
- ".github/workflows/tests.yml"
|
137
136
|
- ".gitignore"
|
@@ -157,11 +156,9 @@ files:
|
|
157
156
|
- lib/exercism_config/setup_s3_client.rb
|
158
157
|
- lib/exercism_config/version.rb
|
159
158
|
- package.json
|
160
|
-
- settings/
|
159
|
+
- settings/ci.yml
|
161
160
|
- settings/docker.yml
|
162
|
-
- settings/
|
163
|
-
- settings/test-docker.yml
|
164
|
-
- settings/test-local.yml
|
161
|
+
- settings/local.yml
|
165
162
|
- yarn.lock
|
166
163
|
homepage: https://exercism.io
|
167
164
|
licenses: []
|
data/settings/test-docker.yml
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
anycable_redis_url: redis://some_anycable_redis_url:1234/9
|
2
|
-
anycable_rpc_host: 1.2.3.4:9876543
|
3
|
-
aws_iterations_bucket: some-iterations-bucket
|
4
|
-
dynamodb_tooling_jobs_table: some_tooling_table
|
5
|
-
spi_url: http://some_url:1234
|
6
|
-
tooling_orchestrator_url: http://some_orchestrator_url:1234
|
7
|
-
|
8
|
-
mysql_master_endpoint: mysql
|
9
|
-
mysql_port: 3306
|
data/settings/test-local.yml
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
anycable_redis_url: redis://some_anycable_redis_url:1234/9
|
2
|
-
anycable_rpc_host: 1.2.3.4:9876543
|
3
|
-
aws_iterations_bucket: some-iterations-bucket
|
4
|
-
dynamodb_tooling_jobs_table: some_tooling_table
|
5
|
-
spi_url: http://some_url:1234
|
6
|
-
tooling_orchestrator_url: http://some_orchestrator_url:1234
|
7
|
-
|
8
|
-
mysql_master_endpoint: localhost
|
9
|
-
mysql_socket: /tmp/mysql.sock
|