Skip to content
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

FEATURE: MSF-25417 Revert code to allow LCM image (K8S) run with JRuby latest version 9.4.1.0 #1946

Merged
2 commits merged into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions .github/workflows/pre-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: [2.3, 2.4, 2.5, 2.6, 2.7.6, jruby-9.1.17]
ruby-version: [2.3, 2.4, 2.5, 2.6, 2.7.6, 3.2.1, jruby-9.1.17, jruby-9.4.1]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: ruby/setup-ruby@v1
Expand All @@ -38,12 +38,16 @@ jobs:
xcode-version: 9
- ruby-version: 2.7.6
xcode-version: 9
- ruby-version: 3.2.1
xcode-version: 9
- ruby-version: jruby-9.1.17
xcode-version: latest
- ruby-version: jruby-9.4.1
xcode-version: latest
steps:
- name: run prepare-env
run: brew install pkg-config
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
Expand All @@ -53,12 +57,12 @@ jobs:
pronto-code-review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.5
ruby-version: 3.2
bundler-cache: true
- name: run pronto-code-review
run: |
Expand Down
16 changes: 2 additions & 14 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ClassLength:
Enabled: false

Metrics/BlockLength:
Max: 40
Max: 60

ModuleLength:
Enabled: false
Expand Down Expand Up @@ -49,9 +49,6 @@ PerceivedComplexity:
Alias:
Enabled: false

Casecmp:
Enabled: false

ConditionalAssignment:
Enabled: false

Expand All @@ -73,12 +70,6 @@ MultilineMethodCallIndentation:
MutableConstant:
Enabled: false

RedundantBlockCall:
Enabled: false

RedundantMerge:
Enabled: false

RedundantParentheses:
Enabled: false

Expand All @@ -88,10 +79,7 @@ StringLiterals:
SignalException:
Enabled: false

TimesMap:
Enabled: false

UnneededInterpolation:
RedundantInterpolation:
Enabled: false

UselessAccessModifier:
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM 020413372491.dkr.ecr.us-east-1.amazonaws.com/tools/gdc-java-8-jre-centos8:202308081603.4a43db3

ARG RVM_VERSION=stable
ARG JRUBY_VERSION=9.2.5.0
ARG JRUBY_VERSION=9.4.1.0

LABEL image_name="GDC LCM Bricks"
LABEL maintainer="LCM <[email protected]>"
Expand Down Expand Up @@ -29,9 +29,9 @@ RUN curl -sSL https://rvm.io/mpapis.asc | gpg --import - \
# Switch to a bash login shell to allow simple 'rvm' in RUN commands
SHELL ["/bin/bash", "-l", "-c"]

RUN rvm install jruby-${JRUBY_VERSION} && gem update --system 3.0.6 \
&& gem install bundler -v 1.17.3 \
&& gem install rake -v 11.3.0
RUN rvm install jruby-${JRUBY_VERSION} && gem update --system \
&& gem install bundler -v 2.4.6 \
&& gem install rake -v 13.0.6

WORKDIR /src

Expand Down
10 changes: 5 additions & 5 deletions Dockerfile.jruby
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
FROM jruby:9.1-alpine
FROM jruby:9.4.1.0

MAINTAINER Tomas Korcak <[email protected]>

RUN apk add --no-cache curl make gcc git g++ python linux-headers binutils-gold gnupg libstdc++
RUN apt-get update && apt-get install -y curl make gcc git g++ python binutils-gold gnupg libstdc++6 cmake

# Switch to directory with sources
WORKDIR /src
ENV HOME=/src
ENV BUNDLE_PATH=$HOME/bundle

RUN gem update --system 3.0.6 \
&& gem install --install-dir $BUNDLE_PATH bundler -v 1.17.3 \
&& gem install --install-dir $BUNDLE_PATH rake -v 11.3.0
RUN gem update --system \
&& gem install --install-dir $BUNDLE_PATH bundler -v 2.4.6 \
&& gem install --install-dir $BUNDLE_PATH rake -v 13.0.6

ADD . .

Expand Down
12 changes: 5 additions & 7 deletions Dockerfile.ruby
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
FROM ruby:2.3-alpine
FROM ruby:3.2.1

MAINTAINER Tomas Korcak <[email protected]>

RUN apk add --no-cache curl make gcc git g++ python linux-headers binutils-gold gnupg libstdc++ openssl cmake curl-dev

RUN ln -s /usr/bin/make /usr/bin/gmake
RUN apt-get update && apt-get install -y curl make gcc git openssh-client g++ python binutils-gold gnupg libstdc++6 cmake

# Switch to directory with sources
WORKDIR /src
ENV HOME=/src
ENV BUNDLE_PATH=$HOME/bundle

RUN gem update --system 3.0.6 \
&& gem install --install-dir $BUNDLE_PATH bundler -v 1.17.3 \
&& gem install --install-dir $BUNDLE_PATH rake -v 11.3.0
RUN gem update --system \
&& gem install --install-dir $BUNDLE_PATH bundler -v 2.4.6 \
&& gem install --install-dir $BUNDLE_PATH rake -v 13.0.6

ADD . .

Expand Down
6 changes: 4 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
source 'https://rubygems.org'

gem 'net-smtp', require: false

group 'development' do
unless RUBY_PLATFORM == 'java'
gem 'pronto-flay',
git: 'https://github.com/kubamahnert/pronto-flay',
branch: 'flay-mass-threshold'
git: 'https://github.com/prontolabs/pronto-flay'
# branch: 'flay-mass-threshold'
end
end

Expand Down
40 changes: 19 additions & 21 deletions gooddata.gemspec
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# encoding: utf-8
$LOAD_PATH.push File.expand_path('../lib/', __FILE__)
require 'gooddata/version'

Gem::Specification.new do |s|
s.name = 'gooddata'
s.version = GoodData::VERSION
s.licenses = ['BSD-3-Clause']
s.platform = 'java' if RUBY_PLATFORM =~ /java/

s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
s.authors = [
'Pavel Kolesnikov',
Expand All @@ -18,44 +16,44 @@ Gem::Specification.new do |s|
'Petr Gadorek',
'Jakub Mahnert'
]

s.summary = 'A convenient Ruby wrapper around the GoodData RESTful API'
s.description = 'Use the GoodData::Client class to integrate GoodData into your own application or use the CLI to work with GoodData directly from the command line.'
s.email = '[email protected]'
s.extra_rdoc_files = %w(LICENSE README.md)

s.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR).map { |f| f unless %w(NOTICES.txt LICENSE_FOR_RUBY_SDK_COMPONENT.txt).include?(f) }
s.files.reject! { |fn| fn.start_with? 'spec/' }
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }

s.homepage = 'http://github.com/gooddata/gooddata-ruby'
s.require_paths = ['lib']

# s.add_development_dependency 'bundler', "~> 1.14"
s.add_development_dependency 'license_finder', '~> 2.0'
s.add_development_dependency 'rake', '~> 11.1'
s.add_development_dependency 'rake', '~> 13.0'
s.add_development_dependency 'redcarpet', '~> 3.1' if RUBY_PLATFORM != 'java'
s.add_development_dependency 'rspec', '~> 3.5.0'
s.add_development_dependency 'rspec-expectations', '~> 3.5'
s.add_development_dependency 'rspec_junit_formatter', '~> 0.3.0'
s.add_development_dependency 'rubocop', '~> 0.59.1'
s.add_development_dependency 'rspec', '~> 3.12.0'
s.add_development_dependency 'rspec-expectations', '~> 3.12'
s.add_development_dependency 'rspec_junit_formatter', '~> 0.6.0'
if RUBY_VERSION >= '2.6'
s.add_development_dependency 'rubocop', '>= 1.28'
else
s.add_development_dependency 'rubocop', '~> 0.81'
end
s.add_development_dependency 'simplecov', '~> 0.12'
s.add_development_dependency 'webmock', '~> 2.3.1'
s.add_development_dependency 'yard', '~> 0.9.11'
s.add_development_dependency 'yard-rspec', '~> 0.1'
s.add_development_dependency 'pry'
s.add_development_dependency 'pry-byebug', '~> 3.6' if RUBY_PLATFORM != 'java'

