Skip to content
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
24 changes: 12 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0.0
ruby-version: 3.3
- name: Install dependencies
run: bundle install
- name: Unit test
Expand All @@ -80,17 +80,17 @@ jobs:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0.0
ruby-version: 3.3
- name: Install dependencies
run: bundle install
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v3
with:
languages: ruby
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v3
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v3

codacy-analysis-cli:
name: Codacy Analysis CLI
Expand Down Expand Up @@ -125,25 +125,25 @@ jobs:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0.0
ruby-version: 3.3
- name: Install dependencies
run: bundle install
- name: Set up JDK 8
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '8'
distribution: 'temurin'
java-version: '17'
- name: Smoke Test
run: |
export PATH=${PATH/:\/usr\/local\/lib\/jvm\/openjdk11\/bin:/:}
sudo apt-get update
sudo apt-get install -y openjdk-8-jdk
export JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64"
sudo apt-get install -y openjdk-17-jdk
export JAVA_HOME="/usr/lib/jvm/java-17-openjdk-amd64"
git clone --branch=master https://github.com/vmware/singleton.git server
git clone --branch=devops https://github.com/vmware/singleton.git devops
cd $GITHUB_WORKSPACE/server/g11n-ws && ./gradlew build -x test
cp $GITHUB_WORKSPACE/devops/deploy/i18n-service/Dockerfile $GITHUB_WORKSPACE/server/publish/
cd $GITHUB_WORKSPACE/server/publish && mv singleton-[0~9]*.jar i18n-service.jar
cd $GITHUB_WORKSPACE/server/publish && mv singleton-0.1.0.jar i18n-service.jar
docker build -t singleton .
docker run -d -p 8090:8090 -p 8091:8091 --name singleton singleton
docker ps
Expand Down
8 changes: 4 additions & 4 deletions lib/sgtn-client/loader/server.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# frozen_string_literal: true

# Copyright 2022 VMware, Inc.
# Copyright 2025 VMware, Inc.
# SPDX-License-Identifier: EPL-2.0

require 'faraday'
require 'faraday_middleware'
require 'faraday/gzip'
require 'set'

module SgtnClient
Expand All @@ -26,10 +26,10 @@ def initialize(config)
@components_url = "#{product_root}/componentlist"

@conn = Faraday.new(config.vip_server, request: REQUEST_ARGUMENTS) do |f|
f.response :json # decode response bodies as JSON
f.response :json
f.response :raise_error
f.response :logger, config.logger, { log_level: :debug, headers: false, bodies: true }
f.use :gzip
f.request :gzip
end
end

Expand Down
4 changes: 2 additions & 2 deletions lib/sgtn-client/loader/source.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022-2023 VMware, Inc.
# Copyright 2025 VMware, Inc.

Check warning

Code scanning / Rubocop (reported by Codacy)

Ensures that Ruby files include the frozen_string_literal magic comment at the top to enable frozen string literals by default. Warning

Missing frozen string literal comment.
# SPDX-License-Identifier: EPL-2.0

require 'pathname'
Expand All @@ -20,7 +20,7 @@
total_messages = {}

Pathname.glob(@source_bundle_path + component + '**/*.{yml, yaml}') do |f|
bundle = YAML.load(File.read(f))
bundle = YAML.safe_load(File.read(f), aliases: true)
messages = bundle&.first&.last # TODO: Warn about inconsistent source locale
if messages.is_a?(Hash)
total_messages.merge!(messages)
Expand Down
4 changes: 2 additions & 2 deletions lib/sgtn-client/sgtn-client.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 VMware, Inc.
# Copyright 2025 VMware, Inc.

Check warning

Code scanning / Rubocop (reported by Codacy)

Ensures that Ruby files include the frozen_string_literal magic comment at the top to enable frozen string literals by default. Warning

Missing frozen string literal comment.

Check warning

Code scanning / Rubocop (reported by Codacy)

Ensures Ruby source files are named using snake_case convention. Warning

The name of this source file (sgtn-client.rb) should use snake_case.
# SPDX-License-Identifier: EPL-2.0

require 'forwardable'
Expand Down Expand Up @@ -30,7 +30,7 @@
def_delegators :config, :logger, :logger=

def load(config_file, env, log_file = nil)
configurations = YAML.load(File.read(config_file))
configurations = YAML.safe_load(File.read(config_file), aliases: true)
config_hash = configurations[env]
raise "Configuration[#{env}] NotFound" unless config_hash

Expand Down
4 changes: 2 additions & 2 deletions lib/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright 2022 VMware, Inc.
# Copyright 2025 VMware, Inc.

Check warning

Code scanning / Rubocop (reported by Codacy)

Ensures that Ruby files include the frozen_string_literal magic comment at the top to enable frozen string literals by default. Warning

Missing frozen string literal comment.
# SPDX-License-Identifier: EPL-2.0

VERSION_INFO = [0, 2, 1].freeze
VERSION_INFO = [0, 8, 0].freeze

Check warning

Code scanning / Rubocop (reported by Codacy)

Ensures that the first non-blank, non-comment line in a file has correct indentation. Warning

Indentation of first line in file detected.
VERSION = VERSION_INFO.map(&:to_s).join('.').freeze
5 changes: 3 additions & 2 deletions singleton-client.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ Gem::Specification.new do |s|
s.require_paths = ['lib']

s.add_dependency('concurrent-ruby')
s.add_dependency('faraday')
s.add_dependency('faraday_middleware')
s.add_dependency 'faraday', '~> 2.7'
s.add_dependency 'faraday-gzip', '~> 3'
s.add_dependency('i18n')
s.add_dependency('logging')
s.add_dependency('multi_json') # TODO
s.add_dependency 'observer'
s.add_dependency('request_store')
s.add_dependency('twitter_cldr')

Expand Down
Loading
Loading