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

AzureDevOpsDsc: Enums should move out of prefix file #12

Closed
johlju opened this issue Jan 24, 2021 · 4 comments · Fixed by #28
Closed

AzureDevOpsDsc: Enums should move out of prefix file #12

johlju opened this issue Jan 24, 2021 · 4 comments · Fixed by #28
Labels
enhancement The issue is an enhancement request.

Comments

@johlju
Copy link
Member

johlju commented Jan 24, 2021

Like 'Classes' enums should be single ps1 files with 1 enum definition per file. Compilation will put them in the main module psm1.
No needs for subfolders in enums.

enum Ensure
{
Present
Absent
}
enum RequiredAction
{
None
Get
New
Set
Remove
Test
Error
}

As per #7 (comment).

@johlju johlju added enhancement The issue is an enhancement request. help wanted The issue is up for grabs for anyone in the community. labels Jan 24, 2021
@SphenicPaul
Copy link
Contributor

@johlju / @gaelcolas - Regarding this point, having moved the enums into their own directory (and files) and out of the prefix.ps1, the enums don't end up in the final AzureDevOps.psm1 file. The classes that use/require them hit errors when the .psm1 file is run/loaded because the enums aren't present.

See fork branch here.

I'm skipping this for now but any thoughts/comments/suggestions welcome.

@johlju
Copy link
Member Author

johlju commented Jan 28, 2021

Well, it seems the folder name should be the very non-intuitive Enum and not Enums. One would not expect that since the other folder is Classes and not Class. 😆

I had to double-check in this repo as I know @gaelcolas made it work there: https://github.com/dsccommunity/JeaDsc/tree/master/source

I learned something new today. 🙂

@gaelcolas
Copy link
Member

gaelcolas commented Jan 28, 2021 via email

@SphenicPaul
Copy link
Contributor

Thanks both. That resolved it. 😄

Added to PR #28.

johlju pushed a commit that referenced this issue Jan 29, 2021
…es (#28)

- AzureDevOpsDsc
    - Increased Azure DevOps, API timeout to 5 minutes to allow for busy/slow API
      operations (issue #25).
    - Updated contextual help (issue #5).
    - Removed `Classes` directory from being output in packaged module (issue #10).
    - Removed `Examples` directory from being output in packaged module (issue #11).
    - Moved 'Ensure' and 'RequiredAction' enums into 'Enum' directory and out of
      'prefix.ps1' (issue #12).
@johlju johlju removed the help wanted The issue is up for grabs for anyone in the community. label Jan 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement The issue is an enhancement request.
Projects
None yet
3 participants