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

Change _ensure to _exist #206

Merged
merged 10 commits into from
Sep 29, 2023
Merged

Change _ensure to _exist #206

merged 10 commits into from
Sep 29, 2023

Conversation

SteveL-MSFT
Copy link
Member

PR Summary

Based on discussion, renaming _ensure which is a directive to _exist which is a property. This ensures it can be returned properly in a response and used as a request. Registry resource updated to match the semantics.

PR Context

Fix #202
Fix #162

@michaeltlombardi michaeltlombardi added Issue-Enhancement The issue is a feature or idea Doc-Impact labels Sep 27, 2023
@michaeltlombardi
Copy link
Collaborator

@SteveL-MSFT - I'll test tomorrow, but to clarify for the registry resource, my understanding is:

  • If the desired state instance only defines the keyPath, not valueName, _exist indicates whether the key exists.
  • If the desired state instance defines both keyPath and valueName, _exist indicates whether the value exists on that key. If the key exists and the value doesn't, _exist is false. If the key doesn't exist, neither does the value, so _exist is false. Only when both exist does the resource return true.

If so, rad, and I'll get those changes updated after this PR lands.

@SteveL-MSFT
Copy link
Member Author

@michaeltlombardi yes, that should be correct

registry/src/config.rs Show resolved Hide resolved
registry/src/config.rs Show resolved Hide resolved
@SteveL-MSFT SteveL-MSFT added this pull request to the merge queue Sep 29, 2023
Merged via the queue into PowerShell:main with commit cc22e11 Sep 29, 2023
4 checks passed
@SteveL-MSFT SteveL-MSFT deleted the exists branch September 29, 2023 13:03
michaeltlombardi added a commit to michaeltlombardi/DSC that referenced this pull request Oct 5, 2023
This change updates the project changelog, reference documentation, and
schemas for the recent PRs merged for the project:

- PowerShell#206
- PowerShell#208
- PowerShell#211
- PowerShell#213
- PowerShell#215
- PowerShell#216
- PowerShell#217

The updates include:

- Documenting the new `_exist` property, replacing `_ensure` for
  resources. This documentation update includes the schema definition,
  but doesn't regenerate the schema, which will be handled separately.
- Documenting the new `completer` command.
- Documenting the new `--input` and `--input-file` global options.
- Adding a deprecation notice to the `_ensure` documentation.
- Adding entries for all user-impacting changes to the changelog.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Doc-Impact Issue-Enhancement The issue is a feature or idea
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rename _ensure to _exist Make Microsoft.Windows/Registry idiomatic
4 participants