Skip to content

Commit 4d365b7

Browse files
CopilotKoenZomers
andcommitted
Remove build/test instructions and add backward compatibility guidance with Alias attribute
Co-authored-by: KoenZomers <[email protected]>
1 parent 314df57 commit 4d365b7

File tree

1 file changed

+11
-61
lines changed

1 file changed

+11
-61
lines changed

.github/copilot-instructions.md

Lines changed: 11 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ This is a cross-platform module (Windows, macOS, Linux) that requires PowerShell
1919
- **Framework**: .NET 8.0
2020
- **Target Platform**: PowerShell 7.4+
2121
- **Build System**: .NET SDK 8
22-
- **Testing**: MSTest / xUnit
2322
- **Dependencies**:
2423
- PnP Framework
2524
- PnP Core SDK
@@ -32,10 +31,6 @@ This is a cross-platform module (Windows, macOS, Linux) that requires PowerShell
3231
/
3332
├── .github/ # GitHub workflows and configurations
3433
├── build/ # Build scripts (PowerShell)
35-
│ ├── Build-Debug.ps1 # Local development builds
36-
│ ├── Build-Nightly.ps1 # CI/CD builds
37-
│ ├── Build-Release.ps1 # Release builds
38-
│ └── Run-Tests.ps1 # Test execution
3934
├── src/
4035
│ ├── Commands/ # Cmdlet implementations (organized by feature)
4136
│ │ ├── Admin/ # Tenant administration cmdlets
@@ -45,7 +40,6 @@ This is a cross-platform module (Windows, macOS, Linux) that requires PowerShell
4540
│ │ ├── Graph/ # Microsoft Graph cmdlets
4641
│ │ └── ... # Many other feature areas
4742
│ ├── ALC/ # Assembly Load Context for dependency isolation
48-
│ ├── Tests/ # Unit and integration tests
4943
│ └── Resources/ # Embedded resources
5044
├── documentation/ # Markdown documentation for each cmdlet
5145
├── pages/ # Documentation website content
@@ -109,47 +103,12 @@ namespace PnP.PowerShell.Commands.FeatureArea
109103

110104
8. **Resource Strings**: Store error messages in `Resources.resx` and reference via `Resources.MessageName`
111105

112-
## Building and Testing
113-
114-
### Local Development Build
115-
116-
```powershell
117-
# Build for debugging
118-
.\build\Build-Debug.ps1
119-
120-
# Run tests
121-
.\build\Run-Tests.ps1
122-
```
123-
124-
### Build Requirements
125-
- .NET 8 SDK installed
126-
- PowerShell 7.4+ installed
127-
- For Windows: Visual Studio 2022 or later (optional, for IDE)
128-
129-
### Testing Guidelines
130-
131-
1. **Test Location**: Tests go in `src/Tests/` matching the feature area structure
132-
2. **Test Naming**: Follow pattern `{Verb}Pnp{Noun}Tests.cs`
133-
3. **Test Class Structure**:
134-
135-
```csharp
136-
using Microsoft.VisualStudio.TestTools.UnitTesting;
137-
138-
namespace PnP.PowerShell.Tests.FeatureArea
139-
{
140-
[TestClass]
141-
public class VerbPnpNounTests
142-
{
143-
[TestMethod]
144-
public void TestMethodName()
145-
{
146-
// Arrange
147-
// Act
148-
// Assert
149-
}
150-
}
151-
}
152-
```
106+
9. **Backward Compatibility**: When renaming a cmdlet or fixing a typo in a cmdlet name, always add an `[Alias()]` attribute with the old cmdlet name to maintain backward compatibility. Example:
107+
```csharp
108+
[Cmdlet(VerbsCommon.Get, "PnPEntraIDAppSitePermission")]
109+
[Alias("Get-PnPAzureADAppSitePermission")]
110+
public class GetEntraIDAppSitePermission : PnPGraphCmdlet
111+
```
153112

154113
## Coding Standards
155114

@@ -266,11 +225,10 @@ Description of output type.
266225
✅ Add examples to documentation
267226
✅ Use PipeBind classes for flexible parameter input
268227
✅ Handle errors gracefully with meaningful messages
269-
Write unit tests for new cmdlets
270228
✅ Use existing helper methods and utilities from base classes
271229
✅ Follow the existing code structure and patterns
272-
Test on multiple platforms when possible (Windows, Linux, macOS)
273230
✅ Use `ClientContext.ExecuteQueryRetry()` instead of `ExecuteQuery()` for resilience
231+
✅ Add `[Alias()]` attribute when renaming cmdlets to maintain backward compatibility
274232
275233
### Don'ts
276234
❌ Don't add cmdlets without proper documentation
@@ -290,18 +248,10 @@ Description of output type.
290248
2. **Clone** your fork locally
291249
3. **Create a branch** for your feature/fix from `dev` branch
292250
4. **Make changes** following the patterns above
293-
5. **Build and test** locally using build scripts
294-
6. **Update documentation** in `/documentation/` folder
295-
7. **Commit** with clear, descriptive messages
296-
8. **Push** to your fork
297-
9. **Create Pull Request** to the `dev` branch
298-
299-
## Build Artifacts
300-
301-
- Debug builds output to: `src/Commands/bin/Debug/net8.0/`
302-
- Release builds create NuGet packages
303-
- Help files: Generated from XML comments and documentation
304-
- Module manifest: `PnP.PowerShell.psd1`
251+
5. **Update documentation** in `/documentation/` folder
252+
6. **Commit** with clear, descriptive messages
253+
7. **Push** to your fork
254+
8. **Create Pull Request** to the `dev` branch
305255
306256
## Additional Resources
307257

0 commit comments

Comments
 (0)