Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Publishing and versioning of child-resources and parents #744

Merged
merged 131 commits into from
Feb 1, 2022

Conversation

MariusStorhaug
Copy link
Contributor

@MariusStorhaug MariusStorhaug commented Dec 5, 2021

Change

  • Added utilities/pipelines/resourcePublish/Get-ModulesToUpdate.ps1:
    • Get changed module files including children, making a list of the corresponding template file and new version.
      • Get the major and minor versions from the version.json file in the module folder
      • Calculate patch number based on the number of commits on HEAD ref. (This Will cause patch to never reset to 0 with major and/or minor increment, as specified for semver).
    • When child modules are updated, do a cascading update/publish of direct ascendant modules (parent, grandparent, etc.).
  • Remove versionOption and customVersion from action and scripts.
    • .github\actions\templates\publishModule\action.yml
      • TemplateSpec
      • Bicep Registry
    • .azuredevops\pipelineTemplates\module.jobs.publish.yml
      • Univarsal Package
      • TemplateSpec
      • Bicep Registry
  • Added version files for all modules incl child modules.
  • Updated all module-specific workflows with the following:
    • remove inputs for versionOption and customVersion
    • remove output from first jobs no longer requiring versionOption and customVersion
    • Added new input called prerelease, allowing prerelease publishing on custom branches, using manual triggers.
  • Remove redundant version check, calculation etc:
    • utilities/pipelines/resourcePublish/Publish-ModuleToPrivateBicepRegistry.ps1
    • utilities/pipelines/resourcePublish/Publish-ModuleToTemplateSpec.ps1:
  • arm.global\global.module.tests.ps1
    • Added test for existance of version.json in module folder
  • Added/updated wiki docs for how to use versioning of modules.

https://github.com/Azure/ResourceModules/actions/runs/1542449697

Known issues

  • Updating a minor/major version on a child, should require an upstream version update on the parent module. This is not automated, though there is a separate issue to address as a validation/test to verify that this is done.

Type of Change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update (Wiki)

Checklist

  • I'm sure there are no other open Pull Requests for the same update/change
  • My corresponding pipelines/checks run clean and green without any errors or warnings
  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (readme)
  • I did format my code

@github-actions
Copy link

github-actions bot commented Dec 5, 2021

Unit Test Results

  1 files  ±  0  1 suites  ±0   18s ⏱️ - 13m 1s
  2 tests  -   3  2 ✔️  - 3    0 💤 ±  0  0 ±0 
34 runs  +19  2 ✔️  - 3  32 💤 +22  0 ±0 

Results for commit db4f8a9. ± Comparison against base commit 58aec33.

This pull request removes 5 and adds 2 tests. Note that renamed tests count towards both.
/home/runner/work/ResourceModules/ResourceModules/utilities/tools/tests/ConvertTo-ARMTemplate.Tests.ps1 ‑ Test flag to including children.All Azure DevOps pipeline files are changed
/home/runner/work/ResourceModules/ResourceModules/utilities/tools/tests/ConvertTo-ARMTemplate.Tests.ps1 ‑ Test flag to including children.All GitHub workflow files are updated
/home/runner/work/ResourceModules/ResourceModules/utilities/tools/tests/ConvertTo-ARMTemplate.Tests.ps1 ‑ Test flag to including children.All bicep files are removed
/home/runner/work/ResourceModules/ResourceModules/utilities/tools/tests/ConvertTo-ARMTemplate.Tests.ps1 ‑ Test flag to including children.All deploy.bicep files are converted to deploy.json
/home/runner/work/ResourceModules/ResourceModules/utilities/tools/tests/ConvertTo-ARMTemplate.Tests.ps1 ‑ Test flag to including children.All json files have metadata removed
/home/runner/work/ResourceModules/ResourceModules/arm/.global/global.module.tests.ps1 ‑ API version tests [All apiVersions in the template should be 'recent'].In [Microsoft.Insights/actionGroups] used resource type [actionGroups] should use on of the recent API version(s). Currently using [2019-06-01]
/home/runner/work/ResourceModules/ResourceModules/arm/.global/global.module.tests.ps1 ‑ API version tests [All apiVersions in the template should be 'recent'].In [Microsoft.Insights/actionGroups] used resource type [roleassignments] should use on of the recent API version(s). Currently using [2021-04-01-preview]

♻️ This comment has been updated with latest results.

@MariusStorhaug MariusStorhaug force-pushed the users/mast/publishing branch 5 times, most recently from a440680 to add10da Compare December 5, 2021 23:45
@MariusStorhaug MariusStorhaug linked an issue Dec 6, 2021 that may be closed by this pull request
@MariusStorhaug MariusStorhaug requested a review from eriqua January 31, 2022 16:44
AlexanderSehr
AlexanderSehr previously approved these changes Feb 1, 2022
@MariusStorhaug MariusStorhaug merged commit caeb3a1 into main Feb 1, 2022
@MariusStorhaug MariusStorhaug deleted the users/mast/publishing branch February 1, 2022 09:29
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
[cat] modules category: modules [cat] pipelines category: pipelines [cat] publishing category: publishing enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing ADO pipeline for ms.network.firewallpolicies.yml 'Publish' 'changed' child-resources
4 participants