GithubHelp home page GithubHelp logo

googlecloudplatform / ruby-docs-samples Goto Github PK

View Code? Open in Web Editor NEW
232.0 86.0 203.0 13.05 MB

Ruby samples for Google Cloud Platform products.

Home Page: https://cloud.google.com/ruby

License: Apache License 2.0

Ruby 86.02% JavaScript 1.40% CoffeeScript 0.12% CSS 1.15% HTML 8.95% Shell 0.50% Dockerfile 0.47% SCSS 0.71% Sass 0.13% Slim 0.56%
ruby rails google-cloud samples

ruby-docs-samples's People

Contributors

alixhami avatar averikitsch avatar baochanzheng avatar billyjacobson avatar bshaffer avatar dazuma avatar dependabot[bot] avatar dizcology avatar frankyn avatar gguuss avatar grant avatar hengfengli avatar jeffmendoza avatar jesselovelace avatar jiren avatar jmdobry avatar jsimonweb avatar michaelawyu avatar nivedhasenthil avatar peter-zheng-g avatar quartzmo avatar renovate-bot avatar ryanmats avatar shivgautam avatar tbpg avatar trambui09 avatar tswast avatar viacheslav-rostovtsev avatar wmwong avatar xinyunh0929 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ruby-docs-samples's Issues

Add RuboCop with only some cops enabled

The default RuboCop configuration does not match many of the styles used here in these samples.

The styles for code sample snippets varies greatly from that of production Ruby applications, eg. the goal of samples is clarity and we often do non-traditional things such as putting require statements into method definitions for the purpose of defining a snippet.

Add a RuboCop configuration and run via Travis that enforces some desired / common stylistic mistakes, eg. trailing whitespace or the use of the and, or, or then keywords

See also: How to disable all cops except some

Add guide for writing Ruby code sample applications and snippets

Story: I'm a Rubyist that wants to contribute.

Issue:

  1. Rubyist clicks on CONTRIBUTING.md at the bottom of the page https://github.com/GoogleCloudPlatform/ruby-docs-samples.
  2. Rubyist arrives at https://github.com/GoogleCloudPlatform/ruby-docs-samples/blob/master/CONTRIBUTING.md.
  3. Rubyist clicks on Google Cloud Platform Samples Style Guide and arrives at https://github.com/GoogleCloudPlatform/Template/wiki/style.html.
  4. Rubyist unknowingly clicks on ruby-docs-samples and goes back to https://github.com/GoogleCloudPlatform/ruby-docs-samples.

Possible Solution: Insert the Ruby Style Guide

Ruby Speech sample and client library use "RAW" as an encoding instead of "LINEAR16"

There are many ways to encode files e.g., LINEAR16, Mulaw and then there are different file formats that encapsulate them e.g., RAW and WAV.
Both RAW and WAV can encapsulate both LINEAR16 and Mulaw.
For our server - we don't need to know the file format - we only need to know the encoding e.g., using the term RAW to specify an encoding is an error.

Speech Stream isn't completely understandable.

Context: https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud/v0.22.0/google/cloud/speech/project?method=stream-instance

I'm not sure what the correct sending rate is given a sample size of 44100Hz with 16bit rate. I was informed to send 88200 bytes per second, and I also tried brute forcing different values. The error message doesn't help and additional information in the error message would be helpful. Such as, how to better calibrate the transmission rate given a sample rate and encoding. I want to note that I used the data in audio.grpc.content as the payload.

Any help would be appreciated! Thank you.

Error:
11:Audio data is being streamed too fast. Please stream audio data approximately at real time.

Code:

require 'google/cloud/speech'

# Stream to speech and wait for transcription... 
speech = Google::Cloud::Speech.new

# Setup raw file to be sent in as an Asynchronous job maximum time is ~80mins
audio = speech.audio "prince.raw",
                      encoding: :raw, sample_rate: 44100,
                      language: :ja 

# Send stream job
stream = speech.stream encoding: :raw, sample_rate: 44100, language: 'ja'

# Result callback
stream.on_result do |results|
  result = results.first
  puts result.transcript
end

# Error callback
stream.on_error do |error|
  puts error
end

# Start callback
stream.on_speech_start do 
  puts "Started listening"
end

# Complete callback
stream.on_complete do
  puts "Finished"
end

