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

ci: Validate load options methods in nodes-base #5862

Merged
merged 8 commits into from
Apr 12, 2023

Conversation

ivov
Copy link
Contributor

@ivov ivov commented Mar 31, 2023

During CI, generate UI types with loadOptionsMethods and validate that all referenced methods have been defined and that all defined methods are being used. ESLint cannot access the AST of other files while running on a given file and keep info in memory throughout the run and also guarantee that required files are parsed in order, so a CI script reusing Adi's loader logic looks like a better fit.

@github-actions
Copy link
Contributor

Great PR! Please pay attention to the following items before merging:

Files matching packages/**:

  • If fixing bug, added test to cover scenario.
  • If addressing forum or Github issue, added link to description.

Files matching packages/**/*.ts:

  • Added unit tests to cover new or updated functionality.

Files matching packages/nodes-base/nodes/**:

  • Added workflow tests for nodes if possible.

Make sure to check off this list before asking for review.

@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team node/improvement New feature or request labels Mar 31, 2023
Copy link
Member

@netroy netroy left a comment

Choose a reason for hiding this comment

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

Considering that n8n-generate-ui-types-with-methods isn't noticeably slower than n8n-generate-ui-types, why not combine the two files, and always generate the additional json files?

@ivov
Copy link
Contributor Author

ivov commented Apr 4, 2023

why not combine the two files, and always generate the additional json files?

Aimed to have zero impact on the regular build and avoid adding complexity to your script, at the cost of a bit of duplication, but I was on the fence on this. I'll combine them if you prefer.

@codecov
Copy link

codecov bot commented Apr 5, 2023

Codecov Report

Patch coverage has no change and project coverage change: +2.52 🎉

Comparison is base (4b11642) 14.99% compared to head (9276366) 17.52%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5862      +/-   ##
==========================================
+ Coverage   14.99%   17.52%   +2.52%     
==========================================
  Files        2476     2495      +19     
  Lines      113411   114306     +895     
  Branches    17738    17860     +122     
==========================================
+ Hits        17009    20027    +3018     
+ Misses      95823    93687    -2136     
- Partials      579      592      +13     
Impacted Files Coverage Δ
packages/core/src/DirectoryLoader.ts 0.00% <0.00%> (ø)
...s/FreshworksCrm/descriptions/ContactDescription.ts 0.00% <ø> (ø)
...ages/nodes-base/nodes/Paddle/PaymentDescription.ts 0.00% <ø> (ø)
packages/workflow/src/Interfaces.ts 50.00% <ø> (ø)

... and 127 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@netroy
Copy link
Member

netroy commented Apr 6, 2023

Should we address these ?
image

@ivov
Copy link
Contributor Author

ivov commented Apr 6, 2023

Should we address these ?

I set these as warnings because it's currently dead code but otherwise harmless. I'll leave it to the nodes team to decide.

@github-actions
Copy link
Contributor

github-actions bot commented Apr 6, 2023

✅ All Cypress E2E specs passed

@netroy netroy merged commit 5227ccd into master Apr 12, 2023
@netroy netroy deleted the validate-load-options-methods branch April 12, 2023 13:46
MiloradFilipovic added a commit that referenced this pull request Apr 13, 2023
* master: (62 commits)
  fix(editor): Redirect to home page after saving data on SAML onboarding page (no-changelog) (#5961)
  feat: Replace Vue.extend with defineComponent in design system (no-changelog) (#5918)
  feat(MySQL Node): Overhaul
  fix(OpenAI Node): Update models to only show those supported (#5805)
  ci: Add test for wait node (no-changelog) (#5414)
  fix(Github Trigger Node): Remove content_reference event (#5830)
  ci: Validate load options methods in nodes-base (no-changelog) (#5862)
  ci: Use `--chown=node:node` in COPY commands in the custom docker image (no-changelog) (#5913)
  🚀 Release 0.224.0 (#5957)
  fix(NocoDB Node): Fix for updating or deleting rows with not default primary keys
  fix(HTTP Request Node): Show detailed error message in the UI again (#5959)
  ci: Prevent skipping of E2E fail job (no-changelog) (#5958)
  ci: Fix E2E tests on master (no-changelog) (#5960)
  refactor(core): Use injectable classes for db repositories (part-1) (no-changelog) (#5953)
  fix(core): Validate customData keys and values (#5920) (no-changelog)
  feat(editor): Add user activation survey (#5677)
  fix(editor): Update vite legacy-plugin browser target (no-changelog) (#5952)
  docs: Fix typo in AWS S3 and S3 nodes for parent folder key (#5933)
  fix(core): Update xml2js to address CVE-2023-0842 (#5948)
  fix(Code Node): Update vm2 to address CVE-2023-29017 (#5947)
  ...

# Conflicts:
#	packages/workflow/src/Interfaces.ts
MiloradFilipovic added a commit that referenced this pull request Apr 13, 2023
…rce-mapper-ui

* feature/resource-mapping-component: (62 commits)
  fix(editor): Redirect to home page after saving data on SAML onboarding page (no-changelog) (#5961)
  feat: Replace Vue.extend with defineComponent in design system (no-changelog) (#5918)
  feat(MySQL Node): Overhaul
  fix(OpenAI Node): Update models to only show those supported (#5805)
  ci: Add test for wait node (no-changelog) (#5414)
  fix(Github Trigger Node): Remove content_reference event (#5830)
  ci: Validate load options methods in nodes-base (no-changelog) (#5862)
  ci: Use `--chown=node:node` in COPY commands in the custom docker image (no-changelog) (#5913)
  🚀 Release 0.224.0 (#5957)
  fix(NocoDB Node): Fix for updating or deleting rows with not default primary keys
  fix(HTTP Request Node): Show detailed error message in the UI again (#5959)
  ci: Prevent skipping of E2E fail job (no-changelog) (#5958)
  ci: Fix E2E tests on master (no-changelog) (#5960)
  refactor(core): Use injectable classes for db repositories (part-1) (no-changelog) (#5953)
  fix(core): Validate customData keys and values (#5920) (no-changelog)
  feat(editor): Add user activation survey (#5677)
  fix(editor): Update vite legacy-plugin browser target (no-changelog) (#5952)
  docs: Fix typo in AWS S3 and S3 nodes for parent folder key (#5933)
  fix(core): Update xml2js to address CVE-2023-0842 (#5948)
  fix(Code Node): Update vm2 to address CVE-2023-29017 (#5947)
  ...

# Conflicts:
#	packages/workflow/src/Interfaces.ts
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 node/improvement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants