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

[FEATURE] yarn osd clean script should clean targets #1418

Closed
boktorbb opened this issue Apr 1, 2022 · 4 comments
Closed

[FEATURE] yarn osd clean script should clean targets #1418

boktorbb opened this issue Apr 1, 2022 · 4 comments
Labels
enhancement New feature or request technical debt If not paid, jeapardizes long-term success and maintainability of the repository.

Comments

@boktorbb
Copy link
Contributor

boktorbb commented Apr 1, 2022

Is your feature request related to a problem? Please describe.

Currently, we need to manually remove target directories that have outdated files that stop yarn osd bootstrap from running.

This most commonly happens with Cheerio and the type definitions in enzyme-helpers

Describe the solution you'd like

The current yarn osd clean script should find and clean targets across the dashboards codebase

Describe alternatives you've considered

n/a

Additional context

n/a

@boktorbb boktorbb changed the title [FEATURE] yarn osd clean script does not properly clean targets [FEATURE] yarn osd clean script should clean targets Apr 1, 2022
@boktorbb boktorbb added the enhancement New feature or request label Apr 1, 2022
@ashwin-pc
Copy link
Member

We can add the feature to do this with an optional flag --targets so that we don't change the existing behaviour

@seraphjiang
Copy link
Member

Thanks to @ashwin-pc @AMoo-Miki

One of the latests commits made to OSD updates some dependencies that require you to delete existing target folders on your dev environment and bootstrapped again before starting up. This seems to only be an issue if you are pulling the latest changes and bootstrapping OSD.
Error:

ERROR [bootstrap] failed:
ERROR Error: Command failed with exit code 1: /usr/share/yarn/bin/yarn.js run osd:bootstrap
      error Command failed with exit code 1.
      $ node scripts/build_ts_refs && node scripts/register_git_hook
      ERROR Error: Command failed with exit code 1: /home/anan/work/OpenSearch-Dashboards/node_modules/typescript/bin/tsc -b tsconfig.refs.json --pretty
            src/test_utils/target/public/enzyme_helpers.d.ts:61:5 - error TS2304: Cannot find name 'Cheerio'.

            61 }): Cheerio;
                   ~~~~~~~


            Found 1 error. 

osd clean does not delete all the target folders and this seems to be the issue. Cleaning all the target folders using find . -name 'target' -type d -prune -exec rm -rf '{}' + (Credits [@miki] and then running osd clean should allow the bootstrap to work

@kavilla
Copy link
Member

kavilla commented Apr 7, 2022

Yes I agree with @ashwin-pc or just create a new command that calls clean and then follows it up with the script provided by above.

My biggest reason is sometimes a target folder could contain something I build but don't want to disappear. But I need clear my node_modules. So changing this script's existing functionality might cause some folks to be really upset. It's actually pretty upsetting already that when we run integration test it deletes the contents of the plugin folder.

My suggestion for the new name is nuke like yarn osd nuke, it gets the point across that this command will destroy anything you have locally if it isn't source controlled.

@tmarkley
Copy link
Contributor

This was resolved with #1442

@tmarkley tmarkley added the technical debt If not paid, jeapardizes long-term success and maintainability of the repository. label May 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request technical debt If not paid, jeapardizes long-term success and maintainability of the repository.
Projects
None yet
Development

No branches or pull requests

5 participants