bytes_sent = 0
chunk_size = 88200
bytes_total = audio.grpc.content.size # Content of my raw file (This may be wrong)..

# Send one chunk per second 
while bytes_sent < bytes_total do 
  stream.send audio.grpc.content[bytes_sent, (bytes_sent + chunk_size)]
  bytes_sent += chunk_size 
  sleep 1
end

# Finished sending
stream.complete!

# Stop stream
stream.stop

datastore_api.rb:28:in `require': cannot load such file -- google/gax (LoadError)

I'm trying to get the Appengine Datastore sample to work.

$ export GOOGLE_CLOUD_PROJECT=myproject
$ bundle
$ bundle exec ruby ./app.rb
/var/lib/gems/2.3.0/gems/google-cloud-datastore-0.21.0/lib/google/cloud/datastore/v1/datastore_api.rb:28:in require': cannot load such file -- google/gax (LoadError) from /var/lib/gems/2.3.0/gems/google-cloud-datastore-0.21.0/lib/google/cloud/datastore/v1/datastore_api.rb:28:in <top (required)>'
from /var/lib/gems/2.3.0/gems/google-cloud-datastore-0.21.0/lib/google/cloud/datastore/v1.rb:16:in require' from /var/lib/gems/2.3.0/gems/google-cloud-datastore-0.21.0/lib/google/cloud/datastore/v1.rb:16:in <top (required)>'
from /var/lib/gems/2.3.0/gems/google-cloud-datastore-0.21.0/lib/google/cloud/datastore/service.rb:19:in require' from /var/lib/gems/2.3.0/gems/google-cloud-datastore-0.21.0/lib/google/cloud/datastore/service.rb:19:in <top (required)>'
from /var/lib/gems/2.3.0/gems/google-cloud-datastore-0.21.0/lib/google/cloud/datastore/dataset.rb:19:in require' from /var/lib/gems/2.3.0/gems/google-cloud-datastore-0.21.0/lib/google/cloud/datastore/dataset.rb:19:in <top (required)>'
from /var/lib/gems/2.3.0/gems/google-cloud-datastore-0.21.0/lib/google/cloud/datastore.rb:18:in require' from /var/lib/gems/2.3.0/gems/google-cloud-datastore-0.21.0/lib/google/cloud/datastore.rb:18:in <top (required)>'
from ./app.rb:18:in require' from ./app.rb:18:in

'

$ cat Gemfile.lock
GEM
remote: https://rubygems.org/
specs:
addressable (2.5.0)
public_suffix (> 2.0, >= 2.0.2)
diff-lcs (1.2.5)
faraday (0.9.2)
multipart-post (>= 1.2, < 3)
google-cloud-core (0.21.0)
google-cloud-datastore (0.21.0)
google-cloud-core (
> 0.21.0)
google-gax (> 0.6.0)
google-protobuf (
> 3.0)
googleapis-common-protos (> 1.3)
grpc (
> 1.0)
google-gax (0.6.0)
googleapis-common-protos (> 1.3.1)
googleauth (
> 0.5.1)
grpc (> 1.0)
rly (
> 0.2.3)
google-protobuf (3.0.2)
googleapis-common-protos (1.3.4)
google-protobuf (> 3.0)
grpc (
> 1.0)
googleauth (0.5.1)
faraday (> 0.9)
jwt (
> 1.4)
logging (> 2.0)
memoist (
> 0.12)
multi_json (> 1.11)
os (
> 0.9)
signet (> 0.7)
grpc (1.0.1)
google-protobuf (
> 3.0.2)
googleauth (> 0.5.1)
jwt (1.5.6)
little-plugger (1.1.4)
logging (2.1.0)
little-plugger (
> 1.1)
multi_json (> 1.10)
memoist (0.15.0)
multi_json (1.12.1)
multipart-post (2.0.0)
os (0.9.6)
public_suffix (2.0.4)
rack (1.6.4)
rack-protection (1.5.3)
rack
rly (0.2.3)
rspec (3.5.0)
rspec-core (
> 3.5.0)
rspec-expectations (> 3.5.0)
rspec-mocks (
> 3.5.0)
rspec-core (3.5.4)
rspec-support (> 3.5.0)
rspec-expectations (3.5.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (
> 3.5.0)
rspec-mocks (3.5.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (> 3.5.0)
rspec-support (3.5.0)
signet (0.7.3)
addressable (
> 2.3)
faraday (> 0.9)
jwt (
> 1.5)
multi_json (> 1.10)
sinatra (1.4.7)
rack (
> 1.5)
rack-protection (~> 1.4)
tilt (>= 1.3, < 3)
tilt (2.0.5)

PLATFORMS
ruby

DEPENDENCIES
google-cloud-datastore
rspec
sinatra

BUNDLED WITH
1.13.4

security in openapi.yaml now needs to be under the method

The following in openapi.yaml does not have effect anymore:

# This section requires all requests to any path to require an API key.
security:
- api_key: []

Instead it needs to be moved under the method (like in the python sample):

paths:
  "/echo":
    post:
      description: "Echo back a given message."
      operationId: "echo"
      produces:
      - "application/json"
      responses:
        200:
          description: "Echo"
          schema:
            $ref: "#/definitions/echoMessage"
      parameters:
      - description: "Message to echo"
        in: body
        name: message
        required: true
        schema:
          $ref: "#/definitions/echoMessage"
      security:
      - api_key: []

see endpoints docs for more info.

dialogflow: tests are flaky

Dialogflow tests run into quota problems fairly frequently. Let's add some retry logic before increasing the quota.

BigQuery: Sample is included in the wrong section of the docs

The sample for creating a table shown here is the "Creating an empty table with a schema definition" section, but the sample does not have a schema specified.

To fix this:

  • Move this sample to the section above: "Creating an empty table without a schema definition"
  • Create a new sample with the schema specified for the "Creating an empty table with a schema definition" section

Kokoro: Move ruby-docs-samples to Kokoro

List of tests to add

  • - auth
  • - bigquery
  • - bigquerydatatransfer
  • - cdn
  • - datastore
  • - dialogflow
  • - dlp
  • - endpoints
  • - iot
  • - kms
  • - language
  • - logging
  • - pubsub
  • - spanner
  • - speech
  • - storage
  • - translate
  • - video
  • - vision
  • - appengine/analytics
  • - appengine/cloudsql
  • - appengine/cloudsql-mysql
  • - appengine/cloudsql-postgres
  • - appengine/datastore
  • - appengine/endpoints
  • - appengine/hello_world
  • - appengine/mailgun
  • - appengine/memcache
  • - appengine/metadata_server
  • - appengine/pubsub
  • - appengine/rails-cloudsql-mysql
  • - appengine/rails-cloudsql-postgresql
  • - appengine/rails-hello_world
  • - appengine/sendgrid
  • - appengine/static_files/rails
  • - appengine/static_files/sinatra
  • - appengine/storage
  • - appengine/twilio

Document how to run all tests locally

Story

When a developer wants to run RSPEC tests locally, they need to run each sample RSPEC independently.

Issue

The developer needs to test each RSPEC by hand. There is no Rakefile with a task to call sub RSPEC automatically.

Possible-Solution

Add a Rakefile with a task to run all sample RSPEC. A developer can run tests with one CLI command instead of one per sample.

Add basic Ruby on Rails sample

Add simplest possible Ruby on Rails application that successfully deploys to the Ruby runtime for Google App Engine flexible environment

This application will support documentation.

Application should include a few additions that demonstrate the App Engine flex runtime, eg.

  • A static asset to serve to demonstrate that we default config.public_file_server.enabled to true via RAILS_SERVE_STATIC_FILES
  • Production configuration of secret_key_base configuration, eg. via SECRET_KEY_BASE in app.yaml or some other means
  • A working resourceful controller, eg. generated via rails scaffold post title body:text using Cloud SQL (extremely common Rails use-case :: database configuration can be replaced with any SQL database that the the user desires)

The README for this application should include all of the commands taken to create this application, beginning with rails new. Most of this information will be provided via documentation, which should be linked to from the README, but this application README should demonstrate the very few commands necessary to gcloud app deploy an application generated via rails new on the latest verion of Ruby on Rails

Tests should verify CRUD actions work on the deployed application

Possible directory location: rails/getting_started or ruby_on_rails/getting_started. When developers find this repository, I'd like "Ruby on Rails" to be immediately noticeable in the directories and READMEs. The ruby_on_rails directory should have a README directing users to our Rails documentation and Google App Engine flexible environment documentation for Ruby

Google Cloud API Client initialization inconsistent

Story

Rubyist knows to use Google Data Store API. Rubyist wants to learn Google Vision API and the samples use different Google Cloud API Client initialization. Confusion begins.

Issue
Initialization is inconsistent between these two samples. The issue may exist in other samples within the Ruby space.

DataStore uses
require "gcloud"
gcloud = Gcloud.new
datastore = gcloud.datastore

Vision uses
require "google/cloud"
gcloud = Google::Cloud.new
vision = gcloud.vision

Issue exists in the following locations:
appengine/datastore/app.rb
appengine/pubsub/app.rb
appengine/pubsub/spec/pubsub_spec.rb
bigquery/shakespeare.rb
datastore/sample.rb
logging/spec/sample_spec.rb
logging/sample.rb
pubsub/sample.rb

Possible Solution
Use the same initialization in all Ruby samples.

WARNING: Component [app] no longer exists.

Story

When following README.md in Datastore sample, an issue exists under Creating Datastore Indexes. The CLI command gcloud components update app prints out a WARNING that the component APP no longer exists.

Issue

[app] component no longer exists and the README.md needs to be updated.

Possible Solution

Update README.md to have gcloud components update instead.

CI hasn't passed in months

A few failures I can see:
https://circleci.com/gh/GoogleCloudPlatform/ruby-docs-samples/1182


Google Analytics on Google App Engine
  can track visit event (PENDING: End-to-end tests skipped)

Pending: (Failures listed here are expected and do not affect your suite's status)

  1) Google Analytics on Google App Engine can track visit event
     # End-to-end tests skipped
     # ./spec/google_analytics_spec.rb:29

Finished in 0.0007 seconds (files took 0.44262 seconds to load)
1 example, 0 failures, 1 pending

> gcloud app versions delete -analytics-1182 -q
ERROR: (gcloud.app.versions.delete) unrecognized arguments: -analytics-1182
Usage: gcloud app versions delete VERSIONS [VERSIONS ...] [optional flags]
  optional flags may be  --help | --service

For detailed information on this command and its flags, run:
  gcloud app versions delete --help

Failed to delete e2e version
Failures:

  1) Cat Friends should display a list of cats
     Failure/Error: raise ActionController::RoutingError, "No route matches [#{env['REQUEST_METHOD']}] #{env['PATH_INFO'].inspect}"
     
     ActionController::RoutingError:
       No route matches [GET] "/assets/application-63d002b4806ba81b3fd0ee343c8d37f5160ede65d821329ab2ce721f09280c3a.css"
     # /opt/circleci/.rvm/gems/ruby-2.3.4/gems/railties-5.1.3/lib/rails/rack/logger.rb:36:in `call_app'
     # /opt/circleci/.rvm/gems/ruby-2.3.4/gems/railties-5.1.3/lib/rails/rack/logger.rb:24:in `block in call'
     # /opt/circleci/.rvm/gems/ruby-2.3.4/gems/railties-5.1.3/lib/rails/rack/logger.rb:24:in `call'
     # /opt/circleci/.rvm/gems/ruby-2.3.4/gems/rack-2.0.3/lib/rack/method_override.rb:22:in `call'
     # /opt/circleci/.rvm/gems/ruby-2.3.4/gems/rack-2.0.3/lib/rack/runtime.rb:22:in `call'
     # /opt/circleci/.rvm/gems/ruby-2.3.4/gems/rack-2.0.3/lib/rack/sendfile.rb:111:in `call'
     # /opt/circleci/.rvm/gems/ruby-2.3.4/gems/railties-5.1.3/lib/rails/engine.rb:522:in `call'
     # /opt/circleci/.rvm/gems/ruby-2.3.4/gems/rack-2.0.3/lib/rack/urlmap.rb:68:in `block in call'
     # /opt/circleci/.rvm/gems/ruby-2.3.4/gems/rack-2.0.3/lib/rack/urlmap.rb:53:in `each'
     # /opt/circleci/.rvm/gems/ruby-2.3.4/gems/rack-2.0.3/lib/rack/urlmap.rb:53:in `call'
     # /opt/circleci/.rvm/gems/ruby-2.3.4/gems/capybara-2.15.1/lib/capybara/server.rb:44:in `call'
     # /opt/circleci/.rvm/gems/ruby-2.3.4/gems/rack-2.0.3/lib/rack/handler/webrick.rb:86:in `service'
     # ------------------
     # --- Caused by: ---
     # Capybara::CapybaraError:
     #   Your application server raised an error - It has been raised in your test code because Capybara.raise_server_errors == true
     #   /opt/circleci/.rvm/gems/ruby-2.3.4/gems/capybara-2.15.1/lib/capybara/session.rb:145:in `raise_server_error!'

