Thank you for your interest and support in developing azd.
- Visit API documentation and find the API to create a wrapper function.
- Get familiar with the REST API.
- Fork this repository and create a branch for your work.
- In your local development environment open the pom.xml file and sync to install dependencies.
- If you are adding a new function to the existing class
- Update the version in
<className>Version
file - If you are adding any types create a class and add it under
types
package
- Update the version in
- Write tests first, this helps to decide on what is important and what to cover in the main class and method.
- Write help. It is important to explain what the function does to the user.
- Code the function/method.
- Update
CHANGELOG.md
- Install
Java
development kit 11 or higher- add
JAVA_HOME
to environment variables
- add
- Install Maven
- add
MAVEN_HOME
to environment variables
- add
Note: If you ran into "long path" issue on
Windows
, enable paths longer than 260 characters by:
1.- Run this as Administrator on a command prompt:
REG ADD HKLM\SYSTEM\CurrentControlSet\Control\FileSystem /v LongPathsEnabled /t REG_DWORD /d 1
(might need to typeyes
to override key if it already exists)
2.- Set upgit
by running:
git config --system core.longpaths true
To access the REST API of Azure DevOps you are going to need personal access token. This will be used as the authentication mechanism for accessing services in Azure DevOps. You can learn on how to create personal access token from here.
In order to know the response from API you can use postman
. It can be downloaded from postman website.
It is good to begin with GET
method first as it lists all the necessary responses, and we can create our own type
based on that. For instance lets take the artifact packages endpoint
GET https://feeds.dev.azure.com/{organization}/{project}/_apis/packaging/Feeds/{feedId}/packages?api-version=6.1-preview.1
You should replace {organization}
with your organisation name, {project}
with your project name and {feedId}
with
the feed name from which you would like to fetch the packages.
Now, in postman
it looks like this
You need to set-up the authentication to get the response from API. To do that click on Authorization
tab and select
Basic Auth
from the drop down. You don't have to enter the username just enter your personal access token in password
section.
You are set to send the request. Click on Send
and you will see the response from API if you have any packages
in your Azure DevOps artifacts.
It is good to get familiarised with the code by forking the repository and creating your own branch for your work. You can then clone the repository to your development environment and start working.
- You should write unit test before you start writing the function/method/class. This way you can decide on how the functionality of your code should be.
- You can use the existing class as template to create your own. This way we maintain consistent across the library.
- Maintain the versions of different endpoints in Versions.java class
- Manage all the types under
types
package and define your own if necessary - Code your function and write help.
- Update
_unitTest.json
file undertest
package with your own organisation name, project and personal access token to run unit tests. - Once its all done, update
CHANGELOG.md
.