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

(NOT A BUG) Testing the BOT action #51

Open
guymguym opened this issue Jun 1, 2022 · 16 comments
Open

(NOT A BUG) Testing the BOT action #51

guymguym opened this issue Jun 1, 2022 · 16 comments
Labels
wontfix This will not be worked on

Comments

@guymguym
Copy link
Contributor

guymguym commented Jun 1, 2022

First thing to try -

/copilot-ops --help

@github-actions
Copy link

github-actions bot commented Jun 1, 2022

/home/runner/work/_temp/b1103392-ce6c-47f2-8822-27ca1435c4a2.sh: line 7: ./copilot-ops: No such file or directory

@guymguym
Copy link
Contributor Author

guymguym commented Jun 1, 2022

Lets try once again:

/copilot-ops --help

@github-actions
Copy link

github-actions bot commented Jun 1, 2022

Error: unknown flag: --help

@guymguym
Copy link
Contributor Author

guymguym commented Jun 3, 2022

Try again:

/copilot-ops --help

@github-actions
Copy link

github-actions bot commented Jun 3, 2022

exec: ["/copilot-ops","--help"]

stdout:

copilot-ops is a workflow automation tool that proposes an intelligent patches on a repo,
	  using natural language AI engines (openai.com codex bring-your-own-token),
	  and can be used to implement github bots, editor extensions, and more.

Usage:
  copilot-ops [command]

Examples:
  copilot-ops generate --help

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  edit        Edits a single file provided to the CLI
  generate    Proposes a new files to the repo
  help        Help about any command

Flags:
  -h, --help   help for copilot-ops

Use "copilot-ops [command] --help" for more information about a command.

stderr:


@guymguym
Copy link
Contributor Author

guymguym commented Jun 3, 2022

Ok lets try something:

/copilot-ops generate -r "create a PVC with 1 GB for a mysql deployment"

@github-actions
Copy link

github-actions bot commented Jun 3, 2022

exec: ["/copilot-ops","generate","-r","create a PVC with 1 GB for a mysql deployment"]

error:

Error: The process '/home/runner/work/copilot-ops/copilot-ops/copilot-ops' failed with exit code 1
    at ExecState._setResult (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:3471:25)
    at ExecState.CheckComplete (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:3454:18)
    at ChildProcess.<anonymous> (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:3348:27)
    at ChildProcess.emit (node:events:390:28)
    at maybeClose (node:internal/child_process:1064:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)

@guymguym
Copy link
Contributor Author

guymguym commented Jun 4, 2022

/copilot-ops generate --help

@github-actions
Copy link

github-actions bot commented Jun 4, 2022

exec: ["/copilot-ops","generate","--help"]

stdout:

Generate takes a request in natural language, packs the related files from the repo, calls AI engine to suggest generating new code based on the request, and optionally applies the suggested changes to the repo.

Usage:
  copilot-ops generate [flags]

Examples:
  copilot-ops generate --file examples/app1/mysql-pvc.yaml --request 'Generate a pod that mounts the PVC. Set the pod resources requests and limits to 4 cpus and 5 Gig of memory.'

Flags:
  -f, --file stringArray      File paths (glob) to be considered for the patch (can be specified multiple times)
  -s, --fileset stringArray   Fileset names (defined in .copilot-ops.yaml) to be considered for the patch (can be specified multiple times)
  -h, --help                  help for generate
  -n, --ntokens int32         Max number of tokens to generate (default 512)
  -p, --path string           Path to the root of the repo (default ".")
  -r, --request string        Requested changes in natural language (empty request will surprise you!)
  -w, --write                 Write changes to the repo files (if not set the patch is printed to stdout)

stderr:


@guymguym
Copy link
Contributor Author

guymguym commented Jun 4, 2022

/copilot-ops generate -s app1 -r "create a mysql deployment that mounts the mysql pvc from the namespace"

@github-actions
Copy link

github-actions bot commented Jun 4, 2022

exec: ["/copilot-ops","generate","-s","app1","-r","create a mysql deployment that mounts the mysql pvc from the namespace"]

error:

