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: allow multiple operation names in graph:hander #4978

Merged
merged 5 commits into from
Aug 19, 2022

Conversation

dwwoelfel
Copy link
Contributor

@dwwoelfel dwwoelfel commented Aug 19, 2022

Summary

Allows multiple operation names to be specified in graph:handler, e.g. ntl graph:handler --codegen ns/handler OpA OpB.

Still supports showing a list of operations to select from if no operation name is provided.

@dwwoelfel dwwoelfel requested review from sgrove and anmonteiro August 19, 2022 04:22
@dwwoelfel dwwoelfel added the type: feature code contributing to the implementation of a feature and/or user facing functionality label Aug 19, 2022
@github-actions
Copy link

github-actions bot commented Aug 19, 2022

📊 Benchmark results

Comparing with 2d4b68c

Package size: 222 MB

(no change)

^  222 MB  222 MB  222 MB  222 MB  222 MB  222 MB  222 MB  222 MB  222 MB  222 MB  222 MB  222 MB  222 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

@dwwoelfel dwwoelfel marked this pull request as ready for review August 19, 2022 04:39
@dwwoelfel dwwoelfel requested a review from a team as a code owner August 19, 2022 04:39
})
/* eslint-disable fp/no-loops */
for (const operationName of operationNames) {
await generateHandlerByOperationName({
Copy link
Member

Choose a reason for hiding this comment

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

I don't see any async behaviour in generateHandlerByOperationName, so do you need to await here? And if not, you could use a forEach and avoid disabling the ESLint rule?

Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch, @eduardoboucas . All of the generateHandler need to be async now (since they're no longer pure functions) - @dwwoelfel is this PR missing some of the upstream changes?

Copy link
Contributor Author

@dwwoelfel dwwoelfel Aug 19, 2022

Choose a reason for hiding this comment

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

@eduardoboucas Whenever Sean's submits his PR for https://github.com/netlify/cli/compare/sg/graph-async-handler-gen, generateHandlerByOperationName will be async and the await will be necessary.

I think it's fine to merge this now and not make his PR a dependency on this one.

Copy link
Contributor

Choose a reason for hiding this comment

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

@dwwoelfel I'm fine to merge as-is if you want to follow up with the other changes separately.

@sgrove
Copy link
Contributor

sgrove commented Aug 19, 2022

@dwwoelfel dwwoelfel added the automerge Add to Kodiak auto merge queue label Aug 19, 2022
@kodiakhq kodiakhq bot merged commit cef0f45 into main Aug 19, 2022
@kodiakhq kodiakhq bot deleted the dww/multiple-operations branch August 19, 2022 16:40
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.

3 participants