Skip to content

Commit 156e2ad

Browse files
authored
Update documentation (#16)
1 parent a2139c8 commit 156e2ad

10 files changed

Lines changed: 109 additions & 252 deletions

File tree

CONTRIBUTING.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,15 @@
22

33
For any major change, please open an issue before submitting a PR. For smaller issues, you are very welcome to open a PR directly.
44

5-
The project is built on [.NET 7](https://dotnet.microsoft.com/en-us/download/dotnet/7.0).
5+
The project combines an Azure DevOps extension built in ReactJS with a [.NET 7](https://dotnet.microsoft.com/en-us/download/dotnet/7.0) server.
66

77
## Install
88
Follow the instructions in the README.
99

1010
## Azure DevOps Extension
1111

12-
The extension was started from this sample: https://github.com/microsoft/azure-devops-extension-sample
13-
This sample is also interesting: https://github.com/microsoft/azure-devops-extension-hot-reload-and-debug
12+
For further instructions, consult the [extension readme](./extension/README.md).
1413

15-
Icon list: https://learn.microsoft.com/en-us/windows/apps/design/style/segoe-ui-symbol-font
16-
https://uifabricicons.azurewebsites.net/
14+
## .NET Server
1715

18-
19-
Extension manifest: https://learn.microsoft.com/en-us/azure/devops/extend/develop/manifest?view=azure-devops#scopes
20-
21-
22-
There is an issue with unit tests, that has the same symptoms as this: https://github.com/nrwl/nx/issues/812
16+
For further instructions, consult the [server readme](./server/README.md).

README.md

Lines changed: 22 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,52 @@
1-
[![.github/workflows/main.yml](https://github.com/dizco/AzureDevOps.InnerSource/actions/workflows/main.yml/badge.svg)](https://github.com/dizco/AzureDevOps.InnerSource/actions/workflows/main.yml) ![GitHub last commit](https://img.shields.io/github/last-commit/dizco/AzureDevOps.InnerSource) [![.NET](https://img.shields.io/badge/-7.0-512BD4?logo=.net)](https://dotnet.microsoft.com/) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://makeapullrequest.com)
1+
[![Latest image tag](https://ghcr-badge.egpl.dev/dizco/azuredevops.innersource/latest_tag?trim=major&label=latest%20image&ignore=pr-*)](https://github.com/dizco/AzureDevOps.InnerSource/pkgs/container/azuredevops.innersource) ![GitHub last commit](https://img.shields.io/github/last-commit/dizco/AzureDevOps.InnerSource) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://makeapullrequest.com)
22

33
# AzureDevOps.InnerSource :star2:
44

5-
Discoverability of [InnerSource](https://innersourcecommons.org/) repositories on Azure DevOps suffers from a few limitations compared to Github. For example, it is very difficult to find and to assess how mature a repository is. This template provides the following features:
6-
- Ability to generate an aggregation of all repositories
5+
Discoverability of [InnerSource](https://innersourcecommons.org/) repositories on Azure DevOps suffers from a few limitations compared to Github. For example, it is very difficult to find and to assess how mature a repository is. This project provides the following features:
6+
- Aggregated view of all repositories within a project
77
- Badge to display the last commit date in a repository
8-
- Ability to star any Azure DevOps repository within an organization and display the number of stars with a badge
8+
- Badge to display the main programming language used in a repository
9+
- Ability to "star" any Azure DevOps repository within an organization and display the number of stars with a badge
910

1011
## Demo
1112
![Demo screenshot](./docs/demo.jpg)
1213

1314
## How this works
14-
This works in 2 parts. First, an automated pipeline generates a table in the readme by scraping and aggregating all the available repositories periodically. Secondly, the server exposes API endpoints to interact with stars and badges. Upon clicking the star button, the user gets redirected to Azure AD for authentication, after which his _star_ is recorded in the database.
15+
This works in 2 parts. First, an Azure DevOps Extension adds some features in the Azure DevOps organization. Second, the extension communicates with the deployed server. Right now, there is no hosted server offered, you must deploy it yourself. Keep reading for more instructions.
1516

1617
## Getting started
17-
1. [Install .NET 7 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/7.0), if not already installed.
18-
1. Clone this repository
19-
```
20-
git clone https://github.com/dizco/AzureDevOps.InnerSource.git
21-
```
22-
1. In Azure AD, create a new `App registration`
23-
1. Set redirect URI `https://localhost:44400/signin-oidc`
24-
1. Set API Permissions `openid`, `profile` and `email`
25-
26-
![API permissions](./docs/api-permissions.jpg)
27-
28-
1. Create a client secret
29-
1. Take note of the tenant ID, client ID and client secret
30-
31-
1. Create a new Azure Storage Account
32-
1. Create a new Table `azuredevopsstars`
33-
34-
1. With Visual Studio, open the `AzureDevOps.InnerSource.sln`
35-
1. Update the `appsettings.json` and `appsettings.Local.json` files according to your needs.
36-
1. Run with Visual Studio by pressing F5 or with command line with:
37-
```shell
38-
dotnet run --project ./src/AzureDevOps.InnerSource/
39-
```
40-
1. Edit the readme of the desired repository with:
41-
```md
42-
[Star this repo!](https://localhost:44400/star?project=<project name>&repository=<repository name>)
43-
![Repository stars](https://localhost:44400/stars/<project name>/<repository name>)
44-
```
45-
Alternatively, you may add the button directely on the badge with:
46-
```md
47-
[![Repository stars](https://localhost:44400/stars/<project name>/<repository name>)](https://localhost:44400/star?project=<project name>&repository=<repository name>)
48-
```
18+
1. Install the [AzureDevOps InnerSource extension](https://marketplace.visualstudio.com/items?itemName=gabrielbourgault.azuredevops-innersource) from the Visual Studio Marketplace.
19+
1. [Activate the feature flag](https://learn.microsoft.com/en-us/azure/devops/project/navigation/preview-features?view=azure-devops#enable-features-at-the-organization-level) on the desired project
4920

50-
### Repository aggregation
21+
![feature flag](./docs/feature-flag.jpg)
22+
23+
1. Deploy the server, see [server readme](./server/README.md).
24+
1. Under the "Repos" hub group, you should now see a hub called "All repositories". Click on it.
25+
1. Click on the "Settings" button and set the server url (or navigate directly to `https://dev.azure.com/<your organization>/_settings/gabrielbourgault.azuredevops-innersource.extension-settings-hub`)
5126
1. Edit readmes of all repositories you wish to aggregate with:
5227
```html
5328
<p id="description">TODO: Give a short introduction of your project. Let this section explain the objectives or the motivation behind this project.</p>
5429
```
5530
```html
5631
<pre id="packageInstallation"><code>npm install --save potato</code></pre>
5732
```
58-
1. Run aggregation
59-
```shell
60-
dotnet run --project .\src\AzureDevOps.InnerSource\ aggregate --output-folder ./
61-
```
33+
1. Go back to the "All repositories" hub to view the aggregated repositories
34+
35+
### Extension
36+
37+
View the [extension readme](./extension/README.md).
6238

63-
## Deploying
64-
A working dockerfile is provided:
65-
```
66-
docker pull ghcr.io/dizco/azuredevops.innersource:latest
67-
```
39+
### Server
6840

69-
For further guidance on how to deploy this service, see [deployment guide](docs/deploy.md).
41+
View the [server readme](./server/README.md).
7042

7143
## Breaking changes
7244
At this time, there is no guarantee on the stability of this template. Breaking changes may occur at any time.
7345

7446
## Known issues
75-
- The code coverage is 0% right now
47+
- The code coverage is very low right now
7648
- There is a lot of boilerplate code for MVC that could be removed
77-
- Security has not been given a proper assessment
78-
- Especially, there are risks of leaking private repositories existence and last commit date. This risk could potentially be mitigated by the use of unique api tokens per repository, which could be added in the link to the badge and validated by the server
49+
- Security has been given some consideration, but would require further assessments
7950
- Concurrent requests are not properly handled, the total star count could be wrong if 2 requests are made in parallel
8051

8152
## Contibuting

docs/api-permissions.jpg

-15.9 KB
Binary file not shown.

docs/demo.jpg

23.3 KB
Loading

docs/feature-flag.jpg

21.6 KB
Loading

extension/README.md

Lines changed: 9 additions & 132 deletions
Original file line numberDiff line numberDiff line change
@@ -1,139 +1,16 @@
1-
# Azure DevOps Web Sample Extension
1+
[![Build Status](https://dev.azure.com/gabrielbourgault/Kiosoft/_apis/build/status%2Fdizco.AzureDevOps.InnerSource%20Extension?branchName=master)](https://dev.azure.com/gabrielbourgault/Kiosoft/_build/latest?definitionId=23&branchName=master)
22

3-
[![Build Status](https://dev.azure.com/ms/azure-devops-extension-sample/_apis/build/status/Microsoft.azure-devops-extension-sample)](https://dev.azure.com/ms/azure-devops-extension-sample/_build/latest?definitionId=14)
3+
# AzureDevOps.InnerSource :star2: - Extension
44

5-
This repository generates an [Azure DevOps extension](https://docs.microsoft.com/en-us/azure/devops/extend/overview?view=vsts) containing a number of different contributions of various types.
5+
The extension was started from this ReactJS sample: https://github.com/microsoft/azure-devops-extension-sample
66

7-
## Dependencies
7+
This sample is also interesting for hot reloading: https://github.com/microsoft/azure-devops-extension-hot-reload-and-debug
88

9-
The sample repository depends on a few Azure DevOps packages:
9+
Icon list: https://learn.microsoft.com/en-us/windows/apps/design/style/segoe-ui-symbol-font & https://uifabricicons.azurewebsites.net/
1010

11-
- [azure-devops-extension-sdk](https://github.com/Microsoft/azure-devops-extension-sdk): Required module for Azure DevOps extensions which allows communication between the host page and the extension iframe.
12-
- [azure-devops-extension-api](https://github.com/Microsoft/azure-devops-extension-api): Contains REST client libraries for the various Azure DevOps feature areas.
13-
- [azure-devops-ui](https://developer.microsoft.com/azure-devops): UI library containing the React components used in the Azure DevOps web UI.
11+
Extension manifest: https://learn.microsoft.com/en-us/azure/devops/extend/develop/manifest?view=azure-devops#scopes
1412

15-
Some external dependencies:
13+
Extensibility points (partial): https://learn.microsoft.com/en-us/azure/devops/extend/reference/targets/overview?view=azure-devops
1614

17-
- `React` - Is used to render the UI in the samples, and is a dependency of `azure-devops-ui`.
18-
- `TypeScript` - Samples are written in TypeScript and compiled to JavaScript
19-
- `SASS` - Extension samples are styled using SASS (which is compiled to CSS and delivered in webpack js bundles).
20-
- `webpack` - Is used to gather dependencies into a single javascript bundle for each sample.
21-
22-
## Building the sample project
23-
24-
Just run:
25-
26-
npm run build
27-
28-
This produces a .vsix file which can be uploaded to the [Visual Studio Marketplace](https://marketplace.visualstudio.com/azuredevops)
29-
30-
## Using the extension
31-
32-
The preferred way to get started is to use the `tfx extension init` command which will clone from this sample and prompt you for replacement information (like your publisher id). Just run:
33-
34-
npm install -g tfx-cli
35-
tfx extension init
36-
37-
You can also clone the sample project and change the `publisher` property in `azure-devops-extension.json` to your own Marketplace publisher id. Refer to the online [documentation](https://docs.microsoft.com/en-us/azure/devops/extend/publish/overview?view=vsts) for setting up your own publisher and publishing an extension.
38-
39-
# Samples
40-
41-
Individual sample contributions are self-contained folders under `./src/Samples`. Within each sample you will find:
42-
43-
1. `{SampleName}.json` - describes the contribution objects being added to Azure DevOps
44-
2. `{SampleName}.html` - page which is rendered within an iframe on the appropriate Azure DevOps page or pages. It may be visible UI (such as a Hub) or a background iframe (such as a Menu action handler). This will include a sample reference for `{SampleName}.js`, and for visible frames it will contain a single `<div>` element with an id of `root`.
45-
3. `{SampleName}.ts(x)` - Root script that is run when the frame is loaded. A webpack entry is added for this file which will generate a single `js` file with this content and all its dependencies.
46-
4. `{SampleName}.scss` - optional sass file containing the styles (CSS) for the UI
47-
5. Additional ts/tsx files - For samples that are too big for one file, the code will be broken up appropriately
48-
49-
## BreadcrumbService
50-
51-
This sample adds a breadcrumb service which adds a "Sample Breadcrumb Item" global breadcrumb item to the sample hub. Visit the "Sample Hub" in the `Pipelines` hub group to see this item.
52-
53-
## CodeEditorContribution
54-
55-
This sample adds a language definition and a JSON schema for the code editor.
56-
57-
To see the language definition in action, add a new file to git or TFVC called "sample.mylog", then copy the example log content from [the Monaco playground](https://microsoft.github.io/monaco-editor/playground.html#extending-language-services-custom-languages).
58-
59-
To see the JSON schema in action, add a new file to git or TFVC called "myconfig.json", then begin editing it.
60-
61-
## Feature
62-
63-
This sample shows how to hook into the Preview Features panel (under the user profile menu). It adds a simple hub that is only shown when an "ABC" feature is turned on. The feature can be toggled per-user or per-organization.
64-
65-
This also defines a second feature (ABC v2) which controls whether v1 or v2 of the ABC hub is used (when the ABC feature is turned on). When enabled, a "property-provider" contribution modifies the name and url of the hub contribution. Here we add a v2=true query parameter to our existing hub page, but you could also
66-
specify a completely different html page here. This feature shows off a bit more advanced functionality provided by preview features. It can be toggled per-user, per-project, or per-organization (the "null" hostScopeValue). It is on by default (defaultState: true). And it has an override rule which causes the v2 feature to be OFF (and disabled in the preview features panel) whenever the ABC feature is off.
67-
68-
## Hub
69-
70-
This sample adds a hub named "Sample Hub" into the `Pipelines` hub group. If you visit a project-level page, you will find Sample Hub under the `Pipelines` navigation element in the vertical navigation menu on the left of the page.
71-
72-
The hub uses a Pivot component to draw 4 different tabs:
73-
74-
1. An `Overview` tab contains some simple details about the current user and project
75-
2. A `Navigation` tab contains a few actions that allow you to integrate with the page's URL and title
76-
3. An `Extension Data` tab demonstrates reading and writing to the extension data service
77-
4. A `Messages` tab shows how to display global messages
78-
79-
There are also actions at the top-right of the hub which demonstrate opening dialogs and panels, including custom content within them (used in the `Panel` sample).
80-
81-
## Menu
82-
83-
This sample adds a "Sample build definition menu item" to the `Builds` hub in the dropdown actions menu in the top-right of the page. The menu handler gets the current build definition from the context that is passed to it, it makes a REST call, and shows the result in a message box.
84-
85-
## Panel
86-
87-
This sample is leveraged within the `Hub` sample. It is content that contains a toggle button along with OK/Cancel buttons. It can be used as custom panel or dialog content.
88-
89-
## Pivot
90-
91-
This sample adds a "Sample Pivot" pivot (tab) to the Organization (Project Collection) home page, next to "Projects", "My work items", and "My pull requests".
92-
93-
This pivot makes a REST call for all the projects in the organization and it displays them in a grid view.
94-
95-
## Pill
96-
97-
This sample adds pills to the title of the Pipeline definition (Runs) page.
98-
99-
## QueryParamsHandler
100-
101-
This sample adds a service that gets loaded on any page whenever a "showMyPanel" query parameter is present
102-
in the URL when any page is loaded. The startup service shows the custom panel from the Panel sample, using
103-
an optional "myPanelTitle" query parameter as the panel title.
104-
105-
## RepositoryActions
106-
107-
This sample adds a "Sample repository action" menu item to the repository picker in the header of code hub pages. If a "href" property is provided, clicking on the action will navigate to the given url. If a "uri" is provided, that code will be executed when the action is clicked.
108-
109-
## RepositoryServiceHub
110-
111-
This sample adds a "Repository Information" hub to the `Code` hub group. It demonstrates how to interact with the `IVersionControlRepositoryService` to obtain basic information about a user's currently selected Git repository.
112-
113-
## WorkItemFormGroup
114-
115-
This sample adds a "Sample WorkItem Form Group" extension to workitem form to show how to interact with the `IWorkItemFormService` service and `IWorkItemNotificationListener`. It gives UI to show case how to change field values using the form service and displaying workitem form notification events.
116-
117-
This sample also provides a unit testing example with minimal necessary mocks.
118-
119-
## WorkItemOpen
120-
121-
This sample adds a "Sample WorkItem Open" hub to the Boards hub group to show how to interact with the `IWorkItemFormNavigationService` service. It gives UI for you to open an existing work item (by id) or open the work item form for a new work item (by work item type). Either of these options open a dialog in the host frame.
122-
123-
# References
124-
125-
The full set of documentation for developing extensions can be found at [https://docs.microsoft.com/en-us/azure/devops/extend](https://docs.microsoft.com/en-us/azure/devops/extend/?view=vsts).
126-
127-
# Contributing
128-
129-
This project welcomes contributions and suggestions. Most contributions require you to agree to a
130-
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
131-
the rights to use your contribution. For details, visit <https://cla.microsoft.com>.
132-
133-
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide
134-
a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions
135-
provided by the bot. You will only need to do this once across all repos using our CLA.
136-
137-
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
138-
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
139-
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
15+
## Known issues
16+
- There is an issue with unit tests, that has the same symptoms as this: https://github.com/nrwl/nx/issues/812

extension/overview.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,13 @@
1-
# AzureDevOps.InnerSource
1+
# AzureDevOps.InnerSource :star2:
22

3+
Discoverability of [InnerSource](https://innersourcecommons.org/) repositories on Azure DevOps suffers from a few limitations compared to Github. For example, it is very difficult to find and to assess how mature a repository is. This project provides the following features:
4+
- Aggregated view of all repositories within a project
5+
- Badge to display the last commit date in a repository
6+
- Badge to display the main programming language used in a repository
7+
- Ability to "star" any Azure DevOps repository within an organization and display the number of stars with a badge
8+
9+
## Demo
10+
![Demo](https://github.com/dizco/AzureDevOps.InnerSource/raw/master/docs/demo.jpg)
11+
12+
## Getting started
13+
Consult the project readme on Github: https://github.com/dizco/AzureDevOps.InnerSource

0 commit comments

Comments
 (0)