Skip to content

Instantly share code, notes, and snippets.

@johlju
Last active June 4, 2022 12:30
Show Gist options
  • Save johlju/1d812a8ebcf3b10782d9ad32ad76a8af to your computer and use it in GitHub Desktop.
Save johlju/1d812a8ebcf3b10782d9ad32ad76a8af to your computer and use it in GitHub Desktop.
Steps to rename a DSC Community module repository

Steps to rename a DSC Community module repository

GitHub repository, Azure Devops and PowerShell Gallery

  1. Send in a PR (and merge it) to update the pipelines files so the repo are using the latest from Sampler.
    ./build.ps1 -ResolveDependency -Tasks build
    # Use the default values and answer Y on all questions 
    New-SampleModule -DestinationPath '..\' -ModuleType 'dsccommunity' -ModuleAuthor 'DSC Community contributors' -ModuleName (Split-Path -Leaf $PWD) -ModuleDescription 'no description' -LicenseType MIT -SourceDirectory 'source' -ModuleVersion '0.0.1' 
    Get-ChildItem -Path *.bak -Recurse -Force | Remove-Item -Force
    
  2. Send a PR deprecating the current module name. Make sure to set the version of the last release to the next patch version, and the next version of the renamed module to the next major version (renaming a module is a breaking change).
    ### Deprecated
    
    - **The module _xWebAdministration_ will be renamed to _WebAdministrationDsc_
      ([issue #213](https://github.com/dsccommunity/xWebAdministration/issues/213)).
      The version `v3.2.1` will be the the last release of _xWebAdministration_.
      Version `v4.0.0` will be released as _WebAdministrationDsc_, it will be
      released shortly after the `v1.6.1` release to be able to start transition
      to the new module. The prefix 'x' will be removed from all resources in
      _WebAdministrationDsc_.**
    
  3. Merge deprecation PR Make sure the version numbers are correctly set and bumped (not major or minor version), keep an eye on the pipeline and stop before deploy step if unexpected version is about to be release
  4. Make a full release, make sure to tag the release version that was set in the deprecation message.
  5. Tweet the the module has been deprecated:
    FailoverClusterDsc will be the new name of xFailOverCluster. For that reason we just released v1.6.1 with a deprecation notice in the changelog. FailoverClusterDsc will be released as v2.0.0. There will be no more changes to xFailOverCluster. https://www.powershellgallery.com/packages/xFailOverCluster/1.16.1
    
  6. Send in a PR (do not merge yet) that:
    • renames all files and update code containing old module name to new module name
    • renames all files and update code removing prefix 'x'
    • updates all schema files to change MOF resource class name prefix from MSFT_ to DSC_
    • renames all files and update code that uses the prefix MSFT_ to use instead use DSC_.
  7. Renamed GitHub repository to new project (module) name
  8. Renamed Azure DevOps project to new project (module) name
  9. Rename Azure Pipelines pipeline, and edit the pipeline to re-point to the renamed repository. Make sure to just save the pipeline and do not queue (meaning, do not run it).
  10. Through GitHub, kick of the pipeline on the PR that updates all repository files with the new names.
  11. Update GitHub branch protection rules with the renamed status checks (happens when renaming the Azure Pipelines pipeline).
  12. In PowerShell Gallery, create a new API key that allows to publish new packages and versions using the global pattern of the new module name.
  13. Update the API key variable in the renamed pipeline in the Azure DevOps project.
  14. Merge the PR that updates all repository files with the new names.

Contributors:

  1. (Optional) Update the forked repository to the new module name.
  2. (Optional) Update the Azure Devops project to the new module name.
  3. (Optional) Update the Azure Pipelines pipeline to the new module name.
  4. Rename the locally cloned repository folder.
  5. Update the Git remotes in the locally cloned repository folder.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment