Skip to content

Commit 9465dbe

Browse files
Merge branch 'bumps' into dependabot/github_actions/actions/upload-artifact-7.0.0
2 parents 094c40a + b849acd commit 9465dbe

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ Depending on the labels in the pull requests, the [workflow will result in diffe
5656
- [Example - `BeforeAll.ps1`](#example---beforeallps1)
5757
- [Teardown - `AfterAll.ps1`](#teardown---afterallps1)
5858
- [Example - `AfterAll.ps1`](#example---afterallps1)
59+
- [Best practices for shared test infrastructure](#best-practices-for-shared-test-infrastructure)
60+
- [Use deterministic naming with `$env:GITHUB_RUN_ID`](#use-deterministic-naming-with-envgithub_run_id)
61+
- [Clean up stale resources from previous failed runs](#clean-up-stale-resources-from-previous-failed-runs)
62+
- [Tests reference shared resources — they do not create them](#tests-reference-shared-resources--they-do-not-create-them)
63+
- [Naming conventions](#naming-conventions)
5964
- [Module tests](#module-tests)
6065
- [Get test results](#get-test-results)
6166
- [Get code coverage](#get-code-coverage)
@@ -94,7 +99,12 @@ Depending on the labels in the pull requests, the [workflow will result in diffe
9499
- [Related Configuration](#related-configuration)
95100
- [Repository structure](#repository-structure)
96101
- [Module source code structure](#module-source-code-structure)
102+
- [Declaring module dependencies](#declaring-module-dependencies)
97103
- [Principles and practices](#principles-and-practices)
104+
- [Linear versioning](#linear-versioning)
105+
- [Release and feature branches](#release-and-feature-branches)
106+
- [Colocation of concerns](#colocation-of-concerns)
107+
- [Compatibility](#compatibility)
98108

99109
### Get-Settings
100110

@@ -953,18 +963,45 @@ How the module is built.
953963
│ └── README.md # Module-level docs ingested by Document-PSModule
954964
```
955965

966+
### Declaring module dependencies
967+
968+
Declare module dependencies using
969+
[`#Requires -Modules`](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_requires)
970+
statements at the top of function files in `src/functions/public/` or `src/functions/private/` that require external modules.
971+
[Build-PSModule](https://github.com/PSModule/Build-PSModule) collects every `#Requires -Modules` declaration across all
972+
source files, de-duplicates the list, and writes it into the `RequiredModules` field of the compiled manifest
973+
automatically. For the full range of supported syntax variants, see the
974+
[about_Requires](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_requires)
975+
documentation.
976+
977+
> [!IMPORTANT]
978+
> Adding `RequiredModules` to `src/manifest.psd1` is **not** supported for this purpose. Those entries are silently
979+
> ignored by the build and will not appear in the compiled manifest. Use `#Requires -Modules` in function files instead.
980+
956981
## Principles and practices
957982

983+
### Linear versioning
984+
958985
The contribution and release process is based on the idea that a PR is a release, and we only maintain a single linear ancestry of versions, not going
959986
back to patch and update old versions of the modules. This means that if we are on version `2.1.3` of a module and there is a security issue, we only
960987
patch the latest version with a fix, not releasing new versions based on older versions of the module, i.e. not updating the latest 1.x with the
961988
patch.
962989

990+
### Release and feature branches
991+
963992
If you need to work forth a bigger release, create a branch representing the release (a release branch) and open a PR towards `main` for this branch.
964993
For each topic or feature to add to the release, open a new branch representing the feature (a feature branch) and open a PR towards the release
965994
branch. Optionally add the `Prerelease` label on the PR for the release branch, to release preview versions before merging and releasing a published
966995
version of the PowerShell module.
967996

997+
### Colocation of concerns
998+
999+
Colocate concerns for long-term maintainability. For example, `#Requires -Modules` statements belong in the function files that use them, not in a
1000+
central manifest — this makes it immediately visible which functions drive each external dependency, and avoids silent drift between the manifest and
1001+
the actual code. Another example is how parameter descriptions are placed as comments in the `param()` block directly above each parameter
1002+
declaration, rather than in the comment-based help at the top of the function — this keeps the description next to the code it documents.
1003+
1004+
### Compatibility
9681005

9691006
The process is compatible with:
9701007

0 commit comments

Comments
 (0)