gazer 0.2.58 → 0.2.59

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 71d91f9fd62be429d6cda41b4bbf5a7cb6b7b4dc2d271f45d327370f3aa68b96
4
- data.tar.gz: 445e0c520b50f7da011b7742045a5f8a35fef89022b0aeddd4749a420373879d
3
+ metadata.gz: b67ec12c5dba850ab2a62f07164e4d051e202cbe0b3b44b50a854499c87f80dc
4
+ data.tar.gz: 33ffc537d99dd9a184e43b20bc44423a0ed40d11966d1bfde06c637f23b71e5f
5
5
  SHA512:
6
- metadata.gz: b3e8ebc3d02a6ac73e43a4da4a2256a8c2b3a58c254eea90c2204a64428c03032bbfd9330ac9b37c4440328b86a62f6c969697348243701d9dc58f54683078ff
7
- data.tar.gz: a28a41041e739a5724f4ebba873a1afd67be9d473f66a7a2efef439ea342cd760435aac7dfcc100d73e89562d8f2de796ad1e86f82faeb70d3546481adf9d0e3
6
+ metadata.gz: dbcbad1a30333e30a9de999ac7a9a807ed8b306378197a828397c1d7cf00bebec51190b0b3f35dc04828d0c6c8449b2b25f0b1811c85c9db0154abe2ed1b4f69
7
+ data.tar.gz: dbcc80f63e040184eebbffd1211cc20df0dcd9454277bbb4b71abfa8afbc45dd7fc1a103f0ef2976d5d6ee52e4a8454958b54e9452e645292aba3deaa2bd098a
@@ -26,7 +26,7 @@ jobs:
26
26
  # Setup ruby if a release was created
27
27
  - uses: ruby/setup-ruby@v1
28
28
  with:
29
- ruby-version: 2.5.8
29
+ ruby-version: 2.7.7
30
30
  if: ${{ steps.release.outputs.release_created }}
31
31
  # Bundle install
32
32
  - run: bundle install
@@ -5,73 +5,61 @@ on:
5
5
  branches: [ main ]
6
6
  pull_request:
7
7
  branches: [ main ]
8
+ workflow_dispatch:
8
9
 
9
10
  env:
10
11
  LOOKERSDK_BASE_URL: https://localhost:20000
11
12
  LOOKERSDK_VERIFY_SSL: false
12
- LOOKERSDK_CLIENT_ID: ${{ secrets.LOOKERSDK_CLIENT_ID__21_18 }}
13
- LOOKERSDK_CLIENT_SECRET: ${{ secrets.LOOKERSDK_CLIENT_SECRET__21_18 }}
13
+ LOOKERSDK_CLIENT_ID: ${{ secrets.LOOKERSDK_CLIENT_ID }}
14
+ LOOKERSDK_CLIENT_SECRET: ${{ secrets.LOOKERSDK_CLIENT_SECRET }}
14
15
 
15
16
  jobs:
17
+ setup:
18
+ uses: looker-open-source/reusable-actions/.github/workflows/supported-versions.yml@main
19
+
16
20
  test:
17
- name: Test - ${{ matrix.os }} / Looker.${{ matrix.looker }} / Ruby.${{ matrix.ruby-version }}
18
- runs-on: ${{ matrix.os }}-latest
21
+ name: Test - Looker.${{ matrix.looker }} / Ruby.${{ matrix.ruby-version }}
22
+ runs-on: ubuntu-latest
23
+ needs: setup
19
24
  strategy:
20
25
  matrix:
21
- os:
22
- - ubuntu
23
- looker:
24
- - '21_18'
25
- - '21_20'
26
- - '22_0'
27
- ruby-version: [2.5.8]
26
+ looker: ${{ fromJson(needs.setup.outputs.matrix_json) }}
27
+ ruby-version: [2.7.7]
28
28
 
29
29
  steps:
30
- - uses: actions/checkout@v2
30
+ - name: Cancel Previous Runs
31
+ uses: styfle/cancel-workflow-action@0.11.0
32
+ with:
33
+ access_token: ${{ secrets.GITHUB_TOKEN }}
31
34
 
32
- - name: Set up Cloud SDK
33
- uses: google-github-actions/setup-gcloud@v0.2.0
35
+ - uses: actions/checkout@v3
36
+
37
+ - name: Authenticate to Google Cloud
38
+ uses: google-github-actions/auth@v1.0.0
34
39
  with:
