GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add billing samples (Node 8 ONLY) by ace-n · Pull Request #748 · GoogleCloudPlatform/nodejs-docs-samples

Conversation

@ace-n

@ace-n ace-n commented Sep 24, 2018

Copy link
Copy Markdown
Contributor

@labtopia FYI

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Ace Nassri
Add billing samples (Node 8 ONLY)
a88690b
@ace-n
ace-n requested a review from fhinkel September 24, 2018 20:44
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Sep 24, 2018
Ace Nassri
Merge branch 'master' into slack-billing
68ef79a
fhinkel
fhinkel reviewed Sep 24, 2018
View reviewed changes
Comment thread functions/billing/index.js
const {google} = require('googleapis');
const {auth} = require('google-auth-library');

const PROJECT_ID = process.env.GCP_PROJECT;

@fhinkel fhinkel Sep 24, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think GCP_PROJECT is not a variable we usually set. Can we use the standard mechanism instead?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@ace-n ace-n Sep 25, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is defined (and named) by GCF itself.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
fhinkel
fhinkel reviewed Sep 24, 2018
View reviewed changes
Comment thread functions/billing/index.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

fhinkel
fhinkel reviewed Sep 24, 2018
View reviewed changes
Comment thread functions/billing/index.js

exports.stopBilling = async (data, context) => {
const pubsubData = JSON.parse(Buffer.from(data.data, 'base64').toString());
if (pubsubData.costAmount <= pubsubData.budgetAmount) {

@fhinkel fhinkel Sep 24, 2018

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to assure that costAmount is a number and not a string? Want to avoid cases like '100' < '2' = true

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@ace-n ace-n Sep 25, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not - the Billing API itself outputs a number, not a string.

FWIW this is how the code is currently structured.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
fhinkel
fhinkel requested changes Sep 24, 2018
View reviewed changes

@fhinkel fhinkel left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add it to the internal CI?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Ace Nassri
Add CI config + address comments
22ab85a
@ace-n

ace-n commented Sep 25, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

CI (config) has been added - PTAL?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Ace Nassri added 2 commits September 25, 2018 13:52
Ace Nassri
Merge branch 'master' into slack-billing
bd4ffeb
Ace Nassri
Merge branch 'master' into slack-billing
21cb9d0
fhinkel
fhinkel approved these changes Sep 25, 2018
View reviewed changes
@ace-n
ace-n merged commit b81ec57 into master Sep 25, 2018
@ace-n
ace-n deleted the slack-billing branch September 25, 2018 21:49
This was referenced Mar 7, 2020
[Snyk] Security upgrade @google-cloud/debug-agent from 3.2.0 to 4.0.2 pedroarapua/nodejs-docs-samples-gcp#93
Open
[Snyk] Security upgrade @google-cloud/debug-agent from 3.2.0 to 4.0.2 leejh3224/nodejs-docs-samples#166
Open
[Snyk] Security upgrade @google-cloud/debug-agent from 3.0.1 to 4.0.2 leejh3224/nodejs-docs-samples#167
Open
@snyk-bot snyk-bot mentioned this pull request Apr 7, 2022
[Snyk] Security upgrade @google-cloud/trace-agent from 2.1.3 to 2.11.0 ninadhatkar/nodejs-docs-samples#191
Open
ace-n pushed a commit that referenced this pull request Nov 16, 2022
@release-please @gcf-owl-bot
chore(main): release 4.1.0 (#748)
d9fa2d9
* chore(main): release 4.1.0

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
@ace-n ace-n mentioned this pull request Nov 16, 2022
migrate code from googleapis/nodejs-video-intelligence #2855
Merged
ace-n pushed a commit that referenced this pull request Nov 17, 2022
@release-please @gcf-owl-bot Ace Nassri
chore(main): release 4.1.0 (#748)
405ed18
* chore(main): release 4.1.0

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
ahrarmonsur pushed a commit that referenced this pull request Nov 17, 2022
@release-please @gcf-owl-bot Ahrar Monsur
chore(main): release 4.1.0 (#748)
4e337fb
* chore(main): release 4.1.0

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@fhinkel fhinkel fhinkel approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@ace-n @fhinkel @googlebot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.