Hi there! We're thrilled that you'd like to contribute to this project. Your help is essential for keeping it great.
Contributions to this project are released to the public under the project's open source license.
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
Here's some helpful notes on how to contribute to this project, including details on how to get started working the codebase.
If you think you've found a bug or have a great idea for new functionality please create an Issue in this repo. We have Issue Templates for both Bugs and Feature Requests.
Use the Discussions tab in this repo for more general feedback or any questions/comments on this tooling.
All work done by the maintainers of this repo is tracked in this repo using Issues. We have a hierarchical backlog with Epics at the top, broken down into Batches then broken down to Tasks (epic/batch/task is indicated via labels on the issues). You can see an example Epic and navigate down from there here.
If you want to run tests selectively in the terminal, you can use dotnet test with --filter
option.
Here are some examples:
- Run all tests in
AdoApiTests
class. Navigate to eithersrc
(where thesln
file is) orsrc/octoshiftcli.tests
(where thecsproj
file is) and then execute the following command:
dotnet test --filter AdoApiTests
- Run a specific test-
GetUserId_Should_Return_UserId
insrc/OctoshiftCLI.Tests/Octoshift/Services/AdoApiTests
. Navigate tosrc
orsrc/octoshiftcli.tests
and then execute the following command:
dotnet test --filter AdoApiTests.GetUserId_Should_Return_UserId
If you are using VS code, you can install the C# dev kit which will add the testing extension.
- Press the play to run the entire test suite, or navigate to the specific test you would like to run.
- If you set a breakpoint within your code and press the play button with the bug next to it you will be able to inspect your code in more detial.
There are two ways to debug code within VS code.
Run the following commands in your terminal depending on the provider you are looking to run the commands for.
Azure DevOps:
- Generic:
dotnet run --project src/ado2gh/ado2gh.csproj -- [command]
- Example:
dotnet run --project src/ado2gh/ado2gh.csproj -- migrate-repo --help
Bitbucket Server:
- Generic:
dotnet run --project src/bbs2gh/bbs2gh.csproj -- [command]
- Example:
dotnet run --project src/bbs2gh/bbs2gh.csproj -- migrate-repo --help
GitHub:
- Generic:
dotnet run --project src/gei/gei.csproj -- [command]
- Example:
dotnet run --project src/gei/gei.csproj -- migrate-repo --help
You can use a C# REPL to execute any C# code. There are many C# REPLs available, CSharpRepl is one of them and can be installed globally with the following:
In your terminal:
dotnet tool install --global CSharpRepl --version [version]
(v0.4.0 is the latest version compatible with .NET 6.0)
Run it:
csharprepl -r src/bbs2gh/bin/Debug/net6.0/Octoshift.dll
Then load up assemblies:
#r "Octoshift.dll"
// You might need others, for example the AWS SDK:
#r "AWSSDK.Core.dll"
#r "AWSSDK.S3.dll"
// Add necessary usings
using OctoshiftCLI.Services;
// Instantiate your classes
var aws = new AwsApi("access-key-id", "secret-access-key");
If you use the built in debugger you are able to set breakpoints and inspect the code within VS Code.
- Navigate to
.vs_code/launch.json
. - Find the command you are looking to run, for example:
Launch ado2gh
. - Update the args property to have the arguments you're looking to test (using real org and project names):
- "args": ["migrate-repo", "--ado-org", "example-org", "--ado-team-project", "example-project" ...]
- Set a breakpoint within your code as needed.
- Navigate to the
Run and debug
side panel option. - Navigate to the drop down menu and select the command you would like to run, for example:
Launch ado2gh
. - Press the play button
Before submitting a Pull Request please first open an issue to get feedback on the change you intend to submit.
When creating a PR the template will prompt you to confirm that you have done a few required steps (or at least considered them and determined they are not necessary on this PR):
-
Most code should include unit tests (and sometimes e2e tests). New features should include new tests in the same PR. And changes to existing behaviour should update the relevant tests.
-
If this change is something that users should be notified about (e.g. most bug fixes and new features - but probably not code refactorings) be sure to add one or more bullets to the
RELEASENOTES.md
file. The contents of this file will automatically be included in the next release. -
Consider whether the code changes should have any additional (or changed) log output and be sure those logging changes are included in the same PR.
-
Most PR's should be linked to one or more relevant issues that they implement.
For more info on how to get started contributing code see this doc.