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

(#3539) Add design documentation for C# cmdlets #3601

Open
wants to merge 1 commit into
base: feature/cmdlets
Choose a base branch
from

Conversation

vexx32
Copy link
Member

@vexx32 vexx32 commented Jan 15, 2025

Description Of Changes

  • Added CONTRIBUTING.md document to the Chocolatey.PowerShell project.

Motivation and Context

Given we use some slightly custom bits in Chocolatey.PowerShell that will alter how contributors are expected to work with the cmdlets in this project compared to how more bare-bones projects handle C# cmdlets, this document outlines some of the more notable changes as well as the common design practices we will be using here.

Testing

N/A, doc only.

Operating Systems Testing

N/A

Change Types Made

  • Bug fix (non-breaking change).
  • Feature / Enhancement (non-breaking change).
  • Breaking change (fix or feature that could cause existing functionality to change).
  • Documentation changes.
  • PowerShell code changes.

Change Checklist

  • Requires a change to the documentation.
  • Documentation has been updated.
  • Tests to cover my changes, have been added.
  • All new and existing tests passed?
  • PowerShell code changes: PowerShell v3 compatibility checked?

Related Issue

Fixes #3539

@vexx32 vexx32 requested review from gep13 and corbob January 15, 2025 21:02
Copy link
Member

@corbob corbob left a comment

Choose a reason for hiding this comment

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

Overall I think this looks good, just have a few clarifying questions, at least one I think requires changes.


### Output

By default, `ChocolateyCmdlet`'s `WriteObject()` method will enumerate collections when outputting them, similar to how PowerShell's `Write-Output` works by default. If you need to disable this, use the `WriteObject `
Copy link
Member

Choose a reason for hiding this comment

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

This line seems to end abruptly... I suspect there's more to be said here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, good catch, thanks. Must have meant to look up what the overload is and didn't come back to it.

src/Chocolatey.PowerShell/CONTRIBUTING.md Show resolved Hide resolved
Comment on lines 32 to 35
### Helpers

`ChocolateyCmdlet` provides some helper methods for common operations that might be needed for many cmdlets.
Some of these (and many more) are available on the `PSHelper` class.
Copy link
Member

Choose a reason for hiding this comment

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

Is there more to this section we want to include in this section? Is the intention that the next section answers the questions about what kind of things might be here? Should that perhaps be mentioned?

Copy link
Member Author

Choose a reason for hiding this comment

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

Mmmm. I think most of that is answered in the next section.... the exact line for what goes onto ChocolateyCmdlet itself is a little fuzzier and I don't have a fantastic way to delineate that really... In theory anything that takes PSCmdlet as a parameter could be a helper method attached to ChocolateyCmdlet, but in practice I think the useful set of things to have directly available is a good bit narrower given calling into PSHelper is not really a big ask.

@corbob
Copy link
Member

corbob commented Jan 16, 2025

One other thing that's occurred to me: Should we consider linking to this from the higher up contributing document? I'm a little concerned about the discoverability of the document if it's just a file in a directory where you might not look for it as you're in Visual Studio...

@vexx32
Copy link
Member Author

vexx32 commented Jan 16, 2025

Should we consider linking to this from the higher up contributing document?

That's something I thought about and... am not really sure about. I suppose it can't hurt, I did have a bit of a difficult time trying to figure out a sensible place in the main CONTRIBUTING doc to reference it, but I can always add a new section...

It also should probably be put into the sln file just to make it more visible in VS, I think. I'll do both.

Given we use some slightly custom bits in Chocolatey.PowerShell that
will alter how contributors are expected to work with the cmdlets in
this project compared to how more bare-bones projects handle C# cmdlets,
this document outlines some of the more notable changes as well as the
common design practices we will be using here.
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.

2 participants