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

Conversation

@MarquiseRosier
Copy link

can now embed query results from bigquery

fix #9

Please ensure your pull request adheres to the following guidelines:

  • make sure to link the related issues in this description
  • when merging / squashing, make sure the fixed issue references are visible in the commits, for easy compilation of release notes

Related Issues

Thanks for contributing!

can now embed query results from bigquery

fix #9
@MarquiseRosier MarquiseRosier requested a review from trieloff May 7, 2020 08:24

async function extract(url, params, log = console) {
const host = 'https://adobeioruntime.net';
const path = '/api/v1/web/helix/helix-services/run-query@latest/';
Copy link
Contributor

Choose a reason for hiding this comment

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

Use the major version number instead of latest, otherwise when you break the compatibility in run-query, you will bring data-embeds down with it.

statusCode: 200,
headers: {
'Content-Type': 'application/json',
'Cache-Control': 'max-age=600',
Copy link
Contributor

Choose a reason for hiding this comment

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

If you get a Cache-Control header from the backend, you should propagate the value. Each query might have different caching characteristics. The 10 minute default cache is only used in places where we don't have any better information.

const errText = await results.text();
log.error(`data request to ${resource} failed ${errText}`);
return {
statusCode: results.status,
Copy link
Contributor

Choose a reason for hiding this comment

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

We should use proper status code propagation. I'll provide a helper in Helix Shared that you can use.

Copy link
Contributor

Choose a reason for hiding this comment

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

statusCode: results.status,
headers: {
'Content-Type': 'application/json',
'Cache-Control': 'max-age=600',
Copy link
Contributor

Choose a reason for hiding this comment

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

Here, a default cache is useful.

Marquise Rosier added 2 commits May 8, 2020 01:59
use helix-shared for status code propagation

fix #44
@github-actions
Copy link

github-actions bot commented May 8, 2020

This PR will trigger a minor release when merged.

@codecov
Copy link

codecov bot commented May 8, 2020

Codecov Report

Merging #44 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #44   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            9        10    +1     
  Lines          259       279   +20     
=========================================
+ Hits           259       279   +20     
Impacted Files Coverage Δ
src/embed.js 100.00% <100.00%> (ø)
src/matchers/run-query.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9f87faf...5c98f7d. Read the comment docs.

make data-embeds with _query/run-query pathname work, and unpin run-query api

fix #44
Copy link
Contributor

@trieloff trieloff 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. Fix the build failure, and add a post-deploy integration test and then we are good to go.

@MarquiseRosier MarquiseRosier marked this pull request as ready for review May 19, 2020 17:59
@MarquiseRosier MarquiseRosier requested a review from trieloff May 19, 2020 22:17
MarquiseRosier pushed a commit that referenced this pull request May 22, 2020
wrap extract logic in try/catch also add post.deploy tests

fix #44
wrap extract logic in try/catch also add post.deploy tests

fix #44
@MarquiseRosier MarquiseRosier force-pushed the support-big-query branch 2 times, most recently from e04088b to 53321a8 Compare May 22, 2020 23:57
@MarquiseRosier MarquiseRosier merged commit af87a92 into master May 25, 2020
@MarquiseRosier MarquiseRosier deleted the support-big-query branch May 25, 2020 18:41
trieloff pushed a commit that referenced this pull request May 25, 2020
# [1.5.0](v1.4.3...v1.5.0) (2020-05-25)

### Bug Fixes

* **run-query.js:** fix url pattern code ([5406c14](5406c14)), closes [#44](#44)
* **run-query.js:** pass rev ([2b3a12f](2b3a12f)), closes [#44](#44)
* **run-query.js:** wrap extract logic in try/catch ([cf3afd6](cf3afd6)), closes [#44](#44)

### Features

* **run-query.js:** adds helix-run-query support ([8e30131](8e30131)), closes [#9](#9)
@trieloff
Copy link
Contributor

🎉 This PR is included in version 1.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Data Queries

3 participants