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

(DOCS) Document new and changed config functions #391

Merged

Conversation

michaeltlombardi
Copy link
Collaborator

PR Summary

This change adds reference documentation and changelog entries for the new and updated configuration functions in DSC.

It also:

  • Defines a few helper snippets for docs authoring, scoped to the Markdown files in the repository.
  • Adds maintainer comments to the changelog for using the snippets and for updating the changelog, particularly around releases.

PR Context

Prepare for next release.


## Synopsis

Returns an integer from an input string or non-integer number.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure if int() needs to be capable of converting from a non-integer number, as https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/template-functions-numeric#int specifies the input as string or int (...though I can't really think of a use case for calling int() with an int)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think there's some value in getting return data from a resource like 1.3 and converting it to 1, but I don't fully disagree with you.

It's also worth noting that, right now, converting a number with a fractional part to an integer with this configuration function is broken - see #390 for more details.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thinking this over again, I think we should do one of the following:

  • Allow the function to convert numbers with fractional parts to integers, and fix the implementation.
  • Raise an error when the input to the function isn't a string or integer, indicating that only those two data types are supported.

I'm fine to update the docs in this PR to limit the input to a string or integer, but if DSC doesn't raise an error for other data types users can end up in a weird position. I would prefer the utility of handling strings and numbers (with and without fractional parts), but I understand if we're trying to maintain strict equivalence with the ARM template functions.

Copy link
Member

Choose a reason for hiding this comment

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

@michaeltlombardi can you open an issue to track this?

CHANGELOG.md Show resolved Hide resolved
.vscode/docs.code-snippets Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@michaeltlombardi michaeltlombardi force-pushed the docs/main/config-func-docs branch 2 times, most recently from 3f4692f to cfaac4b Compare April 17, 2024 19:12
This change adds reference documentation and changelog entries for the
new and updated configuration functions in DSC.

It also:

- Defines a few helper snippets for docs authoring, scoped to the
  Markdown files in the repository.
- Adds maintainer comments to the changelog for using the snippets and
  for updating the changelog, particularly around releases.
@SteveL-MSFT SteveL-MSFT added this pull request to the merge queue Apr 17, 2024
Merged via the queue into PowerShell:main with commit d75cc5c Apr 17, 2024
4 checks passed
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.

None yet

3 participants