s.add_development_dependency 'pronto', '~> 0.10' if RUBY_PLATFORM != 'java'
s.add_development_dependency 'pronto-rubocop', '~> 0.9' if RUBY_PLATFORM != 'java'
s.add_development_dependency 'pronto-reek', '~> 0.9' if RUBY_PLATFORM != 'java'
s.add_development_dependency 'pronto', '>= 0.10' if RUBY_PLATFORM != 'java'
s.add_development_dependency 'pronto-rubocop', '>= 0.9' if RUBY_PLATFORM != 'java'
s.add_development_dependency 'pronto-reek', '>= 0.9' if RUBY_PLATFORM != 'java'
s.add_development_dependency 'vcr', '5.0.0'
s.add_development_dependency 'hashdiff', '~> 0.4'

s.add_development_dependency 'sqlite3' if RUBY_PLATFORM != 'java'

if RUBY_VERSION >= '2.5'
s.add_dependency 'activesupport', '>= 6.0.3.1', '< 6.2'
s.add_dependency 'activesupport', '>= 6.0.3.1'
else
s.add_dependency 'activesupport', '>= 5.2.4.3', '< 6.0'
end
Expand All @@ -66,19 +64,19 @@ Gem::Specification.new do |s|
else
s.add_dependency 'docile', '> 1.1', '< 1.4.0'
end
s.add_dependency 'azure-storage-blob', '~> 1.1.0'
s.add_dependency 'nokogiri', '~> 1.10.0'
s.add_dependency 'azure-storage-blob', '~> 2.0'
s.add_dependency 'nokogiri', '~> 1', '>= 1.10.8'
s.add_dependency 'gli', '~> 2.15'
s.add_dependency 'gooddata_datawarehouse', '~> 0.0.10' if RUBY_PLATFORM == 'java'
s.add_dependency 'gooddata_datawarehouse', '~> 0.0.11' if RUBY_PLATFORM == 'java'
s.add_dependency 'highline', '= 2.0.0.pre.develop.14'
s.add_dependency 'json_pure', '~> 1.8'
s.add_dependency 'json_pure', '~> 2.6'
s.add_dependency 'multi_json', '~> 1.12'
s.add_dependency 'parseconfig', '~> 1.0'
s.add_dependency 'pmap', '~> 1.1'
s.add_dependency 'remote_syslog_logger', '~> 1.0.3'
s.add_dependency 'restforce', '>= 2.4', '< 4.0'
s.add_dependency 'restforce', '>= 2.4'
s.add_dependency 'rest-client', '~> 2.0'
s.add_dependency 'rubyzip', '~> 1.2', '>= 1.2.1'
s.add_dependency 'rubyzip'
s.add_dependency 'terminal-table', '~> 1.7'
s.add_dependency 'thread_safe'
s.add_dependency 'backports'
Expand Down
19 changes: 13 additions & 6 deletions lib/gooddata/lcm/actions/synchronize_etls_in_segment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -164,24 +164,31 @@ def call(params)
to_project.set_metadata('GOODOT_CUSTOM_PROJECT_ID', client_id) # TMA-210

to_project.schedules.each do |schedule|
schedule_name = schedule.name
if delete_extra_process_schedule
unless from_project_etl_names[:schedules].include?([schedule.name, to_project_process_id_names[schedule.process_id]])
schedule_project_info = [schedule_name, to_project_process_id_names[schedule.process_id]]
unless from_project_etl_names[:schedules].include?(schedule_project_info)
schedule.delete
next
end
end

params_for_all_projects_schedule_name = params_for_all_projects[schedule_name]
params_for_this_client_schedule_name = params_for_this_client[schedule_name]
hidden_params_for_all_projects_schedule_name = hidden_params_for_all_projects[schedule_name]
hidden_params_for_this_client_schedule_name = hidden_params_for_this_client[schedule_name]

schedule.update_params(schedule_additional_params) if schedule_additional_params
schedule.update_params(params_for_all_schedules_in_all_projects) if params_for_all_schedules_in_all_projects
schedule.update_params(params_for_all_projects[schedule.name]) if params_for_all_projects[schedule.name]
schedule.update_params(**params_for_all_schedules_in_all_projects) if params_for_all_schedules_in_all_projects
schedule.update_params(**params_for_all_projects_schedule_name) if params_for_all_projects_schedule_name
schedule.update_params(params_for_all_schedules_in_this_client) if params_for_all_schedules_in_this_client
schedule.update_params(params_for_this_client[schedule.name]) if params_for_this_client[schedule.name]
schedule.update_params(**params_for_this_client_schedule_name) if params_for_this_client_schedule_name

schedule.update_hidden_params(schedule_additional_hidden_params) if schedule_additional_hidden_params
schedule.update_hidden_params(hidden_params_for_all_schedules_in_all_projects) if hidden_params_for_all_schedules_in_all_projects
schedule.update_hidden_params(hidden_params_for_all_projects[schedule.name]) if hidden_params_for_all_projects[schedule.name]
schedule.update_hidden_params(hidden_params_for_all_projects_schedule_name) if hidden_params_for_all_projects_schedule_name
schedule.update_hidden_params(hidden_params_for_all_schedules_in_this_client) if hidden_params_for_all_schedules_in_this_client
schedule.update_hidden_params(hidden_params_for_this_client[schedule.name]) if hidden_params_for_this_client[schedule.name]
schedule.update_hidden_params(hidden_params_for_this_client_schedule_name) if hidden_params_for_this_client_schedule_name

schedule.enable
schedule.save
Expand Down
2 changes: 1 addition & 1 deletion lib/gooddata/mixins/inspector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module GoodData
module Mixin
# When an RSpec test like this fails,
#
# @my_array.should == [@some_model, @some_model2]
# expect(@my_array).to == [@some_model, @some_model2]
#
# RSpec will call inspect on each of the objects to "help" you figure out
# what went wrong. Well, inspect will usually dump a TON OF SHIT and make trying
Expand Down
2 changes: 1 addition & 1 deletion lib/gooddata/models/segment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def provision_client_projects(segments = [])
res = client.poll_on_code(res['asyncTask']['links']['poll'])
failed_count = GoodData::Helpers.get_path(res, %w(clientProjectProvisioningResult failed count), 0)
created_count = GoodData::Helpers.get_path(res, %w(clientProjectProvisioningResult created count), 0)
return Enumerator.new([]) if (failed_count + created_count).zero?
return [].to_enum if (failed_count + created_count).zero?

Enumerator.new do |y|
uri = GoodData::Helpers.get_path(res, %w(clientProjectProvisioningResult links details))
Expand Down
25 changes: 20 additions & 5 deletions lib/gooddata/models/user_filters/user_filter_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,26 @@ def self.row_based?(options = {})
end

def self.read_file(file, options = {})
memo = {}
params = row_based?(options) ? { headers: false } : { headers: true }
memo = Hash[]
if row_based?(options)
read_data_without_header(file, memo, options)
else
read_data_with_header(file, memo, options)
end
memo
end

CSV.foreach(file, params.merge(return_headers: false)) do |e|
key, data = process_line(e, options)
def self.read_data_without_header(file, memo, options)
CSV.foreach(file, headers: false, return_headers: false) do |row|
key, data = process_line(row, options)
memo[key] = [] unless memo.key?(key)
memo[key].concat(data)
end
end

def self.read_data_with_header(file, memo, options)
CSV.foreach(file, headers: true, return_headers: false) do |row|
key, data = process_line(row, options)
memo[key] = [] unless memo.key?(key)
memo[key].concat(data)
end
Expand Down Expand Up @@ -573,7 +588,7 @@ def self.execute_mufs(user_filters, options = {})
# @param file [String | Array] File or array of values to be parsed for filters
# @param options [Hash] Filter definitions
# @return [Array<Hash>]
def self.get_values(file, options)
def self.get_values(file, options = {})
file.is_a?(Array) ? read_array(file, options) : read_file(file, options)
end

Expand Down
4 changes: 2 additions & 2 deletions spec/bricks/bricks_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

describe GoodData::Bricks do
it "Has GoodData::Bricks::Brick class" do
GoodData::Bricks::Brick.should_not be(nil)
expect(GoodData::Bricks::Brick).not_to be_nil
end

it "should be possible to use block as an app in pipeline" do
Expand Down Expand Up @@ -70,7 +70,7 @@ def call(params)
}
)

res.should eq(
expect(res).to eq(
'config' => {
'my' => {
'namespace' => {
Expand Down
2 changes: 1 addition & 1 deletion spec/integration/command_datawarehouse_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

it "Is Possible to create GoodData::Command::DataWarehouse instance" do
cmd = GoodData::Command::DataWarehouse.new
cmd.should be_a(GoodData::Command::DataWarehouse)
expect(cmd).to be_a(GoodData::Command::DataWarehouse)
end

it "Can create a data warehouse", broken: true do
Expand Down
Loading