Skip to content

Commit 7b42179

Browse files
authored
Merge branch 'main' into issue-1365
2 parents 66284da + ddb27e0 commit 7b42179

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

.github/copilot-instructions.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
This is a C# based repository that produces several CLIs that are used by customers to interact with the GitHub migration APIs. Please follow these guidelines when contributing:
2+
3+
## Code Standards
4+
5+
### Required Before Each Commit
6+
- Run `dotnet format src/OctoshiftCLI.sln` before committing any changes to ensure proper code formatting. This will run dotnet format on all C# files to maintain consistent style
7+
8+
### Development Flow
9+
- Build: `dotnet build src/OctoshiftCLI.sln /p:TreatWarningsAsErrors=true`
10+
- Test: `dotnet test src/OctoshiftCLI.Tests/OctoshiftCLI.Tests.csproj`
11+
12+
## Repository Structure
13+
- `src/`: Contains the main C# source code for the Octoshift CLI
14+
- `src/ado2gh/`: Contains the ADO to GH CLI commands
15+
- `src/bbs2gh/`: Contains the BBS to GH CLI commands
16+
- `src/gei/`: Contains the GitHub to GitHub CLI commands
17+
- `src/Octoshift/`: Contains shared logic used by multiple commands/CLIs
18+
- `src/OctoshiftCLI.IntegrationTests/`: Contains integration tests for the Octoshift CLI
19+
- `src/OctoshiftCLI.Tests/`: Contains unit tests for the Octoshift CLI
20+
21+
## Key Guidelines
22+
1. Follow C# best practices and idiomatic patterns
23+
2. Maintain existing code structure and organization
24+
4. Write unit tests for new functionality.
25+
5. When making changes that would impact our users (e.g. new features or bug fixes), add a bullet point to `RELEASENOTES.md` with a user friendly brief description of the change
26+
6. Never silently swallow exceptions.
27+
7. If an exception is expected/understood and we can give a helpful user-friendly message, then throw an OctoshiftCliException with a user-friendly message. Otherwise let the exception bubble up and the top-level exception handler will log and handle it appropriately.

.github/workflows/integration-tests.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ on:
66
pr_number:
77
type: number
88
required: true
9+
sha:
10+
type: string
11+
required: true
12+
13+
permissions:
14+
contents: read
15+
checks: write
16+
pull-requests: write
917

1018
jobs:
1119
build-for-e2e-test:
@@ -20,6 +28,19 @@ jobs:
2028
ref: 'refs/pull/${{ github.event.inputs.pr_number }}/merge'
2129
fetch-depth: 0
2230

31+
- name: Check SHA
32+
run: |
33+
git fetch origin refs/pull/${{ github.event.inputs.pr_number }}/head:pr-head
34+
prsha=`git rev-parse pr-head | awk '{ print $1 }'`
35+
36+
echo "PR SHA: $prsha"
37+
echo "expected SHA: ${{ github.event.inputs.SHA }}"
38+
39+
if [ "$prsha" != "${{ github.event.inputs.SHA }}" ]; then
40+
echo "SHA must match" >&2
41+
exit 1
42+
fi
43+
2344
- name: Setup .NET
2445
uses: actions/setup-dotnet@v2
2546
with:
@@ -67,6 +88,7 @@ jobs:
6788
e2e-test:
6889
needs: [ build-for-e2e-test ]
6990
strategy:
91+
fail-fast: false
7092
matrix:
7193
runner-os: [windows-latest, ubuntu-latest, macos-latest]
7294
source-vcs: [AdoBasic, AdoCsv, Bbs, Ghes, Github]

0 commit comments

Comments
 (0)