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(editor): Ask AI #6672

Merged

Conversation

OlegIvaniv
Copy link
Contributor

@OlegIvaniv OlegIvaniv commented Jul 17, 2023

  • Refactor Code Editor into tabs if Ask AI is enabled
  • Refactor schema generators into composable and add methods to get input data with pinner
  • Replace code with generated and show alert if overriding
  • Remove the previous Ask AI fakedoor experiment

@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team ui Enhancement in /editor-ui or /design-system labels Jul 17, 2023
@codecov
Copy link

codecov bot commented Jul 17, 2023

Codecov Report

Patch coverage: 73.85% and project coverage change: +0.20% 🎉

Comparison is base (6c60763) 24.86% compared to head (0170368) 25.06%.
Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6672      +/-   ##
==========================================
+ Coverage   24.86%   25.06%   +0.20%     
==========================================
  Files        3144     3149       +5     
  Lines      191225   191880     +655     
  Branches    21096    21104       +8     
==========================================
+ Hits        47546    48096     +550     
- Misses     142698   142803     +105     
  Partials      981      981              
Files Changed Coverage Δ
packages/cli/src/Server.ts 0.00% <ø> (ø)
packages/cli/src/config/index.ts 43.90% <ø> (ø)
packages/cli/src/config/schema.ts 37.50% <ø> (ø)
...components/N8nCircleLoader/CircleLoader.stories.ts 0.00% <0.00%> (ø)
packages/editor-ui/src/components/Modals.vue 0.00% <ø> (ø)
packages/editor-ui/src/utils/typesUtils.ts 52.79% <ø> (-9.59%) ⬇️
packages/workflow/src/Interfaces.ts 57.14% <ø> (ø)
packages/editor-ui/src/plugins/telemetry/index.ts 30.28% <14.28%> (-0.83%) ⬇️
packages/editor-ui/src/api/ai.ts 29.41% <29.41%> (ø)
...i/src/components/CodeNodeEditor/CodeNodeEditor.vue 39.79% <43.60%> (+0.96%) ⬆️
... and 11 more

... and 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
@OlegIvaniv OlegIvaniv force-pushed the ado-610-fe-ai-powered-code-generation-in-the-code-node branch from 6ea3ba4 to 0e39fee Compare July 25, 2023 15:26
OlegIvaniv and others added 18 commits July 26, 2023 09:43
Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
…og) (#6675)

fix: remove duplicate source control preferences fetching (no-changelog)
…-changelog) (#6668)

fix(Slack Node): Add UTM params to n8n reference in Slack message
…ta (#6680)

deleting manual executions should defer deleting binary data
* fix(editor): Add paywall state to non owner users for Variables

* fix(editor): Add variables view tests

* fix(editor): remove link from paywall state for non owner

* fix(editor): fix displaying logic
refactor(core): Refactor WorkflowStatistics code
* fix(core): Upgrade semver to address CVE-2022-25883

[GH Advisory](GHSA-c2qf-rxjj-qqgw)

* enforce the patched version of semver everywhere in the dev setup
* fix(API): Do not add starting node on workflow creation

* chore: Remove comment
…6676)

* fix(core): Deactivate on init workflow that should not be retried

* fix(core): Filter out workflows with activation errors
Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
@OlegIvaniv OlegIvaniv changed the title feat(editor): Ask AI tab and CLi connection feat(editor): Ask AI Aug 14, 2023
@cypress
Copy link

cypress bot commented Aug 14, 2023

Passing run #1880 ↗︎

0 226 0 0 Flakiness 0

Details:

🌳 ado-610-fe-ai-powered-code-generation-in-the-code-node 🖥️ browsers:node18.12...
Project: n8n Commit: 0170368ab2
Status: Passed Duration: 07:43 💡
Started: Aug 16, 2023 9:24 AM Ended: Aug 16, 2023 9:31 AM

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
@OlegIvaniv
Copy link
Contributor Author

@mutdmour Thanks for the thorough review! I've addressed your comments. Can you have another look, please?

Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
@@ -128,6 +128,30 @@
font-weight: bold;
}

.el-tabs__content {
Copy link
Contributor

Choose a reason for hiding this comment

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

I meant tabs.scss before.. since our theme lives there.. but this is fine for now

(this.posthogStore.getVariant(ASK_AI_EXPERIMENT.name) ?? ASK_AI_EXPERIMENT.control) ===
ASK_AI_EXPERIMENT.control;
const isAiExperimentEnabled = [ASK_AI_EXPERIMENT.gpt3, ASK_AI_EXPERIMENT.gpt4].includes(
(this.posthogStore.getVariant(ASK_AI_EXPERIMENT.name) ?? '') as string,
Copy link
Contributor

Choose a reason for hiding this comment

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

is as string needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, because getVariant return types are boolean | string | undefined
CleanShot 2023-08-16 at 11 18 31

Copy link
Contributor

Choose a reason for hiding this comment

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

ideally we would avoid type casting..

@github-actions
Copy link
Contributor

✅ All Cypress E2E specs passed

@OlegIvaniv OlegIvaniv merged commit fde6ad1 into master Aug 16, 2023
24 checks passed
@OlegIvaniv OlegIvaniv deleted the ado-610-fe-ai-powered-code-generation-in-the-code-node branch August 16, 2023 11:08
@github-actions github-actions bot mentioned this pull request Aug 16, 2023
netroy added a commit that referenced this pull request Aug 16, 2023
# [1.3.0](https://github.com/n8n-io/n8n/compare/n8n@1.2.0...n8n@1.3.0)
(2023-08-16)


### Bug Fixes

* **core:** Don't let bull override the default redis config
([#6897](#6897))
([cfeb322](cfeb322))
* **core:** Fix fetching of EE executions
([#6901](#6901))
([f3fce48](f3fce48))
* **core:** Update frontend urls when using the `--tunnel` option
([#6898](#6898))
([718e613](718e613))
* **editor:** Disable telemetry in dev mode and in E2E tests
([#6869](#6869))
([808a928](808a928))
* **editor:** Fix code node’s content property to be reactive
([#6931](#6931))
([3b75bc6](3b75bc6))
* **editor:** Fix event emit on credential sharing
([#6922](#6922))
([297c3c9](297c3c9))
* **editor:** Fix multiOptions parameters resetting on initial load
([#6903](#6903))
([49867c2](49867c2))
* **editor:** Update execution view layout
([#6882](#6882))
([0339732](0339732))
* **Email Trigger (IMAP) Node:** Fix connection issue with unexpected
spaces in host ([#6886](#6886))
([f3248e4](f3248e4))
* Fix issue with key formatting if null or undefined
([#6924](#6924))
([4e4a3cf](4e4a3cf))
* Fix issue with key formatting introduced in 1.2.0
([#6896](#6896))
([0e075c9](0e075c9))
* Fix lag when node parameters are updated
([#6941](#6941))
([3eb65e0](3eb65e0))
* **HTTP Request Node:** Improve error handling for TCP socket errors
when `Continue On Fail` is enabled
([#6925](#6925))
([96ff1f8](96ff1f8))
* Prevent workflow breaking when credential type is unknown
([#6923](#6923))
([e83b93f](e83b93f))
* **Respond to Webhook Node:** Return headers in response
([#6921](#6921))
([a82107f](a82107f))


### Features

* **core:** Add support for not requiring SMTP auth with user management
([#3742](#3742))
([eead6d4](eead6d4))
* **core:** Descriptive message for common nodeJS errors
([#6841](#6841))
([3adb0b6](3adb0b6))
* **editor:** Ask AI in Code node
([#6672](#6672))
([fde6ad1](fde6ad1))
* Enable parallel processing on multiple queue nodes
([#6295](#6295))
([44afcff](44afcff))

Co-authored-by: netroy <netroy@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team ui Enhancement in /editor-ui or /design-system
Projects
None yet
Development

Successfully merging this pull request may close these issues.