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

Fix tests, minor style issues, offline CAB update #80

Merged
merged 5 commits into from
Jul 16, 2024

Conversation

Borgquite
Copy link
Contributor

@Borgquite Borgquite commented Jun 19, 2024

Pull Request (PR) description

@johlju Have started work on this module with a lot of small ‘cleanup’ tasks.

Hopefully there’s no argument over these changes - gets the tests working, fixes some dodgy strings, updates the offline CAB, adds some additional Classification GUIDs to the notes for convenience. It should hopefully be a quick and easy one for review & approval :)

This Pull Request (PR) fixes the following issues

None

Task list

  • Added an entry under the Unreleased section of the change log in the CHANGELOG.md.
    Entry should say what was changed, and how that affects users (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 Resource Testing Guidelines.
  • Integration tests added/updated (where possible). See DSC Resource Testing Guidelines.
  • New/changed code adheres to DSC Resource Style Guidelines and Best Practices.

This change is Reviewable

@Borgquite
Copy link
Contributor Author

@johlju Are you able to take a look at this sometime please?

@johlju
Copy link
Member

johlju commented Jul 7, 2024

When I have time I will take a look. 🙂

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.

Reviewed 13 of 14 files at r1, all commit messages.
Reviewable status: 13 of 14 files reviewed, 1 unresolved discussion (waiting on @Borgquite)


source/DSCResources/MSFT_UpdateServicesServer/WSUS.cab line 0 at r1 (raw file):
Why do we need to change this file? What is it used for? Since the content of the file cannot be reviewed, what would it take to update this file in the pipeline, so that the pipeline installs the correct things and add the correct file to the package?

Copy link
Contributor Author

@Borgquite Borgquite 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: 13 of 14 files reviewed, 1 unresolved discussion (waiting on @johlju)


source/DSCResources/MSFT_UpdateServicesServer/WSUS.cab line at r1 (raw file):

Previously, johlju (Johan Ljunggren) wrote…

Why do we need to change this file? What is it used for? Since the content of the file cannot be reviewed, what would it take to update this file in the pipeline, so that the pipeline installs the correct things and add the correct file to the package?

It's a current export of Microsoft's WSUS product metadata. The contents can be reviewed, but not automatically through Reviewable - just download, extract, and look at the before/after XML files.

The purpose of the file and how it is generated is documented here:
https://learn.microsoft.com/en-us/mem/configmgr/sum/get-started/synchronize-software-updates-disconnected

But the basics are - it allows the WSUS server to be set up offline without requiring connectivity to Microsoft Update. The process is:

  1. Choose a WSUS server that is synchronized with Microsoft Update by using the software update classifications, products, and languages that you need in your Configuration Manager environment. (FOR THE PURPOSE HERE, I set up a fully patched Windows Server 2022 Standard VM with all classifications, products and languages).
  2. Perform a sync
  3. Run wsusutil.exe export packagename logfilename
  4. Grab a copy of the packagename

I found that without the updated version, I was unable to configure a new WSUS server to synchronise new products that came out since the last update (e.g. 'Windows Admin Center'). The CAB needs to be periodically updated (as far as I can see, this has been done before in the lifetime of this module).

I did look to see if the Microsoft published and regularly updated Windows Update offline scan file, Wsusscan2.cab, could be used instead (see below). This would make your pipeline suggestion feasable. However, the contents of that file do not match the output of 'wsusutil.exe export' generated in the above process.

https://support.microsoft.com/en-gb/topic/a-new-version-of-the-windows-update-offline-scan-file-wsusscn2-cab-is-available-for-advanced-users-fe433f4d-44f4-28e3-88c5-5b22329c0a08

@johlju

This comment was marked as duplicate.

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.

Reviewed 1 of 14 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Borgquite)


source/DSCResources/MSFT_UpdateServicesServer/WSUS.cab line at r1 (raw file):

Previously, Borgquite (Chris Hill) wrote…

It's a current export of Microsoft's WSUS product metadata. The contents can be reviewed, but not automatically through Reviewable - just download, extract, and look at the before/after XML files.

The purpose of the file and how it is generated is documented here:
https://learn.microsoft.com/en-us/mem/configmgr/sum/get-started/synchronize-software-updates-disconnected

But the basics are - it allows the WSUS server to be set up offline without requiring connectivity to Microsoft Update. The process is:

  1. Choose a WSUS server that is synchronized with Microsoft Update by using the software update classifications, products, and languages that you need in your Configuration Manager environment. (FOR THE PURPOSE HERE, I set up a server with all classifications, products and languages).
  2. Perform a sync
  3. Run wsusutil.exe export packagename logfilename
  4. Grab a copy of the packagename

I found that without the updated version, I was unable to configure a new WSUS server to synchronise new products that came out since the last update (e.g. 'Windows Admin Center'). The CAB needs to be periodically updated (as far as I can see, this has been done before in the lifetime of this module).

I did look to see if the Microsoft published and regularly updated Windows Update offline scan file, Wsusscan2.cab, could be used instead (see below). This would make your pipeline suggestion feasable. However, the contents of that file do not match the output of 'wsusutil.exe export' generated in the above process.

https://support.microsoft.com/en-gb/topic/a-new-version-of-the-windows-update-offline-scan-file-wsusscn2-cab-is-available-for-advanced-users-fe433f4d-44f4-28e3-88c5-5b22329c0a08

Thanks for the detailed explanation! 🙂 So to be able to do this in the pipeline, we would have to install a WSUS server, sync it to MS Update and configure the new classifications and products then run the command. Would it be feasible to do all that without user intervention for each deploy in Azure Pipelines on a Win2022 Server build worker within its 4 hour run time?

@johlju
Copy link
Member

johlju commented Jul 16, 2024

The diff of the .cab file is so large so it is not feasible to review it, I have to assume it is correct and valid. 🙂

@johlju
Copy link
Member

johlju commented Jul 16, 2024

I added issue #81 to track if there is a way to automate generating the .cab file.

@johlju johlju merged commit 33a94a8 into dsccommunity:main Jul 16, 2024
4 of 5 checks passed
@Borgquite Borgquite deleted the offline-export-fixes branch July 16, 2024 14:43
Copy link
Contributor Author

@Borgquite Borgquite 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: all files reviewed, 1 unresolved discussion


source/DSCResources/MSFT_UpdateServicesServer/WSUS.cab line at r1 (raw file):

Previously, johlju (Johan Ljunggren) wrote…

Thanks for the detailed explanation! 🙂 So to be able to do this in the pipeline, we would have to install a WSUS server, sync it to MS Update and configure the new classifications and products then run the command. Would it be feasible to do all that without user intervention for each deploy in Azure Pipelines on a Win2022 Server build worker within its 4 hour run time?

No worries! I think this would be possible, as the initial sync takes minutes, not hours. Not something I'd be keen to do myself, but I can't see why it couldn't be done...

Copy link
Contributor Author

@Borgquite Borgquite left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

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