Failures:

  1) Google Cloud Spanner API samples create_database
     Failure/Error:
       create_database project_id:  @project_id,
                       instance_id: @instance.instance_id,
                       database_id: @database_id
     
     Google::Cloud::ResourceExhaustedError:
       8:Unable to create database 'test_database_1512163400' because the instance 'projects/cloud-samples-tests-ruby/instances/cloud-samples-tests-instance' has already reached the maximum database limit (100). Please delete a database in the instance and try again, or choose a different instance.

Failures:

  1) Detect Faces detect faces from local image file
     Failure/Error:
       expect {
         detect_faces project_id: @project_id,
                      image_path: image_path("face_no_surprise.jpg")
       }.to output(
         /Surprise: false/
       ).to_stdout
     
       expected block to output /Surprise: false/ to stdout, but output "Joy:      true\nAnger:    true\nSorrow:   false\nSurprise: true\n"
       Diff:
       @@ -1,2 +1,5 @@
       -/Surprise: false/
       +Joy:      true
       +Anger:    true
       +Sorrow:   false
       +Surprise: true
       
     # ./spec/detect_faces_spec.rb:34:in `block (2 levels) in <top (required)>'

  2) Detect Faces detect faces from image file in Google Cloud Storage
     Failure/Error:
       expect {
         detect_faces_gcs project_id: @project_id,
                          image_path: storage_file.to_gs_url
       }.to output(
         /Surprise: false/
       ).to_stdout
     
       expected block to output /Surprise: false/ to stdout, but output "Joy:      true\nAnger:    true\nSorrow:   false\nSurprise: true\n"
       Diff:
       @@ -1,2 +1,5 @@
       -/Surprise: false/
       +Joy:      true
       +Anger:    true
       +Sorrow:   false
       +Surprise: true
       
     # ./spec/detect_faces_spec.rb:46:in `block (2 levels) in <top (required)>'

Finished in 30.42 seconds (files took 0.56411 seconds to load)
22 examples, 2 failures
Failures:

  1) Datastore sample supports inequality_range
     Failure/Error: expect(tasks.size).to eq(1)
     
       expected: 1
            got: 2
     
       (compared using ==)
     # ./spec/sample_spec.rb:345:in `block (2 levels) in <top (required)>'

  2) Datastore sample supports equal_and_inequality_range
     Failure/Error: expect(tasks.size).to eq(1)
     
       expected: 1
            got: 2
     
       (compared using ==)
     # ./spec/sample_spec.rb:360:in `block (2 levels) in <top (required)>'

Finished in 13.13 seconds (files took 0.23901 seconds to load)
60 examples, 2 failures

Failed examples:

rspec ./spec/sample_spec.rb:340 # Datastore sample supports inequality_range
rspec ./spec/sample_spec.rb:355 # Datastore sample supports equal_and_inequality_range

"wrong number of arguments" on detect_pdf.rb

Hello,
I'm not exactly sure if I'm doing something wrong but the ruby sample keeps telling me
wrong number of arguments (given 6, expected 0))

Steps to reproduce the errors
-> rails new test_app
-> cd test_app
-> add gem 'google-cloud-vision' && gem 'google-cloud-storage' in gemfile
-> bundle install
-> add config.autoload_paths += %W(#{config.root}/lib) in application.rb
-> add file ocr_google_test.rb in lib
-> in file ocr_google_test.rb : class OcrGoogleTest + copy paste the provided sample code : https://github.com/GoogleCloudPlatform/ruby-docs-samples/blob/master/vision/detect_pdf.rb
-> change line def detect_pdf_gcs with def self.detect_pdf_gcs
-> add arguments for gcs_source_uri:, gcs_destination_uri:, project_id: and also the key file when launching Google::Cloud::Vision.new
-> go in console rails console
-> launch OcrGoogleTest.detect_pdf_gcs

--> RESULT : ArgumentError (wrong number of arguments (given 6, expected 0))

If anyone could help me understand this, it would be greatly appreciated :)
Thanks a lot and have a great day

OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

When I ran Cloud Datastore Sample locally on Win7 x64, I got this error:

 Faraday::SSLError:
   SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
 # ./spec/quickstart_spec.rb:22:in `block (2 levels) in <top (required)>'
 # ------------------
 # --- Caused by: ---
 # OpenSSL::SSL::SSLError:
 #   SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
 #   ./spec/quickstart_spec.rb:22:in `block (2 levels) in <top (required)>'

After I added OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE in quickstart_spec.rb and sample_spec.rb, this example ran successfully.
At the same time, there's a warning: already initialized constant OpenSSL::SSL::VERIFY_PEER in the log.

How to solve this problem correctly?

Update all samples to be runnable

  • Stackdriver Logging
  • Google Cloud Pub/Sub

This excludes Datastore intentionally, because the snippets are used as a reference and are not written to be executable.

  • Add note to Datastore README that the samples aren't runnable

[License] Update License header

License header has been updated to the following and should be propagated to all files in the repository.

Copyright 2017 Google LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Storage Bucket environment variable name not consistent

Story

Trying to run RSPEC on samples which use a bucket id isn't straight forward. It always documented either. It's hidden in the SPEC.

Issue
No consistent ENV name was used. A quick grep reveals the following.

bigquery/spec/bigquery_sample_spec.rb:
appengine/storage/app.rb:bucket = storage.bucket ENV["GCLOUD_STORAGE_BUCKET"]
appengine/storage/README.md:export GCLOUD_STORAGE_BUCKET=
appengine/storage/spec/storage_spec.rb: .sub("", ENV["GCLOUD_STORAGE_BUCKET"])
appengine/storage/app.yaml: GCLOUD_STORAGE_BUCKET:
language/spec/language_samples_spec.rb: @bucket_name = ENV["STORAGE_BUCKET"]
logging/spec/sample_spec.rb: # BUCKET Name of Google Cloud Storage bucket to use for log sink
logging/spec/sample_spec.rb: # ALT_BUCKET Name of an alternative bucket to also use for log sink
logging/spec/sample_spec.rb: @bucket = @storage.bucket ENV["BUCKET"]
logging/spec/sample_spec.rb: @alt_bucket = @storage.bucket ENV["ALT_BUCKET"]
storage/spec/list_buckets_spec.rb: output(/#{BUCKET_NAME}/).to_stdout)
storage/spec/spec_helper.rb:BUCKET_NAME=ENV["GOOGLE_PROJECT_ID"]

Possible-Solution

Use a consistent name , maybe, GOOGLE_STORAGE_BUCKET_ID ?

Code does not work and link to "expected result" = 404 (not found) result

Where:
In the Deploy Refinery CMS to App Engine flexible environment code lab, step 7, "[Set up Google Cloud Storage](https://codelabs.developers.google.com/codelab", the code after "Next update the file "config/initializers/refinery/core.rb to include the following (expected result):"

2 Issues:
1: the code does not reflect what I'm seeing in my code editor.
2: the "expected result" link --> 404 (not found) message in my browser.

Looks like something was updated, but the change is not reflected in this lab?

CircleCI failing due to missing environment variable

After submitting a pull request, CircleCI is failing with:

$ gcloud config set project $GOOGLE_CLOUD_PROJECT
ERROR: (gcloud.config.set) argument VALUE is required
Usage: gcloud config set SECTION/PROPERTY VALUE [optional flags]
  optional flags may be  --help | --installation | -h

For detailed information on this command and its flags, run:
  gcloud config set --help

gcloud config set project $GOOGLE_CLOUD_PROJECT returned exit code 2

Action failed: gcloud config set project $GOOGLE_CLOUD_PROJECT

See https://circleci.com/gh/GoogleCloudPlatform/ruby-docs-samples/1033.

Google Project ID environment variable name not consistent

Story

Rubyist attempts to use environment variables to save GCP default values. After reading this (README)[https://github.com/GoogleCloudPlatform/ruby-docs-samples/tree/master/datastore] in Datastore, the Rubyist is overwhelmed by which environment variable to use.

Issue

Similar to issue #62. Environment variables are not consistent across the Ruby samples.

Possible-Solution

Similar to issue #62. Use a consistent environment variable.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.