👍🎉 First off, thanks for taking the time to contribute! 🎉👍
The following is a set of guidelines for contributing to go-msgraph. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.
You can either report bugs, create feature requests as an issue so that the community can work on it, or you are very welcome to implement the code yourself and submit it as a pull-request.
The program is as of 08/2021 developed with Visual Studio Code with several plugins and docker. With that setup it's easy to update to the latest docker version and not have any golang version installed locally.
Install the following to use this:
- Visual Studio Code with the following Plugins:
- Docker Engine
The repository contains a .devcontainer/devcontainer.json
that automatically configures this docker container used for development.
If you want to run go test
locally, you must set the following environment variables:
MSGraphTenantID
: Microsoft Graph API TenantIDMSGraphApplicationID
: Microsoft Graph Application IDMSGraphClientSecret
: Microsoft Graph ClientSecretMSGraphExistingGroupDisplayName
: The name of an existing Group in Azure Active DirectoryMSGraphExistingGroupDisplayNameNumRes
: The number of results when searching for the above group. E.g. the group "users" will return three results upon searching, if the following groups exist: "users", "users-sales", "technicians-users-only"MSGraphExistingUserPrincipalInGroup
: auserPrincipalName
that is member of the group above, format:[email protected]
Furthermore, the following environment variables are optional:
MSGraphAzureADAuthEndpoint
: Defaults tomsgraph.AzureADAuthEndpoint
, hence https://login.microsoftonline.com. Set this environment variable to use e.g. a US endpointMSGraphServiceRootEndpoint
: Defaults tomsgraph.ServiceRootEndpoint
, hence https://graph.microsoft.com. Set this environment variable to use e.g. a US endpointMSGraphExistingCalendarsOfUser
: Existing calendars of the above users, separated by a comma (,
). This is optional, tests are skipped if not present. In case you dont use Office 365 / Mailboxes.
This may be done locally, or in .devcontainer/devcontainer.json
if you use my suggested environment, but be careful not to add the changes to the commit (!):
{
// ...
"settings": {
"go.toolsManagement.checkForUpdates": "local",
"go.useLanguageServer": true,
"go.gopath": "/go",
"go.goroot": "/usr/local/go",
"go.testEnvVars": {
"MSGraphTenantID": "67dce6ac-xxxx-xxxx-xxxx-0807c45243a7",
"MSGraphApplicationID": "1b99ac3b-xxxx-xxxx-xxxx-6f7998277091",
"MSGraphClientSecret": "PZ.Wzfbxxxxxxxxxxxx2oe++TOid/YVG",
"MSGraphExistingGroupDisplayName": "technicians",
"MSGraphExistingGroupDisplayNameNumRes" : "1",
"MSGraphExistingUserPrincipalInGroup": "[email protected]",
"MSGraphAzureADAuthEndpoint": "https://login.microsoftonline.com",
"MSGraphServiceRootEndpoint": "https://graph.microsoft.com",
"MSGraphExistingCalendarsOfUser" : "Calendar,Birthdays",
},
},
// ...
}
If you use Visual Studio Code without Remote Contaienrs
, you may place it in .vscode/settings.json
:
{
"go.testEnvVars": {
"MSGraphTenantID": "67dce6ac-xxxx-xxxx-xxxx-0807c45243a7",
"MSGraphApplicationID": "1b99ac3b-xxxx-xxxx-xxxx-6f7998277091",
"MSGraphClientSecret": "PZ.Wzfbxxxxxxxxxxxx2oe++TOid/YVG",
"MSGraphExistingGroupDisplayName": "technicians",
"MSGraphExistingGroupDisplayNameNumRes" : "1",
"MSGraphExistingUserPrincipalInGroup": "[email protected]",
"MSGraphExistingCalendarsOfUser" : "Calendar,Birthdays",
},
}
- code is formatted with
go fmt