Skip to content

Commit f3574b0

Browse files
committed
setup gocd pipeline
1 parent e7d8353 commit f3574b0

File tree

80 files changed

+877
-271
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+877
-271
lines changed

hyperstack.gocd.yaml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,27 @@ pipelines:
1616
auto_update: true
1717
branch: edge
1818
stages:
19-
# - cleanup1:
20-
# fetch_materials: true
21-
# keep_artifacts: false
22-
# clean_workspace: false
23-
# approval:
24-
# type: success
25-
# allow_only_on_success: false
26-
# jobs:
27-
# cleanup:
28-
# timeout: 0
29-
# tasks:
30-
# - exec:
31-
# arguments:
32-
# - compose
33-
# - run
34-
# - --rm
35-
# - --entrypoint
36-
# - "/bin/bash -c 'chown -R 1000:1001 /root/hyperstack'"
37-
# - hyperstack
38-
# command: docker
39-
# run_if: passed
19+
- cleanup1:
20+
fetch_materials: true
21+
keep_artifacts: false
22+
clean_workspace: false
23+
approval:
24+
type: success
25+
allow_only_on_success: false
26+
jobs:
27+
cleanup:
28+
timeout: 0
29+
tasks:
30+
- exec:
31+
arguments:
32+
- compose
33+
- run
34+
- --rm
35+
- --entrypoint
36+
- "/bin/bash -c 'chown -R 1000:1001 /root/hyperstack'"
37+
- hyperstack
38+
command: docker
39+
run_if: passed
4040
- execute:
4141
fetch_materials: true
4242
keep_artifacts: false

ruby/hyper-component/.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ before_script:
2121
- bundle install --jobs=3 --retry=3
2222
- bundle exec rails db:setup
2323
- cd ../../
24+
- if [[ "$DRIVER" == "google-chrome" ]]; then bundle exec chromedriver-update; fi
25+
- if [[ "$DRIVER" == "google-chrome" ]]; then ls -lR ~/.chromedriver-helper/; fi
2426
- if [[ "$DRIVER" == "google-chrome" ]]; then bundle exec chromedriver --version; fi
2527
- if [[ "$DRIVER" == "google-chrome" ]]; then google-chrome --version; fi
2628
- if [[ "$DRIVER" == "google-chrome" ]]; then which google-chrome; fi

ruby/hyper-component/Gemfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ gem 'hyper-spec', path: '../hyper-spec'
44
gem 'hyperstack-config', path: '../hyperstack-config'
55
gem 'hyper-store', path: '../hyper-store'
66
gem 'hyper-state', path: '../hyper-state'
7-
unless ENV['OPAL_VERSION']&.match("0.11")
8-
gem 'opal-browser', git: 'https://github.com/opal/opal-browser'
9-
end
7+
# unless ENV['OPAL_VERSION']&.match("0.11")
8+
# gem 'opal-browser', git: 'https://github.com/opal/opal-browser'
9+
# end
1010
gem 'hyper-trace', path: '../hyper-trace'
1111

1212
#gem 'puma', '~> 3.11.0' # As of adding, version 3.12.0 isn't working so we are locking

ruby/hyper-component/hyper-component.gemspec

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,26 @@ Gem::Specification.new do |spec|
2020
spec.add_dependency 'hyper-state', Hyperstack::Component::VERSION
2121
spec.add_dependency 'hyperstack-config', Hyperstack::Component::VERSION
2222
spec.add_dependency 'opal-activesupport', '~> 0.3.1'
23-
spec.add_dependency 'react-rails', '>= 2.4.0', '< 2.7.0'
23+
spec.add_dependency 'react-rails', '>= 2.4.0', '< 2.5.0'
2424

2525
spec.add_development_dependency 'bundler'
26+
spec.add_development_dependency 'chromedriver-helper'
2627
spec.add_development_dependency 'hyper-spec', Hyperstack::Component::VERSION
2728
spec.add_development_dependency 'jquery-rails'
2829
spec.add_development_dependency 'listen'
2930
spec.add_development_dependency 'mime-types'
30-
spec.add_development_dependency 'mini_racer'#, '< 0.4.0' # something is busted with 0.4.0 and its libv8-node dependency
31+
spec.add_development_dependency 'mini_racer', '< 0.4.0' # something is busted with 0.4.0 and its libv8-node dependency
3132
spec.add_development_dependency 'nokogiri'
3233
spec.add_development_dependency 'opal-jquery'
33-
spec.add_development_dependency 'opal-rails', '>= 0.9.4', '< 2.0'
34+
spec.add_development_dependency 'opal-rails'
3435
spec.add_development_dependency 'pry-rescue'
3536
spec.add_development_dependency 'pry-stack_explorer'
36-
spec.add_development_dependency 'puma'
37+
spec.add_development_dependency 'puma', '<= 5.4.0'
3738
spec.add_development_dependency 'rails', ENV['RAILS_VERSION'] || '>= 5.0.0', '< 7.0'
3839
spec.add_development_dependency 'rails-controller-testing'
3940
spec.add_development_dependency 'rake'
4041
spec.add_development_dependency 'rspec-rails'
4142
spec.add_development_dependency 'rubocop' #, '~> 0.51.0'
4243
spec.add_development_dependency 'sqlite3', '~> 1.4.2'
43-
spec.add_development_dependency 'timecop'#, '~> 0.8.1'
44+
spec.add_development_dependency 'timecop', '~> 0.8.1'
4445
end
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module Hyperstack
22
module Component
3-
VERSION = '1.0.alpha1.8.0009' # '1.0.alpha1.5'
3+
VERSION = '1.0.alpha1.8.0010' # '1.0.alpha1.5'
44
end
55
end

