You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
- 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.
- Fixed `gh gei migrate-secret-alerts` command to handle long resolution comments by truncating them to fit within GitHub's 270 character limit while preserving the resolver name prefix.
- Fixed `ado2gh integrate-boards` command to properly report errors when GitHub PAT permissions are incorrect, instead of incorrectly reporting success.
2
+
- Added `--target-api-url` option to `gh ado2gh rewire-pipeline` command to support customers migrating to [GitHub Enterprise Cloud with data residency](https://docs.github.com/en/enterprise-cloud@latest/admin/data-residency/about-github-enterprise-cloud-with-data-residency)
3
+
- Updated `ado2gh generate-script` to no longer include ADO Boards integration commands in the generated script. This is a temporary change to fix broken functionality until we can ship a longer term fix. More details can be found [here](https://github.com/github/gh-gei/issues/1357)
thrownewOctoshiftCliException("Missing data from 'ms.vss-work-web.github-user-data-provider'. Please ensure the Azure DevOps project has a configured GitHub connection.");
vardataProviders=data["dataProviders"]??thrownewOctoshiftCliException("Missing data from 'ms.vss-work-web.github-user-data-provider'. Please ensure the Azure DevOps project has a configured GitHub connection.");
225
+
vardataProvider=dataProviders["ms.vss-work-web.github-user-data-provider"]??thrownewOctoshiftCliException("Missing data from 'ms.vss-work-web.github-user-data-provider'. Please ensure the Azure DevOps project has a configured GitHub connection.");
vardataProviders=data["dataProviders"]??thrownewOctoshiftCliException("Could not retrieve GitHub repository information. Please verify the repository exists and the GitHub token has the correct permissions.");
#pragma warning restore IDE0046// Convert to conditional expression
653
+
{
654
+
thrownewOctoshiftCliException("Could not retrieve GitHub repository information. Please verify the repository exists and the GitHub token has the correct permissions.");
Copy file name to clipboardExpand all lines: src/Octoshift/Services/SecretScanningAlertService.cs
+8-1Lines changed: 8 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,4 @@
1
+
usingSystem;
1
2
usingSystem.Collections.Generic;
2
3
usingSystem.Linq;
3
4
usingSystem.Threading.Tasks;
@@ -74,7 +75,13 @@ public virtual async Task MigrateSecretScanningAlerts(string sourceOrg, string s
74
75
75
76
_log.LogInformation($" updating target alert:{targetAlert.Alert.Number} to state:{sourceAlert.Alert.State} and resolution:{sourceAlert.Alert.Resolution}");
0 commit comments