spacelift-io / spacectl

Spacelift client and CLI
MIT License
129 stars 35 forks source link

[Feature Request] Implementing Target Local-Previewes #263

Open talqwe opened 1 week ago

talqwe commented 1 week ago

terraform plan -target=’resource’

provides a way to run plan only on specific resources

When running local-preview, the plan runs on all resources (our env has 1500 resources each) which can be very time consuming (4 envs with with 1500-2000 resources for example)

Can this be implemented with local-preview? Something like:

spacectl stack local-preview --target='resource1' --target='resource2'
tomasmik commented 1 week ago

Hey, this needs investigation, however my first impression is that this is quite complicated and would require a lot of work in the backend to actually make this happen. We tend to add features to spacectl that already exist in spacelift, however this doesn't really exist, so adding this is complicated and time consuming.

talqwe commented 1 week ago

Hey, this needs investigation, however my first impression is that this is quite complicated and would require a lot of work in the backend to actually make this happen. We tend to add features to spacectl that already exist in spacelift, however this doesn't really exist, so adding this is complicated and time consuming.

Well, local-preview is a feature that doesn't exist in the UI of Spacelift, so adding this feature will be entirely in the spacectl scope, and won't be needed in Spacelift itself

tomasmik commented 6 days ago

@talqwe that totally makes sense, however developers time is limited and the backend doesn't support picking resources before planning at least once no matter if it's a normal or a local preview run.

moshevayner commented 5 days ago

Hey @tomasmik ! I'm also following this issue, and I'm a bit curious.. In Spacelift UI, once I trigger a run, before I confirm it, I can actually mark a subset of the resources from the plan, and then trigger a re-plan with only the selected resources (which under the hood translates to a targeted plan on terraform, I presume): image

With that in mind- is this not done via the same API that spacectl uses?