40
+ credentials_json: ${{ secrets.GCP_AR_READER_SA_KEY }}
35
41
  project_id: ${{ secrets.GCP_PROJECT_ID }}
36
- service_account_key: ${{ secrets.GCP_AR_READER_SA_KEY }}
37
- export_default_credentials: true
42
+ create_credentials_file: true
43
+ export_environment_variables: true
44
+
45
+ - name: Set up Cloud SDK
46
+ uses: google-github-actions/setup-gcloud@v1.1.0
38
47
 
39
48
  - name: Authenticate Artifact Repository
40
49
  run: gcloud auth configure-docker us-west1-docker.pkg.dev --quiet
41
50
 
42
51
  - name: Pull and run Looker docker image
43
- # TODO: can we cache some layers of the image for faster download?
44
- # we probably don't want to cache the final image for IP security...
45
52
  run: |
46
53
  docker pull --quiet us-west1-docker.pkg.dev/cloud-looker-sdk-codegen-cicd/looker/${{ matrix.looker }}
47
54
  # set $LOOKER_OPTS to --no-ssl if we want to turn off ssl
48
55
  docker run --name looker-sdk-codegen-ci -d -p 10000:9999 -p 20000:19999 us-west1-docker.pkg.dev/cloud-looker-sdk-codegen-cicd/looker/${{ matrix.looker }}
49
56
  docker logs -f looker-sdk-codegen-ci --until=30s &
50
57
 
51
- - name: Determine credentials version
52
- # Prior to 21_18, each version had different credentials and a
53
- # different secret. 21_20 and later all use the same credentials
54
- # as 21_18. The parse_version.sh script parses the version and
55
- # yields 21_12, 21_14, 21_16 etc for those versions but 21_18 for
56
- # anything 21_18, 21_20, 22_0, etc.
57
- #
58
- # This can be factored out entirely once 21_18 is the earliest
59
- # supported looker version.
60
- run: |
61
- echo "CREDENTIALS_VERSION=$(${{ github.workspace }}/.github/scripts/parse_version.sh <<< ${{ matrix.looker }})" >> $GITHUB_ENV
62
-
63
- - name: Set up Looker credentials
64
- # Load the correct credentials based on the version from
65
- # the prior step.
66
- run: |
67
- echo "LOOKERSDK_CLIENT_ID=${{ secrets[format('LOOKERSDK_CLIENT_ID__{0}', env.CREDENTIALS_VERSION )] }}" >> $GITHUB_ENV
68
- echo "LOOKERSDK_CLIENT_SECRET=${{ secrets[format('LOOKERSDK_CLIENT_SECRET__{0}', env.CREDENTIALS_VERSION )] }}" >> $GITHUB_ENV
69
-
70
58
  - name: Set up Ruby ${{ matrix.ruby-version }}
71
59
  uses: ruby/setup-ruby@v1
72
60
  with:
73
61
  ruby-version: ${{ matrix.ruby-version }}
74
- bundler-cache: true
62
+ bundler-cache: false
75
63
 
76
64
  - name: Install dependencies
77
65
  run: bundle install
@@ -80,5 +68,51 @@ jobs:
80
68
  run: |
81
69
  ${{ github.workspace }}/.github/scripts/wait_for_looker.sh
82
70
 
71
+ - name: Report Failure
72
+ run: |
73
+ curl --request POST \
74
+ --url https://api.github.com/repos/looker-open-source/sdk-codegen/check-runs \
75
+ --header "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
76
+ --header "content-type: application/json" \
77
+ --header "Accept: application/vnd.github.v3+json" \
78
+ --data '{
79
+ "name": "Ruby-CI Tests",
80
+ "head_sha": "${{ github.event.pull_request.head.sha || github.sha }}",
81
+ "conclusion": "failure"
82
+ }' \
83
+ --fail
84
+ if: failure()
85
+
83
86
  - name: Run tests
84
87
  run: bundle exec rake
88
+
89
+ - name: Upload ts unit test results
90
+ if: ${{ always() }}
91
+ uses: actions/upload-artifact@v2
92
+ with:
93
+ name: ruby-ci-test-results-${{ matrix.looker }}
94
+ path: rspec.xml
95
+
96
+ publish-test-results:
97
+ needs: [test]
98
+ if: success() || failure()
99
+ runs-on: ubuntu-latest
100
+
101
+ steps:
102
+ - name: Download Artifacts
103
+ uses: actions/download-artifact@v2
104
+ with:
105
+ path: artifacts
106
+
107
+ - name: Publish Test Results
108
+ uses: EnricoMi/publish-unit-test-result-action@v1.12
109
+ with:
110
+ # Cosmetic issue with `check_name` being associated to the wrong
111
+ # workflow: https://github.com/EnricoMi/publish-unit-test-result-action/issues/12
112
+ check_name: Ruby-CI Tests
113
+ github_token: ${{ secrets.GITHUB_TOKEN }}
114
+ report_individual_runs: true
115
+ hide_comments: orphaned commits
116
+ check_run_annotations: 'none'
117
+ compare_to_earlier_commit: false
118
+ files: 'artifacts/**/*.xml'
data/.rspec CHANGED
@@ -1,3 +1,5 @@
1
1
  --format documentation
2
2
  --color
3
+ --format RspecJunitFormatter
4
+ --out rspec.xml
3
5
  --require spec_helper
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-2.5.8
1
+ ruby-2.7.7
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ### [0.2.59](https://www.github.com/looker-open-source/gzr/compare/v0.2.58...v0.2.59) (2023-03-29)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * migrate to API 4.0 ([#154](https://www.github.com/looker-open-source/gzr/issues/154)) ([eecdfd4](https://www.github.com/looker-open-source/gzr/commit/eecdfd41a886f2edbac528a34f83dc7a6ea83f74))
9
+
3
10
  ### [0.2.58](https://www.github.com/looker-open-source/gzr/compare/v0.2.57...v0.2.58) (2023-03-16)
4
11
 
5
12
 
data/Gemfile CHANGED
@@ -21,7 +21,7 @@
21
21
 
22
22
  RUBY_VERSION = File.read(File.join(File.dirname(__FILE__), '.ruby-version')).split('-').last.chomp
23
23
 
24
- ruby '2.5.8', engine: 'ruby', engine_version: '2.5.8'
24
+ ruby '2.7.7', engine: 'ruby', engine_version: '2.7.7'
25
25
 
26
26
  source "https://rubygems.org"
27
27
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gazer (0.2.58)
4
+ gazer (0.2.59)
5
5
  looker-sdk (~> 0.1.1, <= 0.1.2)
6
6
  net-http-persistent (~> 4.0, >= 4.0.1)
7
7
  netrc (~> 0.11.0)
@@ -17,7 +17,7 @@ GEM
17
17
  specs:
18
18
  addressable (2.8.1)
19
19
  public_suffix (>= 2.0.2, < 6.0)
20
- connection_pool (2.3.0)
20
+ connection_pool (2.4.0)
21
21
  diff-lcs (1.4.4)
22
22
  faraday (1.10.3)
23
23
  faraday-em_http (~> 1.0)
@@ -66,6 +66,8 @@ GEM
66
66
  diff-lcs (>= 1.2.0, < 2.0)
67
67
  rspec-support (~> 3.10.0)
68
68
  rspec-support (3.10.2)
69
+ rspec_junit_formatter (0.6.0)
70
+ rspec-core (>= 2, < 4, != 2.12.0)
69
71
  ruby2_keywords (0.0.5)
70
72
  rubyzip (1.3.0)
71
73
  sawyer (0.9.2)
@@ -102,9 +104,10 @@ DEPENDENCIES
102
104
  gazer!
103
105
  rake (~> 12.3, >= 12.3.3)
104
106
  rspec (~> 3.0)
107
+ rspec_junit_formatter
105
108
 
106
109
  RUBY VERSION
107
- ruby 2.5.8p224
110
+ ruby 2.7.7p221
108
111
 
109
112
  BUNDLED WITH
110
- 2.3.26
113
+ 2.4.7
data/gzr.gemspec CHANGED
@@ -65,4 +65,5 @@ Gem::Specification.new do |spec|
65
65
  spec.add_development_dependency 'bundler', '~> 2.2', '>= 2.2.10'
66
66
  spec.add_development_dependency 'rake', '~> 12.3', '>= 12.3.3'
67
67
  spec.add_development_dependency "rspec", "~> 3.0"
68
+ spec.add_development_dependency "rspec_junit_formatter"
68
69
  end
@@ -51,7 +51,7 @@ module Gzr
51
51
 
52
52
  def sufficient_version?(given_version, minimum_version)
53
53
  return true unless (given_version && minimum_version)
54
- versions = @versions.map {|v| v.version}.sort
54
+ versions = @versions.sort
55
55
  !versions.drop_while {|v| v < minimum_version}.reverse.drop_while {|v| v > given_version}.empty?
56
56
  end
57
57
 
@@ -154,8 +154,8 @@ module Gzr
154
154
 
155
155
  begin
156
156
  versions_response = agent.call(:get,"/versions")
157
- @versions = versions_response.data.supported_versions
158
- @current_version = "3.1"
157
+ @versions = versions_response.data.supported_versions.map {|v| v.version}
158
+ @current_version = versions_response.data.current_version.version || "4.0"
159
159
  rescue Faraday::SSLError => e
160
160
  raise Gzr::CLI::Error, "SSL Certificate could not be verified\nDo you need the --no-verify-ssl option or the --no-ssl option?"
161
161
  rescue Faraday::ConnectionFailed => cf
@@ -166,13 +166,13 @@ module Gzr
166
166
  end
167
167
 
168
168
  say_warning "API current_version #{@current_version}" if @options[:debug]
169
- say_warning "API versions #{@versions.map{|v| v.version}}" if @options[:debug]
169
+ say_warning "API versions #{@versions}" if @options[:debug]
170
170
 
171
171
  raise Gzr::CLI::Error, "Operation requires API v#{min_api_version}, but user specified version #{@options[:api_version]}" unless sufficient_version?(@options[:api_version],min_api_version)
172
172
 
173
173
  api_version = [min_api_version, @current_version].max
174
- raise Gzr::CLI::Error, "Operation requires API v#{api_version}, which is not available from this host" if api_version && !@versions.any? {|v| v.version == api_version}
175
- raise Gzr::CLI::Error, "User specified API v#{@options[:api_version]}, which is not available from this host" if @options[:api_version] && !@versions.any? {|v| v.version == @options[:api_version]}
174
+ raise Gzr::CLI::Error, "Operation requires API v#{api_version}, which is not available from this host" if api_version && !@versions.any? {|v| v == api_version}
175
+ raise Gzr::CLI::Error, "User specified API v#{@options[:api_version]}, which is not available from this host" if @options[:api_version] && !@versions.any? {|v| v == @options[:api_version]}
176
176
 
177
177
  conn_hash = build_connection_hash(@options[:api_version] || api_version)
178
178
  @secret = nil
data/lib/gzr/version.rb CHANGED
@@ -20,5 +20,5 @@
20
20
  # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
21
 
22
22
  module Gzr
23
- VERSION = '0.2.58'.freeze
23
+ VERSION = '0.2.59'.freeze
24
24
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gazer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.58
4
+ version: 0.2.59
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike DeAngelo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-03-16 00:00:00.000000000 Z
11
+ date: 2023-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tty-reader
@@ -214,6 +214,20 @@ dependencies:
214
214
  - - "~>"
215
215
  - !ruby/object:Gem::Version
216
216
  version: '3.0'
217
+ - !ruby/object:Gem::Dependency
218
+ name: rspec_junit_formatter
219
+ requirement: !ruby/object:Gem::Requirement
220
+ requirements:
221
+ - - ">="
222
+ - !ruby/object:Gem::Version
223
+ version: '0'
224
+ type: :development
225
+ prerelease: false
226
+ version_requirements: !ruby/object:Gem::Requirement
227
+ requirements:
228
+ - - ">="
229
+ - !ruby/object:Gem::Version
230
+ version: '0'
217
231
  description: This tool will help manage the content of a Looker instance.
218
232
  email:
219
233
  - drstrangelove@google.com
@@ -398,8 +412,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
398
412
  - !ruby/object:Gem::Version
399
413
  version: '0'
400
414
  requirements: []
401
- rubyforge_project:
402
- rubygems_version: 2.7.6.2
415
+ rubygems_version: 3.1.6
403
416
  signing_key:
404
417
  specification_version: 4
405
418
  summary: Command line tool to manage the content of a Looker instance.