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

OfficeOnlineServerHost: New resource proposal #71

Open
wants to merge 24 commits into
base: master
Choose a base branch
from

Conversation

JonasCassier
Copy link
Contributor

@JonasCassier JonasCassier commented Nov 20, 2023

Pull Request (PR) description

Adds new resource OfficeOnlineServerHost

This Pull Request (PR) fixes the following issues

Task list

  • Added an entry to the change log under the Unreleased section of the
    file CHANGELOG.md. Entry should say what was changed and how that
    affects users (if applicable), and reference the issue being resolved
    (if applicable).
  • Resource documentation added/updated in README.md.
  • Resource parameter descriptions added/updated in README.md, schema.mof
    and comment-based help.
  • Comment-based help added/updated.
  • Localization strings added/updated in all localization files as appropriate.
  • Examples appropriately added/updated.
  • Unit tests added/updated. See DSC Community Testing Guidelines.
  • Integration tests added/updated (where possible). See DSC Community Testing Guidelines.
  • New/changed code adheres to DSC Community Style Guidelines.

This change is Reviewable

Copy link

codecov bot commented Nov 20, 2023

Codecov Report

Merging #71 (60df501) into master (869fff3) will increase coverage by 0%.
Report is 1 commits behind head on master.
The diff coverage is 94%.

Additional details and impacted files

Impacted file tree graph

@@         Coverage Diff          @@
##           master   #71   +/-   ##
====================================
  Coverage      80%   81%           
====================================
  Files           6     7    +1     
  Lines         750   804   +54     
====================================
+ Hits          606   657   +51     
- Misses        144   147    +3     
Files Coverage Δ
...eOnlineServerHost/MSFT_OfficeOnlineServerHost.psm1 94% <94%> (ø)

@JonasCassier
Copy link
Contributor Author

@johlju I didn't know that

git checkout Feature/OfficeOnlineServerHost
git reset origin/master --hard
git push origin --force

would cause the linked PR to be closed.

Here a new one that i created form my Backup :D.

@johlju
Copy link
Member

johlju commented Nov 20, 2023

You shouldn’t use git reset, at least not in this case. I only use reset when trying to undo commits in working branches.

The steps I mentioned in the first PR should work. I do them daily. If you have to do it again. If you get any error on an issued command, don’t issue other commands and let me know what error you encounter on that last issues command.

Copy link
Member

@johlju johlju left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 10 files reviewed, 3 unresolved discussions (waiting on @JonasCassier)


src/DSCResources/MSFT_OfficeOnlineServerHost/MSFT_OfficeOnlineServerHost.psm1 line 36 at r1 (raw file):

    Write-Verbose -Message $script:localizedData.GetAllowList

    Import-Module -Name 'OfficeWebApps' -ErrorAction 'Stop' -Verbose:$false

Is it possible to use Assert-Module instead? E.g. Assert-Module -ModuleName 'OfficeWebApps' -ImportModule


src/DSCResources/MSFT_OfficeOnlineServerHost/MSFT_OfficeOnlineServerHost.psm1 line 38 at r1 (raw file):

    Import-Module -Name 'OfficeWebApps' -ErrorAction 'Stop' -Verbose:$false

    Confirm-OosDscEnvironmentVariables

Minor. Looking at what this function does we could instead uses these commands: Set-PSModulePath -Path (Get-PSModulePath -FromTarget 'Machine'). Commands from DscResource.Common. It wouldn't do the exactly the same thing, but the end result would be the same, setting the values of the machine PSModulePath to the session one, probably reason is that after installation and prior to first reboot this is necessary.


src/DSCResources/MSFT_OfficeOnlineServerHost/MSFT_OfficeOnlineServerHost.psm1 line 50 at r1 (raw file):

    catch
    {
        throw $_

Maybe we can use New-InvalidOperationException, then there is no need to throw and we can provide our own message too (from the localization string file)?

 $errorMessage = $script:localizedData.FailedGettingAllowList
 New-InvalidOperationException -Message $errorMessage -ErrorRecord $_

Though, sometimes there isn't a good idea for the Get-function to throw since that might prevent a configuration to get the current state before everything is installed (e.g. running Get-DscConfiguration before node is in desired state. So we could consider just outputting the exception message with Write-Debug? 🤔 E.g. Write-Debug -Message $_.Exception.Message, or maybe Write-Debug -Message $_.ToString() is better to get full stack trace?

@johlju
Copy link
Member

johlju commented Nov 21, 2023

Just had time for a quick glance of the Get-function. Continue as soon as I have time. Back to the reality for while now (real work). 🙂

Copy link
Contributor Author

@JonasCassier JonasCassier left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 10 files reviewed, 3 unresolved discussions (waiting on @johlju)


src/DSCResources/MSFT_OfficeOnlineServerHost/MSFT_OfficeOnlineServerHost.psm1 line 38 at r1 (raw file):

Previously, johlju (Johan Ljunggren) wrote…

Minor. Looking at what this function does we could instead uses these commands: Set-PSModulePath -Path (Get-PSModulePath -FromTarget 'Machine'). Commands from DscResource.Common. It wouldn't do the exactly the same thing, but the end result would be the same, setting the values of the machine PSModulePath to the session one, probably reason is that after installation and prior to first reboot this is necessary.

I don't understand that yet. "Assert-Module -ModuleName 'OfficeWebApps' -ImportModule" imports the module. "Set-PSModulePath -Path (Get-PSModulePath -FromTarget 'Machine')" does not import the module. Or do you want to use module auto-loading?

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.

OfficeOnlineServerHost: New resource proposal
2 participants