ruby/hyper-component/lib/hyperstack/internal/component/props_wrapper.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,9 @@ def [](prop)
110110
def fetch_from_cache(name, param_type, props)
111111
last, cached_value = cache[name]
112112
return cached_value if last.equal?(props[name])
113-
value = convert_param(name, param_type, props)
114-
cache[name] = [props[name], value]
115-
return value
113+
convert_param(name, param_type, props).tap do |value|
114+
cache[name] = [props[name], value]
115+
end
116116
end
117117

118118
def convert_param(name, param_type, props)

ruby/hyper-component/lib/hyperstack/internal/component/react_wrapper.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,11 @@ def self.import_native_component(opal_class, native_class)
3232
def self.eval_native_react_component(name)
3333
component = `eval(name)`
3434
raise "#{name} is not defined" if `#{component} === undefined`
35+
3536
component = `component.default` if `component.__esModule && component.default`
3637
is_component_class = `#{component}.prototype !== undefined` &&
37-
(`!!#{component}.prototype.isReactComponent` ||
38-
`!!#{component}.prototype.render`)
38+
(`!!#{component}.prototype.isReactComponent` ||
39+
`!!#{component}.prototype.render`)
3940
is_memo = `#{component}.type != undefined` && `typeof #{component}.type.render === "function"`
4041
has_render_method = `typeof #{component}.render === "function"`
4142
unless is_component_class || stateless?(component) || has_render_method || is_memo

ruby/hyper-component/spec/active_support_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ def payments
1818
GenericEnumerable.new([ Payment.new(5), Payment.new(15), Payment.new(10) ])
1919
end
2020
end
21+
2122
expect_evaluate_ruby do
2223
{ Payment.new(5) => 5, Payment.new(15) => 15, Payment.new(10) => 10 } == payments.index_with(&:price)
2324
end.to be_truthy

ruby/hyper-component/spec/client_features/component_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ class Lorem; end
542542
end
543543
Hyperstack::Component::ReactTestUtils.render_component_into_document(Foo, bar: 10, lorem: Lorem.new)
544544
end
545-
expect(page.driver.browser.manage.logs.get(:browser).map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n"))
545+
expect(page.driver.browser.logs.get(:browser).map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n"))
546546
.to match(/Warning: Failed prop( type|Type): In component `Foo`\nRequired prop `foo` was not specified\nProvided prop `bar` could not be converted to String/)
547547
end
548548

@@ -560,7 +560,7 @@ class Lorem; end
560560
end
561561
Hyperstack::Component::ReactTestUtils.render_component_into_document(Foo, foo: 10, bar: '10', lorem: Lorem.new)
562562
end
563-
expect(page.driver.browser.manage.logs.get(:browser).map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n")).to_not match(/prop/)
563+
expect(page.driver.browser.logs.get(:browser).map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n")).to_not match(/prop/)
564564
end
565565
end
566566

@@ -597,7 +597,7 @@ class Foo
597597

598598
Hyperstack::Component::ReactTestUtils.render_component_into_document(foo)
599599
end
600-
expect(page.driver.browser.manage.logs.get(:browser)
600+
expect(page.driver.browser.logs.get(:browser)
601601
.reject { |entry| entry.to_s.include?('Deprecated feature') }
602602
.reject { |entry| entry.to_s.include?('Object freezing is not supported by Opal')}
603603
.map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n").size)
@@ -612,7 +612,7 @@ class Foo < Hyperloop::Component
612612
render { Foo }
613613
end
614614
end
615-
expect(page.driver.browser.manage.logs.get(:browser).map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n"))
615+
expect(page.driver.browser.logs.get(:browser).map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n"))
616616
.to match(/did you mean to say Foo()/)
617617
end
618618
end

ruby/hyper-component/spec/client_features/dsl_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ class NestedComp < Hyperloop::Component
182182
class Comp; end
183183
end
184184
end
185-
expect(page.driver.browser.manage.logs.get(:browser).map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n"))
185+
expect(page.driver.browser.logs.get(:browser).map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n"))
186186
.to match(/Comp does not appear to be a react component./)
187187
end
188188

0 commit comments

Comments
 (0)