Skip to content

direct: handle remotely deleted resources#3710

Merged
denik merged 2 commits intomainfrom
denik/delete-deleted
Oct 2, 2025
Merged

direct: handle remotely deleted resources#3710
denik merged 2 commits intomainfrom
denik/delete-deleted

Conversation

@denik
Copy link
Contributor

@denik denik commented Oct 2, 2025

Changes

  • When planning resource deletion, skip resource that were already deleted.
  • When DoDelete returns 'resource not found', consider it a success and continue.
  • Fix metadata computation not to error on resources that are deleted.
  • Combine CalculatePlanFor{Deploy,Destroy} into one function.

Why

Better plan, matches terraform.

Tests

New acceptance test that remotely delete a job and test deploy/destroy.

@denik denik temporarily deployed to test-trigger-is October 2, 2025 14:58 — with GitHub Actions Inactive
@denik denik changed the title direct: better plan for remotely deleted resources direct: handle remotely deleted resources Oct 2, 2025
@denik denik enabled auto-merge October 2, 2025 15:11
@eng-dev-ecosystem-bot
Copy link
Collaborator

eng-dev-ecosystem-bot commented Oct 2, 2025

Run: 18196918593

Env ✅​pass 🙈​skip
✅​ aws linux 320 537
✅​ aws windows 321 536
✅​ aws-ucws linux 436 433
✅​ aws-ucws windows 437 432
✅​ azure linux 320 536
✅​ azure windows 321 535
✅​ azure-ucws linux 436 432
✅​ azure-ucws windows 437 431
✅​ gcp linux 319 538
✅​ gcp windows 320 537

// root
l := b.Config.GetLocation("resources.jobs." + name)
if l.File == "" {
// b.Config.Resources.Jobs may include a job that only exists in state but not in config
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this possible and why only for jobs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that's because we populate ID and URL for all resources (for summary)? I don't have a repro, this maybe triggered under specific conditions, but I've seen this particular error before.

It's only happening for jobs because this code is only run for jobs but other resources would behave the same.

@denik denik added this pull request to the merge queue Oct 2, 2025
Merged via the queue into main with commit 2bddd05 Oct 2, 2025
13 checks passed
@denik denik deleted the denik/delete-deleted branch October 2, 2025 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments