Skip to content

Conversation

@denik
Copy link
Contributor

@denik denik commented Sep 10, 2025

Changes

New RemapState() method on resource that transform remote state to config type.

Why

To be used to detect remote drift.

Tests

Unit tests.

@eng-dev-ecosystem-bot
Copy link
Collaborator

eng-dev-ecosystem-bot commented Sep 10, 2025

Run: 17732207783

Env ✅​pass 🔄​flaky 🙈​skip
✅​ aws linux 312 526
🔄​ aws windows 311 2 525
✅​ aws-ucws linux 424 424
✅​ aws-ucws windows 425 423
✅​ azure linux 312 525
✅​ azure windows 313 524
✅​ azure-ucws linux 424 423
✅​ azure-ucws windows 425 422
✅​ gcp linux 311 527
✅​ gcp windows 312 526
Test Name aws windows
TestAccept 🔄​flaky
TestAccept/bundle/deploy/mlops-stacks 🔄​flaky

@denik denik added this pull request to the merge queue Sep 15, 2025
Merged via the queue into main with commit 6b833b7 Sep 15, 2025
13 checks passed
@denik denik deleted the denik/remap-state branch September 15, 2025 13:53
Copy link
Contributor

@pietern pietern left a comment

Choose a reason for hiding this comment

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

The struct copies are covered with the linter to check for completeness?

return &input.JobSettings
}

func (*ResourceJob) RemapState(jobs *jobs.Job) *jobs.JobSettings {
Copy link
Contributor

Choose a reason for hiding this comment

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

It could be worth adding type aliases for readability. We have 3 types that we're dealing with here:

  • Config type: resources.Job
  • State type: jobs.JobSettings
  • Remote type: jobs.Job

If we alias each of these to e.g. JobConfig, JobState, JobRemote, then it is unambiguous in which direction the remapping happens. It's not clear without context that this function maps from the remote type to the state type.

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.

5 participants