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

Evaluate resource preconditions and postconditions during apply even if they have no planned change #31491

Merged
merged 2 commits into from Jul 22, 2022

Commits on Jul 21, 2022

  1. core: Create apply graph nodes even for no-op "changes"

    We previously would optimize away the graph nodes for any resource
    instance without a real change pending, but that means we don't get an
    opportunity to re-check any invariants associated with the instance, such
    as preconditions and postconditions.
    
    Other upstream changes during apply can potentially decide the outcome of
    a condition even if the instance itself isn't being changed, so we do
    still need to revisit these during apply or else we might skip running
    certain checks altogether, if they yielded unknown results during planning
    and then don't get run during apply.
    apparentlymart committed Jul 21, 2022
    Copy the full SHA
    b9cc9c0 View commit details
    Browse the repository at this point in the history
  2. core: Do everything except the actual action for plans.NoOp

    Previously we tried to early-exit before doing anything at all for any
    no-op changes, but that means we also skip some ancillary steps like
    evaluating any preconditions/postconditions.
    
    Now we'll skip only the main action itself for plans.NoOp, and still run
    through all of the other side-steps.
    
    Since one of those other steps is emitting events through the hooks
    interface, this means that now no-op actions are visible to hooks, whereas
    before we always filtered them out before calling. I therefore added some
    additional logic to the hooks to filter them out at the UI layer instead;
    the decision for whether or not to report that we visited a particular
    object and found no action required seems defensible as a UI-level concern
    anyway.
    apparentlymart committed Jul 21, 2022
    Copy the full SHA
    91cb440 View commit details
    Browse the repository at this point in the history