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

Update dependencies, add API key support, and enhance code execution #716

Merged
merged 11 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"Automatable",
"bitindex",
"cmds",
"codelion",
"Codespaces",
"compactable",
"demux",
Expand Down
60 changes: 30 additions & 30 deletions THIRD_PARTY_LICENSES.md
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,7 @@ The following npm packages may be included in this product:
- @types/[email protected]
- @types/[email protected]
- @types/[email protected]
- @types/[email protected].4
- @types/[email protected].5
- @types/[email protected]
- @types/[email protected]

Expand Down Expand Up @@ -1099,7 +1099,7 @@ MIT License

The following npm package may be included in this product:

- [email protected].5
- [email protected].8

This package contains the following license and notice below:

Expand Down Expand Up @@ -2814,20 +2814,20 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

The following npm packages may be included in this product:

- @inquirer/checkbox@2.5.0
- @inquirer/confirm@3.2.0
- @inquirer/core@9.1.0
- @inquirer/editor@2.2.0
- @inquirer/expand@2.3.0
- @inquirer/[email protected].5
- @inquirer/input@2.3.0
- @inquirer/number@1.1.0
- @inquirer/password@2.2.0
- @inquirer/prompts@5.5.0
- @inquirer/rawlist@2.3.0
- @inquirer/search@1.1.0
- @inquirer/select@2.5.0
- @inquirer/type@1.5.3
- @inquirer/checkbox@3.0.1
- @inquirer/confirm@4.0.1
- @inquirer/core@9.2.1
- @inquirer/editor@3.0.1
- @inquirer/[email protected].1
- @inquirer/[email protected].6
- @inquirer/[email protected].1
- @inquirer/number@2.0.1
- @inquirer/password@3.0.1
- @inquirer/prompts@6.0.1
- @inquirer/[email protected].1
- @inquirer/search@2.0.1
- @inquirer/select@3.0.1
- @inquirer/type@2.0.0

These packages each contain the following license and notice below:

Expand Down Expand Up @@ -3347,7 +3347,7 @@ http://github.com/mscdex/buildcheck/raw/master/LICENSE

The following npm package may be included in this product:

- ssh2@1.15.0
- ssh2@1.16.0

This package contains the following license and notice below:

Expand Down Expand Up @@ -4188,9 +4188,9 @@ The following npm packages may be included in this product:
- @tokenizer/[email protected]
- [email protected]
- [email protected]
- [email protected].5
- [email protected].5
- [email protected].5
- [email protected].8
- [email protected].8
- [email protected].8
- [email protected]
- [email protected]
- [email protected]
Expand Down Expand Up @@ -4781,7 +4781,7 @@ SOFTWARE.

The following npm package may be included in this product:

- [email protected].2
- [email protected].3

This package contains the following license and notice below:

Expand Down Expand Up @@ -4871,7 +4871,7 @@ SOFTWARE.

The following npm package may be included in this product:

- [email protected].1
- [email protected].3

This package contains the following license and notice below:

Expand Down Expand Up @@ -5124,10 +5124,9 @@ The following npm packages may be included in this product:
- @sindresorhus/[email protected]
- @sindresorhus/[email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- execa@9.3.1
- execa@9.4.0
- [email protected]
- [email protected]
- [email protected]
Expand All @@ -5143,7 +5142,7 @@ The following npm packages may be included in this product:
- [email protected]
- [email protected]
- [email protected]
- npm-run-path@5.3.0
- npm-run-path@6.0.0
- [email protected]
- [email protected]
- [email protected]
Expand All @@ -5154,6 +5153,7 @@ The following npm packages may be included in this product:
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
Expand Down Expand Up @@ -5479,8 +5479,8 @@ IN THE SOFTWARE.

The following npm packages may be included in this product:

- [email protected].0
- [email protected].0
- [email protected].1
- [email protected].1

These packages each contain the following license and notice below:

Expand Down Expand Up @@ -6854,11 +6854,11 @@ The following npm packages may be included in this product:

- @azure/[email protected]
- @azure/[email protected]
- @azure/core-auth@1.7.2
- @azure/core-auth@1.8.0
- @azure/[email protected]
- @azure/core-rest-pipeline@1.16.3
- @azure/core-rest-pipeline@1.17.0
- @azure/[email protected]
- @azure/core-util@1.9.2
- @azure/core-util@1.10.0
- @azure/[email protected]
- @azure/[email protected]

Expand Down
1 change: 1 addition & 0 deletions docs/genaisrc/genaiscript.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
},
"dependencies": {
"@astrojs/check": "^0.9.3",
"@astrojs/starlight": "^0.27.0",
"astro": "^4.15.4",
"@astrojs/starlight": "^0.28.1",
"astro": "^4.15.7",
"typescript": "5.6.2"
},
"devDependencies": {
"starlight-blog": "^0.12.0",
"zx": "^8.1.5"
"zx": "^8.1.7"
}
}
45 changes: 11 additions & 34 deletions docs/src/content/docs/blog/creating-release-notes-with-genai.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@
title: Creating Release Notes with GenAI
date: 2024-08-26
tags:
- release notes
- automation
- scripting
- software development
- AI
- release notes
- automation
- scripting
- software development
- AI
pelikhan marked this conversation as resolved.
Show resolved Hide resolved
authors: genaiscript
canonical_url: https://microsoft.github.io/genaiscript/blog/creating-release-notes-with-genai
description: Learn how to automate the creation of engaging software release
notes using GenAI and GenAIScript.

notes using GenAI and GenAIScript.
pelikhan marked this conversation as resolved.
Show resolved Hide resolved
pelikhan marked this conversation as resolved.
Show resolved Hide resolved
---

## Automating Your Release Notes with GenAI
Expand Down Expand Up @@ -51,47 +50,25 @@
```javascript
const pkg = await workspace.readJSON("package.json")
const { version } = pkg
const { stdout: tag } = await host.exec("git", [
"describe",
"--tags",
"--abbrev=0",
"HEAD^",
])
const { stdout: tag } = await host.exec("git describe --tags --abbrev=0 HEAD^")

Check failure on line 53 in docs/src/content/docs/blog/creating-release-notes-with-genai.md

View workflow job for this annotation

GitHub Actions / build

Incorrect syntax for host.exec, should use array format for arguments instead of template literal.
pelikhan marked this conversation as resolved.
Show resolved Hide resolved
pelikhan marked this conversation as resolved.
Show resolved Hide resolved

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inline code should be enclosed within backticks, not a code block.

generated by pr-docs-review-commit code_fence

```

We are reading the current version from `package.json` and using Git to find the previous release tag in the repository.

#### Step 4: Gathering Commits

```javascript
const { stdout: commits } = await host.exec("git", [
"log",
"--grep='skip ci'",
"--invert-grep",
"--no-merges",
`HEAD...${tag}`,
])
const { stdout: commits } = await host.exec(`git log --grep='skip ci' --invert-grep --no-merges HEAD...${tag}`)

Check failure on line 61 in docs/src/content/docs/blog/creating-release-notes-with-genai.md

View workflow job for this annotation

GitHub Actions / build

Incorrect syntax for host.exec, should use array format for arguments instead of template literal.
pelikhan marked this conversation as resolved.
Show resolved Hide resolved

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inline code should be enclosed within backticks, not a code block.

generated by pr-docs-review-commit code_fence


```

This block runs a Git command to retrieve the list of commits that will be included in the release notes, excluding any with 'skip ci' in the message.

#### Step 5: Obtaining the Diff

```javascript
const { stdout: diff } = await host.exec("git", [
"diff",
`${tag}..HEAD`,
"--no-merges",
"--",
":!**/package.json",
":!**/genaiscript.d.ts",
":!**/jsconfig.json",
":!docs/**",
":!.github/*",
":!.vscode/*",
":!*yarn.lock",
":!*THIRD_PARTY_NOTICES.md",
])
const { stdout: diff } = await host.exec(`git diff ${tag}..HEAD --no-merges -- ':!**/package.json' ':!**/genaiscript.d.ts' ':!**/jsconfig.json' ':!docs/**' ':!.github/*' ':!.vscode/*' ':!*yarn.lock' ':!*THIRD_PARTY_NOTICES.md'`)

Check failure on line 70 in docs/src/content/docs/blog/creating-release-notes-with-genai.md

View workflow job for this annotation

GitHub Actions / build

Incorrect syntax for host.exec, should use array format for arguments instead of template literal.
pelikhan marked this conversation as resolved.
Show resolved Hide resolved

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inline code should be enclosed within backticks, not a code block.

generated by pr-docs-review-commit code_fence


```

Next, we get the diff of changes since the last release, excluding certain files and directories that aren't relevant to the user-facing release notes.
Expand Down
9 changes: 6 additions & 3 deletions docs/src/content/docs/case-studies/release-notes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,12 @@
(This magic was mostly found using a GitHub Copilot Chat session).

```js title="git-release-notes.genai.mjs" wrap
const { stdout: tag } = await host.exec("git", ["describe", "--tags", "--abbrev=0", "HEAD^",])
const { stdout: commits } = await host.exec("git", ["log", `HEAD...${tag}`,])
const { stdout: diff } = await host.exec("git", ["diff", `${tag}..HEAD`,])
const { stdout: tag } = await host.exec(`git describe --tags --abbrev=0 HEAD^`)

Check failure on line 39 in docs/src/content/docs/case-studies/release-notes.mdx

View workflow job for this annotation

GitHub Actions / build

Incorrect syntax for host.exec, should use array format for arguments instead of template literal.
pelikhan marked this conversation as resolved.
Show resolved Hide resolved

const { stdout: commits } = await host.exec(`git log HEAD...${tag}`)

Check failure on line 41 in docs/src/content/docs/case-studies/release-notes.mdx

View workflow job for this annotation

GitHub Actions / build

Incorrect syntax for host.exec, should use array format for arguments instead of template literal.
pelikhan marked this conversation as resolved.
Show resolved Hide resolved

const { stdout: diff } = await host.exec(`git diff ${tag}..HEAD`)

Check failure on line 43 in docs/src/content/docs/case-studies/release-notes.mdx

View workflow job for this annotation

GitHub Actions / build

Incorrect syntax for host.exec, should use array format for arguments instead of template literal.
pelikhan marked this conversation as resolved.
Show resolved Hide resolved

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inline code should be enclosed within backticks, not a code block.

generated by pr-docs-review-commit code_fence


```

We use the `def` function with `maxTokens` to inline this information without exceeding the content window
Expand Down
5 changes: 3 additions & 2 deletions docs/src/content/docs/reference/cli/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,9 @@
Start a GenAIScript local server

Options:
-p, --port <number> Specify the port number, default: 8003
-h, --help display help for command
-p, --port <number> Specify the port number, default: 8003
-k, --api-key <string> API key to authenticate requests

Check failure on line 287 in docs/src/content/docs/reference/cli/commands.md

View workflow job for this annotation

GitHub Actions / build

Missing description for the '--api-key' option.
pelikhan marked this conversation as resolved.
Show resolved Hide resolved
pelikhan marked this conversation as resolved.
Show resolved Hide resolved
pelikhan marked this conversation as resolved.
Show resolved Hide resolved
pelikhan marked this conversation as resolved.
Show resolved Hide resolved
-h, --help display help for command
```

## `parse`
Expand Down
23 changes: 22 additions & 1 deletion docs/src/content/docs/reference/scripts/container.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,28 @@
By default, the container uses the [python:alpine](https://hub.docker.com/_/python/) image, which provides a minimal python environment. You can change the image using the `image` option.

```js 'image: "python:3"'
const container = await host.container({ image: "python:3" })
const container = await host.container({ image: "node:20" })

Check failure on line 37 in docs/src/content/docs/reference/scripts/container.md

View workflow job for this annotation

GitHub Actions / build

Incorrect Docker image, should be 'python:3' as per the context provided.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The image option in the container instantiation should be consistent with the default mentioned in the text.

generated by pr-docs-review-commit image_inconsistency

pelikhan marked this conversation as resolved.
Show resolved Hide resolved

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example should use the same image as the description, which is 'python:3', not 'node:20'.

generated by pr-docs-review-commit image_example

```

### Building images

Use [docker build](https://docs.docker.com/build/) to create reusable images.

You can build a custom image from a GitHub repository with a single command in your scripts.

```js
const repo = "codelion/optillm" // GitHub repository = image name
const branch = "main"
const dir = "."
await host.exec(
`docker build -t ${repo} https://github.com/${repo}.git#${branch}:${dir}`

Check failure on line 51 in docs/src/content/docs/reference/scripts/container.md

View workflow job for this annotation

GitHub Actions / build

Incorrect syntax for host.exec, should use array format for arguments instead of template literal.
)
pelikhan marked this conversation as resolved.
Show resolved Hide resolved
pelikhan marked this conversation as resolved.
Show resolved Hide resolved
pelikhan marked this conversation as resolved.
Show resolved Hide resolved

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Direct execution of build commands in documentation should be replaced with a more generic description or wrapped in a code block without direct execution instructions.

generated by pr-docs-review-commit code_execution

```

then use repo as your image name

```js
const container = await host.container({ image: repo, ... })
pelikhan marked this conversation as resolved.
Show resolved Hide resolved
pelikhan marked this conversation as resolved.
Show resolved Hide resolved

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable 'repo' is used without being defined in the current context. It should be defined or the example should be adjusted to avoid confusion.

generated by pr-docs-review-commit variable_usage

```

### Disable auto-purge
Expand Down
Loading
Loading