Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on May 18, 2022. It is now read-only.

Conversation

@l2succes
Copy link
Contributor

@l2succes l2succes commented Mar 28, 2019

https://artsyproduct.atlassian.net/browse/GROW-1144

We make use of the Google Sheets API to get update KAWS. The goal is enable admins to update and ingest data without engineering intervention. This is only one part of enabling this, the google sheet script needs this endpoint to post the current googlesheet id the user wants to update.

In terms of security, this script uses a JWT which only has permissions to read a particular google sheet from artsy's google account.

  1. Adds express route to handle import request from Google Sheet script
  2. Extract data sanitization helper method to its own module for reuse
  3. Fixes hokusai dev start and our docker compose config

@peril-staging
Copy link
Contributor

peril-staging bot commented Mar 28, 2019

Warnings
⚠️ It looks like code was changed without adding anything to the Changelog.
You can add #trivial in the PR body to skip the check.

New dependencies added: googleapis.

googleapis

Author: Google Inc.

Description: Google APIs Client Library for Node.js

Homepage: https://github.com/googleapis/google-api-nodejs-client#readme

Createdover 6 years ago
Last Updated1 day ago
LicenseApache-2.0
Maintainers3
Releases140
Direct Dependenciesgoogle-auth-library and googleapis-common
Keywordsgoogle, api, google apis, client and client library
This README is too long to show.

Generated by 🚫 dangerJS against eabb4be

@l2succes l2succes marked this pull request as ready for review April 26, 2019 15:31
Copy link
Member

@anandaroop anandaroop left a comment

Choose a reason for hiding this comment

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

Looks good to me!

I like how you've refactored the updating and sanitizing logic. This all looks well organized and tested. Thanks! 💯

is_featured_artist_content: Boolean(is_featured_artist_content),
query: (artist_ids || gene_ids || tag_id || keyword) && {
artist_ids: artist_ids ? artist_ids.split(",").map(a => a.trim()) : [],
gene_ids: gene_ids ? gene_ids.split(",").map(a => a.trim()) : [],
Copy link
Member

Choose a reason for hiding this comment

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

Do admins always strictly enter these as id1,id2, as opposed to id1, id2 (i.e. does this need to be more lenient and split on comma + whitespace?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that's what the .trim() method is for, it removes whitespace from both sides of the string after we split on ,.

@l2succes
Copy link
Contributor Author

Awesome! thanks @anandaroop

@l2succes l2succes merged commit 2a36ac5 into master Apr 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants