Skip to content

Commit

Permalink
[repo] chore: #195 Repo management (#483)
Browse files Browse the repository at this point in the history
Fixes #195 
- Move PR template file out of folder
- Add .gitattributes 
- Add `pr-style.yml`, which adds normalization requirements to how PRs
are titled
- Add `DAILYBUILDS.md`, though we do not yet have daily builds set up.
- Update `CODEOWNERS.md` to automatically add appropriate reviewers
- Add a change log script to help create the changelog(s) for releases
- Update `CONTRIBUTING.md` with more information on requirements for
submitting a Pull Request.

Note: running `createChangelog.sh` creates a markdown looking like the
following:

![image](https://github.com/microsoft/teams-ai/assets/14900841/b33bd562-d460-45df-8277-ec8719d455d3)
(We will need to retroactively fix PR titles)

---------

Co-authored-by: Corina Gum <>
  • Loading branch information
corinagum authored Aug 28, 2023
1 parent 0d07d35 commit 52cb30d
Show file tree
Hide file tree
Showing 13 changed files with 347 additions and 53 deletions.
40 changes: 40 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Auto-detect text files, ensure they use LF.
* text=auto eol=lf working-tree-encoding=UTF-8

*.sln text eol=crlf
*.csproj text eol=crlf

# Declare files that will always have CRLF line endings on checkout.
*.sln text eol=crlf

# Denote all files that are truly binary and should not be modified.
*.png binary
*.jpg binary

# Bash scripts
*.sh text eol=lf

# Archives
*.7z filter=lfs diff=lfs merge=lfs -text
*.br filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.tar filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text

# Documents
*.pdf filter=lfs diff=lfs merge=lfs -text

# Images
*.gif filter=lfs diff=lfs merge=lfs -text
*.ico filter=lfs diff=lfs merge=lfs -text
*.jpg filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.psd filter=lfs diff=lfs merge=lfs -text
*.webp filter=lfs diff=lfs merge=lfs -text

# Fonts
*.woff2 filter=lfs diff=lfs merge=lfs -text

# Other
*.exe filter=lfs diff=lfs merge=lfs -text

7 changes: 6 additions & 1 deletion .github/CODEOWNERS.md
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
@stevenic @corinagum
@microsoft/teams-ai-admins @microsoft/teams-ai-devs

#TTK
teamsapp.yml @blackchaoyi @therealjohn @microsoft/teams-ai-devs
teamsapp.local.yml @blackchaoyi @therealjohn @microsoft/teams-ai-devs
/getting-started
39 changes: 0 additions & 39 deletions .github/PULL_REQUEST_TEMPLATE.MD/pull_request_template.md

This file was deleted.

32 changes: 32 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## Linked issues

Resolves: # (issue number)

## Details

Provide a list of your changes here. If you are fixing a bug, please provide steps to reproduce the bug.

#### Change details

> Describe your changes, with screenshots and code snippets as appropriate
**code snippets**:

**screenshots**:

## Attestation Checklist

- [ ] My code follows the style guidelines of this project

- I have checked for/fixed spelling, linting, and other errors
- I have commented my code for clarity
- I have made corresponding changes to the documentation (we use [TypeDoc](https://typedoc.org/) to document our code)
- My changes generate no new warnings
- I have added tests that validates my changes, and provides sufficient test coverage. I have tested with:
- Local testing
- E2E testing in Teams
- New and existing unit tests pass locally with my changes

### Additional information

> Feel free to add other relevant information below
19 changes: 19 additions & 0 deletions .github/workflows/pr-style.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: pr-style.yml

on:
pull_request:
types: [opened, edited, synchronize]

jobs:
prStyle:
name: pr-style
runs-on: ubuntu-latest

steps:
- uses: joshgummersall/pr-style@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
require_issue: "true"
skip_authors: "dependabot"
title_prefixes: " [repo] chore:, [repo] docs:, [repo] fix:, [JS] bump:, [JS] chore:, [JS] docs:, [JS] feat:, [JS] fix:, [JS] port:, [JS] refactor:, [C#] bump:, [C#] chore:, [C#] docs:, [C#] feat:, [C#] fix:, [C#] port:, [C#] refactor:, [PY] bump:, [PY] chore:, [PY] docs:, [PY] feat:, [PY] fix:, [PY] port:, [PY] refactor:"
20 changes: 19 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Instructions for Contributing Code

Please note that as of August 2023, signed commits are required for all contributions to this project. For more information on how to set up, see the [GitHub Authentication verify commit signature](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification) documentation.

## Contributing bug fixes and features

This project welcomes contributions and suggestions. Most contributions require you to agree to a
Expand All @@ -16,7 +18,7 @@ contact [[email protected]](mailto:[email protected]) with any additio

Microsoft Teams is currently accepting contributions in the form of bug fixes and new
features. Any submission must have an issue tracking it in the issue tracker that has
been approved by the Teams Collaboration team. Your pull request should include a link to
been approved by the Teams AI team. Your pull request should include a link to
the bug that you are fixing. If you've submitted a PR for a bug, please post a
comment in the bug to avoid duplication of effort.

Expand All @@ -33,3 +35,19 @@ agreement ([Microsoft Contribution License Agreement.docx](https://www.codeplex.
[Microsoft Contribution License Agreement.pdf](https://www.codeplex.com/Download?ProjectName=typescript&DownloadId=921298)), sign, scan,
and email it back to <[email protected]>. Be sure to include your github user name along with the agreement. Once we have received the
signed CLA, we'll review the request.

## PR styling requirements

1. All PRs must indicate what programming language they are for in the title with a prefix of [JS], [C#] [PY], or [repo].
1. All PRs must be prepended with one of the following keywords:
- _'bump:'_ - indicates a change to the version number of the package
- _'chore:'_ - indicates a change to the build process or auxiliary tools
- _'docs:'_ - indicates a change to the documentation
- _'feat:'_ - indicates a new feature
- _'fix:'_ - indicates a bug fix
- _'port:'_ - indicates a port of a feature from another language
- _'refactor:'_ - indicates a code change that neither fixes a bug nor adds a feature
1. All PRs must have an associated work item link in the title and the body of the PR.
- e.g. [JS] feat: #999 Add new feature

The purpose of this is to allow for easier filtering when creating changelogs and release notes.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# <image src="https://github.com/microsoft/teams-ai/assets/14900841/972a9a1b-679a-4725-bfc0-a1e76151a78a" height="10%" width="10%" /> Teams AI Library

Welcome to the Teams AI Library! This SDK is specifically designed to assist you in creating bots capable of interacting with Teams and Microsoft 365 applications. It is constructed using the [Bot Framework SDK](https://github.com/microsoft/botbuilder-js) as its foundation, simplifying the process of developing bots that interact with Teams' artificial intelligence capabilities.

<p>
Expand All @@ -11,8 +12,8 @@ The SDK is currently available for JavaScript/TypeScript applications in the <a

## Getting Started


> ### 🖇️ Jump right in❗️ 📎
> ### 🖇️ Jump right in❗️ 📎
>
> If you want to jump immediately into AI, try out the [04.ai.a.teamsChefbot](./js/samples/04.ai.a.teamsChefBot) sample. This sample is a simple bot that uses the OpenAI GPT model to build a Teams app. Just load it up in Visual Code and hit F5! 🎉
### Start with our getting started guides
Expand Down Expand Up @@ -85,3 +86,7 @@ trademarks or logos is subject to and must follow
[Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).
Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
Any use of third-party trademarks or logos are subject to those third-party's policies.

## Accessing daily builds

Please see [Daily Builds](docs/DAILYBUILDS.md) for instructions on how to access daily builds.
23 changes: 13 additions & 10 deletions SUPPORT.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
# TODO: The maintainer of this repo has not yet edited this file

**REPO OWNER**: Do you want Customer Service & Support (CSS) support for this product/project?

- **No CSS support:** Fill out this template with information about how to file issues and get help.
- **Yes CSS support:** Fill out an intake form at [aka.ms/onboardsupport](https://aka.ms/onboardsupport). CSS will work with/help you to determine next steps.
- **Not sure?** Fill out an intake as though the answer were "Yes". CSS will help you decide.

*Then remove this first heading from this SUPPORT.MD file before publishing your repo.*
_Then remove this first heading from this SUPPORT.MD file before publishing your repo._

# Support

## How to file issues and get help
## How to file issues and get help

This project uses GitHub Issues to track bugs and feature requests. Please search the existing
issues before filing new issues to avoid duplicates. For new issues, file your bug or
This project uses GitHub Issues to track bugs and feature requests. Please search the existing
issues before filing new issues to avoid duplicates. For new issues, file your bug or
feature request as a new Issue.

For help and questions about using this project, please **REPO MAINTAINER: INSERT INSTRUCTIONS HERE
FOR HOW TO ENGAGE REPO OWNERS OR COMMUNITY FOR HELP. COULD BE A STACK OVERFLOW TAG OR OTHER
CHANNEL. WHERE WILL YOU HELP PEOPLE?**.
For help and questions about using this project, please use the following resources:

- Get general implementation support in the [Discussions tab](https://github.com/microsoft/teams-ai/discussions/categories/q-a) of this repository
- Make feature requests with the [feature request template](https://github.com/microsoft/teams-ai/issues/new?assignees=&labels=enhancement%2C+new+submission&projects=&template=feature-request-template.md&title=%5BFeature+Request%5D%3A+%3Cinsert+title+here%3E)
- File new bugs using our [bugs template](https://github.com/microsoft/teams-ai/issues/new?assignees=&labels=bug%2C+new+submission&projects=&template=bug-report-template.md&title=%5BBug%5D%3A+%3Cinsert+title+here%3E)
- Report security issues by following our [security reporting process](https://github.com/microsoft/teams-ai/security/policy)

For internal support, please follow the directions on our [internal site](https://microsoft.sharepoint-df.com/teams/TeamsAI/SitePages/Getting-support.aspx).

## Microsoft Support Policy
## Microsoft Support Policy

Support for this **PROJECT or PRODUCT** is limited to the resources listed above.
26 changes: 26 additions & 0 deletions docs/DAILYBUILDS.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Consuming daily builds of the SDK

Daily builds are not yet available.

<!-- ## Using npm
Daily packages for the Bot Framework SDK for JS are published to [`npm`](https://www.npmjs.com/) and can be installed by using the `next` tag.
```bash
npm i @microsoft/team-ai@next
```
## Using MyGet
The Microsoft Bot Framework team maintains a [MyGet Gallery](https://botbuilder.myget.org) which contains feeds for the various SDK languages and other team projects. For JavaScript development, use the [JS daily build feed](https://botbuilder.myget.org/gallery/botbuilder-v4-js-daily).
To consume the latest daily builds of the Bot Framework SDK via MyGet, you'll need to configure `npm` to use the MyGet feed before installing.
### Configure npm registry
Use the following command to set the npm registry to access the MyGet feed.
- npm config set registry https://botbuilder.myget.org/F/botbuilder-v4-js-daily/npm/
To reset the registry in order to get the latest published version, run:
- npm config set registry https://registry.npmjs.org/
-->
1 change: 1 addition & 0 deletions tools/changelog/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
changelog.txt
87 changes: 87 additions & 0 deletions tools/changelog/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

const { createReadStream, createWriteStream, existsSync } = require('fs');
const { once } = require('events');
const { join } = require('path');
const { argv, exit } = require('process');
const { createInterface } = require('readline');

// Remove first two elements from argv, which are `node` and `script.js`.
// Currently the script takes two arguments, which are assigned to
// gitLogFromRepo and optionalOutputName.
const [ gitLogFromRepo, optionalOutputName ] = argv.slice(2);

if (!gitLogFromRepo) {
throw new TypeError('The captured output of `git log` must be passed in.');
}

if (!existsSync(join(__dirname, gitLogFromRepo))) {
throw new ReferenceError(`The provided file "${gitLogFromRepo}" was not found in ${__dirname}`);
}

// Determine the changelogFile (which contains the formatted merges to main)
// and the repository URL.
let changelogFile;
let repository;
if (gitLogFromRepo.startsWith('dotnet')) {
changelogFile = optionalOutputName || 'dotnet.md';
repository = 'botbuilder-dotnet';
} else if (gitLogFromRepo.startsWith('js')) {
changelogFile = optionalOutputName || 'js.md';
repository = 'botbuilder-js';
} else if (gitLogFromRepo.startsWith('python')) {
changelogFile = optionalOutputName || 'python.md';
repository = 'botbuilder-python';
} else if (gitLogFromRepo.startsWith('java')) {
changelogFile = optionalOutputName || 'java.md';
repository = 'botbuilder-java';
} else if (gitLogFromRepo.startsWith('bf-cli')) {
changelogFile = optionalOutputName || 'bf-cli.md';
repository = 'botframework-cli';
}

// git log --show-pulls --pretty=tformat:"%s" --since=2020-08-13 > dotnet.txt
// git log --show-pulls --pretty=tformat:"%s" --since=2020-08-07 > js.txt
// git log --show-pulls --pretty=tformat:"%s" --since=2020-08-10 > python.txt
// git log --show-pulls --pretty=tformat:"%s" --since=2020-08-17 > java.txt
// git log --show-pulls --pretty=tformat:"%s" --since=2020-08-10 > bf-cli.txt

const preparedStream = createWriteStream(changelogFile);
(async function processLineByLine() {
try {
const rl = createInterface({
input: createReadStream(gitLogFromRepo),
crlfDelay: Infinity
});

rl.on('line', (line) => {
// Check for squash merges first. This generates a bulletpoint that
// by default uses the title of the PR and appends the PR number to
// the end of the commit message.
// E.g. "Fix fetch in token server used in E2E Streaming Test (#2944)"
const matches = /(?<message>.*)\s\(#(?<num>\d*)\)$/gim.exec(line);
if (matches) {
const { message, num } = matches.groups;
preparedStream.write(`- ${message} [[PR ${num}]](https://github.com/microsoft/${repository}/pull/${num})\n`);
} else {
// This second check is for PRs that were not squashed and merged.
// E.g. "Merge pull request #1411 from <fork/branch>"
const otherFormatMatches = /^(?<message>Merge pull request #(?<num>\d*) from.*)/gim.exec(line);
if (otherFormatMatches) {
const { message, num } = otherFormatMatches.groups;
preparedStream.write(`- ${message} [[PR ${num}]](https://github.com/microsoft/${repository}/pull/${num})\n`)
}
}
});

await once(rl, 'close');
console.log(`Changelog "${changelogFile}" created.`);
} catch (err) {
const errMsgPrefix = `An error occurred during the creation of the changelog.
Please file an issue in https://github.com/microsoft/botframework-sdk and provide the necessary reproduction steps.\n`
console.error(errMsgPrefix);
console.error(err);
exit(1);
}
})();
3 changes: 3 additions & 0 deletions tools/changelog/createChangelog.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# NOTE: update the --since date to the date of the last release.
git log --show-pulls --pretty=tformat:"%s" --since=2023-08-13 > changelog.txt | node gitlog.js changelog.txt
rm changelog.txt
Loading

0 comments on commit 52cb30d

Please sign in to comment.