Skip to content

Add isLocal parameter to FieldTriggers and ClassifyChanges - #3741

Merged
shreyas-goenka merged 12 commits into
mainfrom
field-trigger-remote
Oct 13, 2025
Merged

Add isLocal parameter to FieldTriggers and ClassifyChanges#3741
shreyas-goenka merged 12 commits into
mainfrom
field-trigger-remote

Conversation

@shreyas-goenka

@shreyas-goenkashreyas-goenka commented Oct 8, 2025

Copy link
Copy Markdown
Contributor

Changes:

  1. Change ActionTypeUnset to ActionTypeUndefined
  2. Add isLocal parameter to FieldTriggers and ClassifyChanges

Why

Resources like dashboards need to have differentiated local and remote diff computations. For example, the serialized_dashboard field should only be compared in local diff, and etag should only be compared in remote drift.

Thus we need different triggers based on whether the execution is local or remote.

Tests

Existing tests.

@shreyas-goenkashreyas-goenka changed the title Replace FieldTriggers with FieldTriggersLocal and FieldTriggersRemoteSplit FieldTriggers to FieldTriggersLocal and FieldTriggersRemoteOct 8, 2025
@shreyas-goenka
shreyas-goenka marked this pull request as ready for review October 8, 2025 15:12
@eng-dev-ecosystem-bot

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

Copy link
Copy Markdown
Collaborator

Run: 18459505211

Env🔄​flaky✅​pass🙈​skip
✅​aws linux322545
✅​aws windows323544
✅​aws-ucws linux438441
✅​aws-ucws windows439440
✅​azure linux322544
🔄​azure windows2321543
✅​azure-ucws linux438440
✅​azure-ucws windows439439
✅​gcp linux321546
✅​gcp windows322545
Test Nameazure windows
TestFilerWorkspaceNotebook🔄​f
TestFilerWorkspaceNotebook/rJupyterNb.ipynb🔄​f

Comment threadbundle/direct/dresources/cluster.go Outdated
Comment threadbundle/direct/dresources/adapter.go Outdated
Comment threadbundle/direct/dresources/model.go Outdated
}
}

func (r *ResourceMlflowModel) FieldTriggersLocal() map[string]deployplan.ActionType {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looking at this boilerplate in every resource I wonder if we should keep FieldTriggers() support in adapter? and allow implementations define one of these configurations:

  • FieldTriggers
  • FieldTriggersLocal & FieldTriggersRemote

Other mixes (e.g. FieldTriggers and FieldTriggersLocal) should be rejected by validate().

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I think either approach is reasonable.

I expect us to have more resources where the "etag" diff matters, like genie spaces. The advantage with the current method is it makes it clear how local and remote diffs are being computed.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

In general, I prefer one way to do things when possible.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Regarding one way of doing things, perhaps we should have one function and pass a boolean isLocal to it?

FieldTriggers(isLocal bool)
ClassifyChanges(isLocal bool)

Most resources would just ignore the parame

FieldTriggers(_ bool) {} ClassifyChanges(_ bool) {}

This would be one way of doing things, simplify adapter.go and have minimal boilerplate for resources that don't have a difference.

This would also allow to structure code in a way where local and remote share implementation.

Comment threadbundle/direct/dresources/adapter.go Outdated
Comment threadbundle/direct/dresources/adapter.go Outdated
Comment threadbundle/direct/dresources/adapter.go Outdated
Comment threadbundle/direct/dresources/adapter.go
Comment threadbundle/direct/dresources/model.go Outdated
}
}

func (r *ResourceMlflowModel) FieldTriggersLocal() map[string]deployplan.ActionType {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Regarding one way of doing things, perhaps we should have one function and pass a boolean isLocal to it?

FieldTriggers(isLocal bool)
ClassifyChanges(isLocal bool)

Most resources would just ignore the parame

FieldTriggers(_ bool) {} ClassifyChanges(_ bool) {}

This would be one way of doing things, simplify adapter.go and have minimal boilerplate for resources that don't have a difference.

This would also allow to structure code in a way where local and remote share implementation.

@shreyas-goenkashreyas-goenka changed the title Split FieldTriggers to FieldTriggersLocal and FieldTriggersRemoteAdd isLocal parameter to FieldTriggers and ClassifyChangesOct 10, 2025

@denikdenik left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Change looks good, just have a suggestion regarding docstring.

Comment threadbundle/direct/dresources/adapter.go Outdated
// Note, Create/Delete are handled explicitly and never compared.
const (
ActionTypeUnset ActionType = iota
ActionTypeUndefined ActionType = iota

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This would be nice to call out in PR description.

@shreyas-goenkashreyas-goenka changed the title Add isLocal parameter to FieldTriggers and ClassifyChangesAdd isLocal parameter to FieldTriggers and ClassifyChanges; Change ActionTypeUnset to ActionTypeUndefinedOct 13, 2025
@shreyas-goenkashreyas-goenka changed the title Add isLocal parameter to FieldTriggers and ClassifyChanges; Change ActionTypeUnset to ActionTypeUndefinedAdd isLocal parameter to FieldTriggers and ClassifyChangesOct 13, 2025
@shreyas-goenka
shreyas-goenka added this pull request to the merge queueOct 13, 2025
Merged via the queue into main with commit 21a4c6fOct 13, 2025
13 checks passed
@shreyas-goenka
shreyas-goenka deleted the field-trigger-remote branch October 13, 2025 09:53
shreyas-goenka added a commit that referenced this pull request Oct 14, 2025
…ange
This merge incorporates changes from PR #3741 which adds an isLocal
parameter to FieldTriggers and ClassifyChange methods to differentiate
between local changes (user modifications) and remote changes (drift
detection).
Key changes:
- Renamed ActionTypeUnset to ActionTypeUndefined
- Updated FieldTriggers to accept isLocal bool parameter
- Updated ClassifyChange to accept isLocal bool parameter
- Consolidated dashboard's separate FieldTriggersLocal/Remote methods
into single FieldTriggers(isLocal bool) method
- Updated adapter to store separate trigger maps for local and remote
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
denik pushed a commit that referenced this pull request May 20, 2026
## Changes:
1. Change ActionTypeUnset to ActionTypeUndefined
2. Add isLocal parameter to FieldTriggers and ClassifyChanges
## Why
Resources like dashboards need to have differentiated local and remote
diff computations. For example, the `serialized_dashboard` field should
only be compared in local diff, and `etag` should only be compared in
remote drift.
Thus we need different triggers based on whether the execution is local
or remote.
## Tests
Existing tests.
Sign up for freeto 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

@shreyas-goenka@eng-dev-ecosystem-bot@denik