-
Notifications
You must be signed in to change notification settings - Fork 106
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
Conversation
@@ -34,7 +34,28 @@ const container = await host.container() | |||
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" }) |
There was a problem hiding this comment.
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
The pull request covers the following changes:
It seems like a good effort has been made to improve the way the shell commands are handled to be more robust and flexible. The addition of the API key authentication adds an extra layer of security to the server. However, there are potential concerns:
Here are some suggested changes: - ws.close(401, "Unauthorized")
+ ws.close(401, "Unauthorized: Invalid API Key provided.")
Other than these concerns, the code changes look good. LGTM 🚀
|
…arch-and-transform.genai.mts
…ipt configuration
"--abbrev=0", | ||
"HEAD^", | ||
]) | ||
const { stdout: tag } = await host.exec("git describe --tags --abbrev=0 HEAD^") |
There was a problem hiding this comment.
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
"--no-merges", | ||
`HEAD...${tag}`, | ||
]) | ||
const { stdout: commits } = await host.exec(`git log --grep='skip ci' --invert-grep --no-merges HEAD...${tag}`) |
There was a problem hiding this comment.
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
":!*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'`) |
There was a problem hiding this comment.
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
|
||
const { stdout: commits } = await host.exec(`git log HEAD...${tag}`) | ||
|
||
const { stdout: diff } = await host.exec(`git diff ${tag}..HEAD`) |
There was a problem hiding this comment.
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
@@ -34,7 +34,28 @@ const container = await host.container() | |||
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" }) |
There was a problem hiding this comment.
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
const dir = "." | ||
await host.exec( | ||
`docker build -t ${repo} https://github.com/${repo}.git#${branch}:${dir}` | ||
) |
There was a problem hiding this comment.
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, ... }) |
There was a problem hiding this comment.
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
This pull request includes updates to dependencies, such as the zx package, and adds API key support for server authentication in CLI commands and server logic. It also enhances code execution by simplifying the logic and adjusting array checking. Additionally, it includes instructions for building custom Docker images and improves error handling in the WebSocket server.
package.json
files, most notably the upgrade of@astrojs/starlight
from0.27.0
to0.28.1
, and theastro
package from4.15.4
to4.15.7
for improved functionality and compatibility. 🚀genaiscript
: Tweaks were made togenaiscript
files likeoptillm.genai.mts
,gcm.genai.mts
, and some others, mainly adjusting how different commands are called, and updates in authentication processes.DockerManager
: TheDockerManager
class received a revamp in how it handles command executions with the introduction of a newexec
function and other associated changes.shell.ts
file was introduced to handle shell related operations, leading to a removal of thequoteify
function. Furthermore, changes were made to how commands are executed and handled in thecli
,nodehost
, andTaskProvider
classes. 🔄exec()
function now supported a new command format - where instead of a string representing the command and an array of string arguments, it could take in a complete command line as a string and an options object. This change was reflected directly in the public API. 💡