Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add graph:init command #4711

Merged
merged 12 commits into from
Aug 1, 2022
Merged

feat: add graph:init command #4711

merged 12 commits into from
Aug 1, 2022

Conversation

sgrove
Copy link
Contributor

@sgrove sgrove commented Jun 16, 2022

Summary

Adds graph:init to bootstrap all of the resources for a Netlify site to work with Netlify Graph

For us to review and ship your PR efficiently, please perform the following steps:

  • Update or add documentation (if features were changed or added) 📝
  • Make sure the status checks below are successful ✅

@sgrove sgrove requested a review from anmonteiro June 16, 2022 22:21
@sgrove sgrove self-assigned this Jun 16, 2022
@sgrove sgrove added the type: feature code contributing to the implementation of a feature and/or user facing functionality label Jun 16, 2022
@github-actions
Copy link

github-actions bot commented Jun 16, 2022

📊 Benchmark results

Comparing with d10b135

Package size: 226 MB

⬇️ 0.00% decrease vs. d10b135

^                                                          291 MB  294 MB  294 MB  294 MB  294 MB         
│                                                           ┌──┐    ┌──┐    ┌──┐    ┌──┐    ┌──┐          
│                                                           |  |    |  |    |  |    |  |    |  |          
│                                                           |  |    |  |    |  |    |  |    |  |          
│ ──────────────────────────────────────────────────────────┼──┼────┼──┼────┼──┼────┼──┼────┼──┼──────────
│  226 MB  226 MB  226 MB  226 MB  226 MB  221 MB  221 MB   |  |    |  |    |  |    |  |    |  |   226 MB 
│   ┌──┐    ┌──┐    ┌──┐    ┌──┐    ┌──┐    ┌──┐    ┌──┐    |  |    |  |    |  |    |  |    |  |    ┌──┐  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
└───┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴──>
    T-12    T-11    T-10    T-9     T-8     T-7     T-6     T-5     T-4     T-3     T-2     T-1      T    
Legend

@sgrove sgrove marked this pull request as ready for review June 17, 2022 19:53
@sgrove sgrove requested review from a team as code owners June 17, 2022 19:53
error(`Unable to create Netlify Graph persist query token: ${JSON.stringify(result.errors, null, 2)}`)
}

if (envChanged) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems to always be true.

anmonteiro
anmonteiro previously approved these changes Jun 17, 2022
src/commands/graph/graph-init.js Outdated Show resolved Hide resolved
src/commands/graph/graph-init.js Show resolved Hide resolved
src/commands/graph/graph-init.js Outdated Show resolved Hide resolved
anmonteiro
anmonteiro previously approved these changes Jun 23, 2022
@KyleBlankRollins KyleBlankRollins self-requested a review July 6, 2022 16:21
Copy link
Contributor

@KyleBlankRollins KyleBlankRollins left a comment

Choose a reason for hiding this comment

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

Sorry it took so long to get around to looking at this from a docs/copy standpoint. I have some questions and suggestions - mostly around error logs.

Comment on lines 21 to 27
if (!siteId) {
error(
`No siteId defined, unable to start Netlify Graph. To enable, run ${chalk.yellow(
'netlify init',
)} or ${chalk.yellow('netlify link')}`,
)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

[sand] It looks like we're using a slightly different error log with graph-edit. In the interest of consistency, we should probably make them the same.

Looks like we're not importing NETLIFYDEVERR from utils in graph-init. Would need that to make the two error logs more consistent.

docs/commands/graph.md Show resolved Hide resolved
envChanged = true
newEnv.NETLIFY_GRAPH_PERSIST_QUERY_TOKEN = token
} else {
error(`Unable to create Netlify Graph persist query token: ${JSON.stringify(result.errors, null, 2)}`)
Copy link
Contributor

Choose a reason for hiding this comment

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

[pebble] This error message explains the "what", but not the "why" or "what now". With error messages, we try to describe what happened, why it happened, and, if at all possible, what the user can do about it.

The error message for no side id above is a good example. Is there any way we can can explain why the error happened and, perhaps, guide users in what they can do here?

Copy link
Contributor

Choose a reason for hiding this comment

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

The errors we're printing should give us more information about what happened.

@github-actions
Copy link

github-actions bot commented Aug 1, 2022

📊 Benchmark results

Comparing with 7203fe5

Package size: 230 MB

(no change)

^                                                  230 MB  230 MB  230 MB  230 MB  230 MB  230 MB  230 MB 
│  224 MB  224 MB  224 MB  224 MB  224 MB  224 MB   ┌──┐    ┌──┐    ┌──┐    ┌──┐    ┌──┐    ┌──┐    ┌──┐  
│   ┌──┐    ┌──┐    ┌──┐    ┌──┐    ┌──┐    ┌──┐    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
└───┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴──>
    T-12    T-11    T-10    T-9     T-8     T-7     T-6     T-5     T-4     T-3     T-2     T-1      T    
Legend

@anmonteiro anmonteiro added the automerge Add to Kodiak auto merge queue label Aug 1, 2022
@kodiakhq kodiakhq bot merged commit 22ac960 into main Aug 1, 2022
@kodiakhq kodiakhq bot deleted the graph-init branch August 1, 2022 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Add to Kodiak auto merge queue type: feature code contributing to the implementation of a feature and/or user facing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants