Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Kontent-ai-Learn/kontent-ai-learn-github-reader

Repository files navigation

master develop
master develop

Kontent.ai Learn - GitHub Reader

Backend service for Kontent.ai Learn.

Together with Samples Manager, this service is responsible for maintaining Kontent.ai content items that represent code samples used in Kontent.ai documentation portal.

Github Reader responds to commits made to the kontent-docs-samples repository, which contains all the code samples that are used by the documentation portal.

Overview

  1. This project is a C# Azure Functions application.
  2. It receives a webhook with names of changed files after each commit to GitHub repository.
  3. After receiving a webhook, the service fetches content of each file from GitHub, extracts the marked code samples and stores them in its own local storage.
  4. Finally, it stores the code samples in the Azure Blob Storage, where the Samples Manager can access them.

Setup

Prerequisites

  1. Visual Studio 2017 with Azure Functions and Web Jobs Tools installed
  2. Subscriptions on MS Azure and GitHub

Instructions

  1. Clone the project repository and open it in Visual Studio.
  2. Install all the necessary nugget packages.
  3. Set the required keys.
  4. Run the service locally in Visual Studio, or
  5. Deploy the service to a new Azure Functions App instance in your Azure subscription.

Required Keys

  • Github.AccessToken - GitHub account personal access token
  • Github.RepositoryName - Name of GitHub repository with code samples
  • Github.RepositoryOwner - Owner of GitHub repository with code samples
  • Repository.ConnectionString - Connection string for the Azure Storage account

Testing

Unit tests are located in GithubService.Services.Tests folder.

How To Contribute

Feel free to open a new issue where you describe your proposed changes, or even create a new pull request from your branch with proposed changes.

License

All the source codes are published under MIT license.