Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sample app #1

Merged
merged 4 commits into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**/node_modules
**/bin
**/obj
627 changes: 627 additions & 0 deletions .editorconfig

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Auto-detect text files, ensure they use LF.
* text=auto eol=lf working-tree-encoding=UTF-8

# Bash scripts
*.sh text eol=lf
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@microsoft/hls-codepilots
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Platform**
- OS: [e.g. Windows, Mac]
- IDE: [e.g. Visual Studio, VS Code]
- Language: [e.g. C#, Python]
- Source: [e.g. NuGet package version 0.1.0, pip package version 0.1.0, main branch of repository]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

---
name: Feature request
about: Suggest an idea for this project

---

<!-- ⚠️⚠️ Do Not Delete This! feature_request_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- Please search existing issues to avoid creating duplicates. -->

<!-- Describe the feature you'd like. -->
34 changes: 34 additions & 0 deletions .github/_typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Typos configuration file
#
# Info: https://github.com/marketplace/actions/typos-action
# Install: brew install typos-cli
# Install: conda install typos
# Run: typos -c .github/_typos.toml

[files]
extend-exclude = [
"_typos.toml",
"package-lock.json",
"*.bicep",
"encoder.json",
"vocab.bpe",
"GPT3TokenizerTests.cs",
"CodeTokenizerTests.cs",
"test_code_tokenizer.py",
]

[default.extend-words]
ACI = "ACI" # Azure Container Instance

[default.extend-identifiers]
ags = "ags" # Azure Graph Service

[type.jupyter]
extend-ignore-re = [
'"[A-Fa-f0-9]{8}"', # cell id strings
]

[type.msbuild]
extend-ignore-re = [
'Version=".*"', # ignore package version numbers
]
29 changes: 29 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
# Maintain dependencies for nuget
- package-ecosystem: "nuget"
directory: "webapi"
schedule:
interval: "weekly"
day: "monday"

# Maintain dependencies for npm
- package-ecosystem: "npm"
directory: "webapp"
schedule:
interval: "weekly"
day: "monday"

# Maintain dependencies for github-actions
- package-ecosystem: "github-actions"
# Workflow files stored in the
# default location of `.github/workflows`
directory: "/"
schedule:
interval: "weekly"
day: "monday"
29 changes: 29 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Add 'webapp' label to any change within the 'webapp' directory
webapp:
- changed-files:
- any-glob-to-any-file: ["webapp/**"]

# Add 'webapi' label to any change within the 'webapi' directory
webapi:
- changed-files:
- any-glob-to-any-file: ["webapi/**"]

# Add 'dependencies' label to any change of the 'webapp/yarn.lock' file
dependencies:
- changed-files:
- any-glob-to-any-file: ["webapp/yarn.lock"]

# Add 'deployment' label to any change within the 'deploy' directory
deployment:
- changed-files:
- any-glob-to-any-file: ["scripts/deploy/**"]

# Add 'documentation' label to any change of '.md' files
documentation:
- changed-files:
- any-glob-to-any-file: ["**/*.md"]

# Add 'github actions' label to any change within the '.github/workflows' directory
"github actions":
- changed-files:
- any-glob-to-any-file: [".github/workflows/**"]
23 changes: 23 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
### Motivation and Context

<!-- Thank you for your contribution to the chat-copilot repo!
Please help reviewers and future users, providing the following information:
1. Why is this change required?
2. What problem does it solve?
3. What scenario does it contribute to?
4. If it fixes an open issue, please link to the issue here.
-->

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [ ] The code builds clean without any errors or warnings
- [ ] The PR follows the [Contribution Guidelines](https://github.com/microsoft/chat-copilot/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/chat-copilot/blob/main/CONTRIBUTING.md#development-scripts) raises no violations
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone :smile:
65 changes: 65 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# CodeQL is the code analysis engine developed by GitHub to automate security checks.
# The results are shown as code scanning alerts in GitHub. For more details, visit:
# https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/about-code-scanning-with-codeql

name: "CodeQL"

on:
push:
branches: ["main", "experimental*", "feature*"]
schedule:
- cron: "17 11 * * 2"

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: ["csharp", "javascript"]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Use only 'java' to analyze code written in Java, Kotlin or both
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
70 changes: 70 additions & 0 deletions .github/workflows/copilot-build-backend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: copilot-build-backend

on:
workflow_dispatch:
pull_request:
branches: ["main"]
paths:
- "webapi/**"
workflow_call:
outputs:
artifact:
description: "The name of the uploaded web api artifact."
value: ${{jobs.webapi.outputs.artifact}}

permissions:
contents: read

jobs:
webapi:
strategy:
fail-fast: false
matrix:
include:
- { dotnet: "6.0", configuration: Release, os: windows-latest }

runs-on: ${{ matrix.os }}

env:
NUGET_CERT_REVOCATION_MODE: offline

outputs:
artifact: ${{steps.artifactoutput.outputs.artifactname}}

steps:
- uses: actions/checkout@v4
with:
clean: true
fetch-depth: 0

- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v1
with:
versionSpec: "5.x"

- name: Determine version
id: gitversion
uses: gittools/actions/gitversion/execute@v1

- name: Set version tag
id: versiontag
run: |
$VERSION_TAG = "${{ steps.gitversion.outputs.Major }}."
$VERSION_TAG += "${{ steps.gitversion.outputs.Minor }}."
$VERSION_TAG += "${{ steps.gitversion.outputs.CommitsSinceVersionSource }}"
echo $VERSION_TAG
Write-Output "versiontag=$VERSION_TAG" >> $env:GITHUB_OUTPUT

- name: Package Copilot Chat WebAPI
run: |
scripts\deploy\package-webapi.ps1 -Configuration Release -DotnetFramework net6.0 -TargetRuntime win-x64 -OutputDirectory ${{ github.workspace }}\scripts\deploy -Version ${{ steps.versiontag.outputs.versiontag }} -InformationalVersion "Built from commit ${{ steps.gitversion.outputs.ShortSha }} on $(Get-Date -Format 'yyyy-MM-dd')" -SkipFrontendFiles ('${{ github.event_name == 'pull_request' }}' -eq 'true')

- name: Upload package to artifacts
uses: actions/upload-artifact@v4
with:
name: copilotchat-webapi-${{ steps.versiontag.outputs.versiontag }}
path: ${{ github.workspace }}\scripts\deploy\out\webapi.zip

- name: "Set outputs"
id: artifactoutput
run: Write-Output "artifactname=copilotchat-webapi-${{ steps.versiontag.outputs.versiontag }}" >> $env:GITHUB_OUTPUT
35 changes: 35 additions & 0 deletions .github/workflows/copilot-build-frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: copilot-build-frontend

on:
workflow_dispatch:
pull_request:
branches: ["main"]
paths:
- "webapp/**"

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
webapp:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Use Node.js 18
uses: actions/setup-node@v4
with:
node-version: 18
cache: "yarn"
cache-dependency-path: "webapp/yarn.lock"

- name: Run yarn install, yarn build, & yarn format
run: |
#!/usr/bin/env bash
set -e # exit with nonzero exit code if anything fails
echo "Running yarn install, yarn build, & yarn format"
yarn install --frozen-lockfile # install dependencies and ensure lockfile is unchanged.
yarn build # run build script
yarn format # run format script
working-directory: webapp
Loading
Loading