NetworkingDsc icon indicating copy to clipboard operation
NetworkingDsc copied to clipboard

Trim the line before splitting parts in HostsFile

Open cdhunt opened this issue 1 year ago • 10 comments

Pull Request (PR) description

Trim the line before splitting parts in Get-HostEntry.

This Pull Request (PR) fixes the following issues

  • Fixes #526

Task list

  • [x] 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).
  • [x] Resource documentation added/updated in README.md.
  • [x] Resource parameter descriptions added/updated in README.md, schema.mof and comment-based help.
  • [x] Comment-based help added/updated.
  • [x] Localization strings added/updated in all localization files as appropriate.
  • [x] Examples appropriately added/updated.
  • [x] Unit tests added/updated. See DSC Community Testing Guidelines.
  • [x] Integration tests added/updated (where possible). See DSC Community Testing Guidelines.
  • [x] New/changed code adheres to DSC Community Style Guidelines.

This change is Reviewable

cdhunt avatar May 31 '24 13:05 cdhunt

The build pipeline is failing because the pipeline files haven't been updated in sometime and using a Linux build agent (which fails). I'll update the pipeline to the latest version so that you can rebase.

PlagueHO avatar Jun 01 '24 00:06 PlagueHO

@PlagueHO If you point me to an example, I can probably help.

cdhunt avatar Jun 07 '24 14:06 cdhunt

Updated pipeline files has been merged thanks to @PlagueHO. This PR can be rebased.

johlju avatar Jun 07 '24 18:06 johlju

Sorry @cdhunt - the pipeline fix was already waiting for review (https://github.com/dsccommunity/NetworkingDsc/pull/529). But there will be other DSC resource repos that need similar updates... so if you're inclined and have the time, we're always happy to have help doing the chores :grinning:

I've completed:

  • NetworkingDsc
  • ComputerManagementDsc
  • StorageDsc

PR needs review:

  • DFSDsc

Still need to complete:

  • xPSDesiredStateConfiguration
  • ADCertificateServicesDsc
  • CertificateDsc
  • iSCSIDsc
  • FileContentDsc
  • WSManDsc
  • FSRMDsc

@johlju - I'll probably sit down and do some of these tonight. Will raise issues and assign them to myself as I go.

PlagueHO avatar Jun 07 '24 20:06 PlagueHO

It looks like the unit test gets hung up on Context Ensure is Present and the Firewall rule does exist but has a different Direction. I thought it was just my system, but the same is happing in AzDo. I haven't look at the source yet.

cdhunt avatar Jun 10 '24 18:06 cdhunt

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 97%. Comparing base (e8b5edc) to head (43ce5ae).

Additional details and impacted files

Impacted file tree graph

@@         Coverage Diff         @@
##           main   #527   +/-   ##
===================================
  Coverage    97%    97%           
===================================
  Files        28     28           
  Lines      2078   2078           
===================================
  Hits       2028   2028           
  Misses       50     50           
Files Coverage Δ
...urce/DSCResources/DSC_HostsFile/DSC_HostsFile.psm1 97% <100%> (ø)

codecov[bot] avatar Jun 10 '24 19:06 codecov[bot]

What do you think the desired/expected behavior would be? Should it support intentional whitespace or enforce an exact format? You could use File.Contents if you want custom formatting.

cdhunt avatar Jun 11 '24 14:06 cdhunt

@PlagueHO Can you rerun the failed integration test job?

cdhunt avatar Jun 11 '24 16:06 cdhunt

@PlagueHO Can you rerun the failed integration test job?

I helped with that.

johlju avatar Jun 11 '24 17:06 johlju

I've added additional tests which I believe cover at least one edge case and better cover the scenario I'm trying to fix.

cdhunt avatar Jun 12 '24 15:06 cdhunt