Error: The process '/home/runner/work/copilot-ops/copilot-ops/copilot-ops' failed with exit code 1
    at ExecState._setResult (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:3471:25)
    at ExecState.CheckComplete (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:3454:18)
    at ChildProcess.<anonymous> (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:3348:27)
    at ChildProcess.emit (node:events:390:28)
    at maybeClose (node:internal/child_process:1064:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)

@guymguym
Copy link
Contributor Author

guymguym commented Jun 4, 2022

Oh @RobotSail so even for a workflow that runs from an issue we don't have the keys? 😱
Any way to allow a the issue bot to run with secrets?

Error: error, status code: 401, message: You didn't provide an API key. 
You need to provide your API key in an Authorization header ...

@guymguym
Copy link
Contributor Author

guymguym commented Jun 5, 2022

/copilot-ops generate -s app1 -r "create a mysql deployment that mounts the mysql pvc from the namespace"

@github-actions
Copy link

github-actions bot commented Jun 5, 2022

exec: ["/copilot-ops","generate","-s","app1","-r","create a mysql deployment that mounts the mysql pvc from the namespace"]

exitCode:

1

stdout:


stderr:

2022/06/05 22:13:39 flags:
2022/06/05 22:13:39  - request : create a mysql deployment that mounts the mysql pvc from the namespace
2022/06/05 22:13:39  - write   : false
2022/06/05 22:13:39  - path    : .
2022/06/05 22:13:39  - file    : []
2022/06/05 22:13:39  - fileset : [app1]
2022/06/05 22:13:39  - ntokens : 512
2022/06/05 22:13:39 viper: /home/runner/work/copilot-ops/copilot-ops/.copilot-ops.yaml
2022/06/05 22:13:39 viper: 
2022/06/05 22:13:39 Filesets: [{Name:examples Files:[examples/*.yaml]} {Name:stock-data Files:[examples/stock-data.yaml]} {Name:cluster-scope-overlays Files:[examples/stale_dev_overlay/*.yaml]} {Name:app1 Files:[examples/app1/*.yaml]}]
2022/06/05 22:13:39 detected filesets: [app1]
2022/06/05 22:13:39 LoadFilesFromGlob "examples/app1/*.yaml" - matches [examples/app1/mysql-pvc.yaml examples/app1/namespace.yaml]
2022/06/05 22:13:39 filemap: len 2
2022/06/05 22:13:39  - tag: "mysql-pvc.yaml": path: "examples/app1/mysql-pvc.yaml" [apiVersion: v1 kind: Persisten ...] len 183
2022/06/05 22:13:39  - tag: "namespace.yaml": path: "examples/app1/namespace.yaml" [apiVersion: v1 kind: Namespace ...] len 54
2022/06/05 22:13:39 decoded input: "# @mysql-pvc.yaml\napiVersion: v1\nkind: PersistentVolumeClaim\nmetadata:\n  name: mysql-pvc\nspec:\n  volumeMode: Filesystem\n  accessModes:\n    - ReadWriteOnce\n  resources:\n    requests:\n      storage: 1Gi\n\n===\n# @namespace.yaml\napiVersion: v1\nkind: Namespace\nmetadata:\n  name: app1\n\n"
2022/06/05 22:13:39 requesting generate from OpenAI: ## This document contains instructions for a new Kubernetes YAML that needs to be created,
## along with the relevant YAMLs for context, and the resultant YAML.
##
## The structure of the document is as follows:
## 1. Description of the desired YAML
## 2. The existing YAMLs, each separated by a '==='
## 3. The new YAML, terminated by an 'EOF'

## 1. Instructions for the new Kubernetes YAML:
create a mysql deployment that mounts the mysql pvc from the namespace

## 2. Existing YAMLs:
# @mysql-pvc.yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: mysql-pvc
spec:
  volumeMode: Filesystem
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi

===
# @namespace.yaml
apiVersion: v1
kind: Namespace
metadata:
  name: app1



## 3. The new YAML:
Error: error, status code: 401, message: You didn't provide an API key. You need to provide your API key in an Authorization header using Bearer auth (i.e. Authorization: Bearer YOUR_KEY), or as the password field (with blank username) if you're accessing the API from your browser and are prompted for a username and password. You can obtain an API key from https://beta.openai.com. Feel free to email [email protected] if you have any questions.

@guymguym
Copy link
Contributor Author

guymguym commented Jun 8, 2022

/copilot-ops generate -s app1 -r "create a mysql deployment that mounts the mysql pvc from the namespace"

@github-actions
Copy link

github-actions bot commented Jun 8, 2022

exec: ["/copilot-ops","generate","-s","app1","-r","create a mysql deployment that mounts the mysql pvc from the namespace"]

exitCode:

0

stdout:

num parts: 1

stderr:

2022/06/08 18:56:06 flags:
2022/06/08 18:56:06  - request : create a mysql deployment that mounts the mysql pvc from the namespace
2022/06/08 18:56:06  - write   : false
2022/06/08 18:56:06  - path    : .
2022/06/08 18:56:06  - file    : []
2022/06/08 18:56:06  - fileset : [app1]
2022/06/08 18:56:06  - ntokens : 512
2022/06/08 18:56:06 viper: /home/runner/work/copilot-ops/copilot-ops/.copilot-ops.yaml
2022/06/08 18:56:06 viper: 
2022/06/08 18:56:06 Filesets: [{Name:examples Files:[examples/*.yaml]} {Name:stock-data Files:[examples/stock-data.yaml]} {Name:cluster-scope-overlays Files:[examples/stale_dev_overlay/*.yaml]} {Name:app1 Files:[examples/app1/*.yaml]}]
2022/06/08 18:56:06 detected filesets: [app1]
2022/06/08 18:56:06 LoadFilesFromGlob "examples/app1/*.yaml" - matches [examples/app1/mysql-pvc.yaml examples/app1/namespace.yaml]
2022/06/08 18:56:06 filemap: len 2
2022/06/08 18:56:06  - tag: "mysql-pvc.yaml": path: "examples/app1/mysql-pvc.yaml" [apiVersion: v1 kind: Persisten ...] len 183
2022/06/08 18:56:06  - tag: "namespace.yaml": path: "examples/app1/namespace.yaml" [apiVersion: v1 kind: Namespace ...] len 54
2022/06/08 18:56:06 decoded input: "# @mysql-pvc.yaml\napiVersion: v1\nkind: PersistentVolumeClaim\nmetadata:\n  name: mysql-pvc\nspec:\n  volumeMode: Filesystem\n  accessModes:\n    - ReadWriteOnce\n  resources:\n    requests:\n      storage: 1Gi\n\n===\n# @namespace.yaml\napiVersion: v1\nkind: Namespace\nmetadata:\n  name: app1\n\n"
2022/06/08 18:56:06 requesting generate from OpenAI: ## This document contains instructions for a new Kubernetes YAML that needs to be created,
## along with the relevant YAMLs for context, and the resultant YAML.
##
## The structure of the document is as follows:
## 1. Description of the desired YAML
## 2. The existing YAMLs, each separated by a '==='
## 3. The new YAML, terminated by an 'EOF'

## 1. Instructions for the new Kubernetes YAML:
create a mysql deployment that mounts the mysql pvc from the namespace

## 2. Existing YAMLs:
# @mysql-pvc.yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: mysql-pvc
spec:
  volumeMode: Filesystem
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi

===
# @namespace.yaml
apiVersion: v1
kind: Namespace
metadata:
  name: app1



## 3. The new YAML:
2022/06/08 18:56:09 received output from OpenAI: cat > ./${NS}-deployment.yaml <<
2022/06/08 18:56:09 decoding output
2022/06/08 18:56:09 decoding failed, got error: no tagname found in content
2022/06/08 18:56:09 trying fallback
2022/06/08 18:56:09 filemap: len 1
2022/06/08 18:56:09  - tag: "generated-by-copilot-ops/generated-by-copilot-ops.yaml": path: "generated-by-copilot-ops/generated-by-copilot-ops.yaml" [cat > ./${NS}-deployment.yaml  ...] len 32
2022/06/08 18:56:09 
# @generated-by-copilot-ops/generated-by-copilot-ops.yaml
cat > ./${NS}-deployment.yaml <<

2022/06/08 18:56:09 use --write to actually update files

@guymguym guymguym mentioned this issue Jun 9, 2022
3 tasks
@guymguym guymguym added the wontfix This will not be worked on label Aug 1, 2022
@guymguym guymguym changed the title Testing the BOT action (NOT A BUG) Testing the BOT action Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

1 participant