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

build: Add reset script #10627

Merged
merged 9 commits into from
Sep 3, 2024
Merged

build: Add reset script #10627

merged 9 commits into from
Sep 3, 2024

Conversation

tomi
Copy link
Contributor

@tomi tomi commented Aug 30, 2024

Summary

We often face situations where a build will fail because some cache somewhere is messing up with the build. This PR adds a nuke script that can be used to delete all files that might be out of date (i.e. node_modules, dist files, .turbo cache, tsbuildinfo files, etc). It is a more destructive version from clean, which doesn't touch e.g. node_modules.

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with release/backport (if the PR is an urgent fix that needs to be backported)

@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 Aug 30, 2024
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.

instead of maintaining a list of purgable files/folder in every package, could we use git clean -xd instead (with --exclude to skip deleting certain files/folders)?

We often face situations where a build will fail because some cache somewhere
is messing up with the build. This PR adds a `nuke` script that can be used to
delete all files that might be out of date (i.e. node_modules, dist files, .turbo
cache, tsbuildinfo files, etc). It is a more destructive version from `clean`, which
doesn't touch e.g. node_modules.
@tomi
Copy link
Contributor Author

tomi commented Sep 3, 2024

instead of maintaining a list of purgable files/folder in every package, could we use git clean -xd instead (with --exclude to skip deleting certain files/folders)?

@netroy I updated the script to be a bit more sophisticated. Added.vscode/settings.json and .env files to exclude. Anything else?

scripts/reset.mjs Outdated Show resolved Hide resolved
tomi and others added 2 commits September 3, 2024 13:01
Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <netroy@users.noreply.github.com>
@tomi tomi requested a review from netroy September 3, 2024 10:18
@tomi tomi changed the title build: Add nuke script build: Add reset script Sep 3, 2024
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.

this should work, but has one minor issue that if someone runs pnpm reset before running pnpm i, this script will error out.

scripts/reset.mjs Show resolved Hide resolved
@tomi
Copy link
Contributor Author

tomi commented Sep 3, 2024

this should work, but has one minor issue that if someone runs pnpm reset before running pnpm i, this script will error out.

Fixed this by ensuring zx is available. Not necessary ideal to run pnpm install to just delete the node_modules and run pnpm install again, but it works

@tomi tomi requested a review from netroy September 3, 2024 11:08
Copy link
Contributor

github-actions bot commented Sep 3, 2024

✅ All Cypress E2E specs passed

Copy link

cypress bot commented Sep 3, 2024

n8n    Run #6719

Run Properties:  status check passed Passed #6719  •  git commit 3118a03d0b: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 tomi 🗃️ e2e/*
Project n8n
Branch Review add-nuke-script
Run status status check passed Passed #6719
Run duration 04m 43s
Commit git commit 3118a03d0b: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 tomi 🗃️ e2e/*
Committer Tomi Turtiainen
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 1
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 423
View all changes introduced in this branch ↗︎

@tomi tomi merged commit c97a96d into master Sep 3, 2024
32 checks passed
@tomi tomi deleted the add-nuke-script branch September 3, 2024 12:35
MiloradFilipovic added a commit that referenced this pull request Sep 5, 2024
* master:
  refactor(RabbitMQ Trigger Node): Improve type-safety, add tests, and fix issues with manual triggers (#10663)
  feat(editor): Add support for nodes with multiple main inputs in new canvas (no-changelog) (#10659)
  fix(editor): Set minimum zoom to 0 to allow fitting very large workflows in new canvas (no-changelog) (#10666)
  feat(editor): Change selection to be default canvas behaviour (no-changelog) (#10668)
  feat: More hints to nodes  (#10565)
  fix(editor): Fix opening executions tab from a new, unsaved workflow (#10652)
  fix(AI Agent Node): Fix tools agent when using memory and Anthropic models (#10513)
  feat(editor): Make highlighted data pane floating (#10638)
  fix(editor): Fix workflow loading after switching to executions view in new canvas (no-changelog) (#10655)
  refactor(benchmark): Separate cloud env provisioning from running benchmarks (#10657)
  feat(core): Implement wrapping of regular nodes as AI Tools (#10641)
  refactor(editor): Remove Trial logic in personalization modal and port to script setup (#10649)
  fix(core): Declutter webhook insertion errors (#10650)
  feat: Reintroduce collaboration feature (#10602)
  feat(benchmark): Add scenario for expressions with Set node (#10647)
  feat(benchmark): Add benchmark scenario for binary files (#10648)
  build: Add `reset` script (#10627)
  feat(editor): Overhaul node insert position computation in new canvas (no-changelog) (#10637)
@janober
Copy link
Member

janober commented Sep 5, 2024

Got released with n8n@1.58.0

riascho pushed a commit that referenced this pull request Sep 23, 2024
Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <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 Released ui Enhancement in /editor-ui or /design-system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants