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

Extension cannot index newly generated project in an existing workspace #24

Open
hugorut opened this issue Jul 8, 2022 · 0 comments
Open
Labels
bug Something isn't working

Comments

@hugorut
Copy link
Collaborator

hugorut commented Jul 8, 2022

Consider the following VSCode workspace:

prod/ # terraform project
dev/ # terraform project

If a user adds a further project to this workspace, e.g. stag, then the Infracost extension will not show price code lenses on resources within this project. This occurs because this stag project does not exist in the initial init run. To fix this, we could run a init on every file we cannot associate with a project. However, this would be very slow for a user.

Some initial ideas about how we could handle this without impacting speed:

  1. A naive approach would be to check if the stag folder is at the same level as other detected projects, e.g. dev. We would have to somehow exclude module calls from this.
  2. We could expose a shallow project detection method in the Infracost CLI. Which uses the same method as breakdown but avoids all the block computation and price lookup. This could then be safely called for every unassociated file, as it would be quick to run.
@hugorut hugorut added the bug Something isn't working label Jul 8, 2022
@hugorut hugorut pinned this issue Jul 8, 2022
@hugorut hugorut changed the title Extension cannot index newly generate project in an existing workspace Extension cannot index newly generated project in an existing workspace Oct 21, 2022
@hugorut hugorut unpinned this issue Oct 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant