-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: add ai:models:detach
command
#18
Conversation
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.
Just a comment to fix a copy on an error message according to what we discussed and agreed with Sandy, but it looks great! I'm approving.
src/commands/ai/models/detach.ts
Outdated
const resource = error.http.body.resource | ||
|
||
if (statusCode === 404 && resource === 'attachment') { | ||
ux.error(`We can’t find a model resource called ${modelResource}. Run 'heroku addons' to see a list of model resources attached to your app.`) |
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.
We agreed with Sandy to use Run 'heroku ai:models:info -a <appname' to see a list...
, because it's the command expected to return all model resources according to the requested UX.
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.
Ah ok. That change must not have made it into the design doc. Thanks.
await runCommand(Cmd, ['--app', 'myapp', 'model-123']) | ||
|
||
expect(stdout.output).to.equal('') | ||
expect(stderr.output).to.contain('Detaching model-123 to model from myapp... done\n') |
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.
Using the stripAnsi
helper might help with the differences between local and CI.
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.
I tried that here and it didn't work because depending on the connection you can get those messages multiple times. So I left it as is, but I did use the stripAnsi helper on another test below where the message got longer.
Description
This PR implements the
ai:models:detach
command with tests according to the design outlined in the UX design doc.How to test
Prepare your environment for testing
yarn && yarn build
.HEROKU_INFERENCE_ADDON
to the production canary add-on viaexport HEROKU_INFERENCE_ADDON="inference-staging"
Actual testing
./bin/run ai:models:detach --help
heroku apps:create test-cli-plugin-ai
./bin/run ai:models:create claude-3-opus -a test-cli-plugin-ai --as opus_model
and confirm that the command succeeds, creating the model resource config vars using the alias indicated.inference-staging-<adjective>-XXXXX
) in the following command to create a second attachment to the same model resource:heroku addons:attach <addon-name> -a test-cli-plugin-ai --as opus_again
../bin/run ai:models:detach <add-on name> -a test-cli-plugin-ai
, you should get an error saying that there are multiple matching attachments./bin/run ai:models:detach opus_again -a test-cli-plugin-ai
, this operation should be successful./bin/run ai:models:detach opus_false -a test-cli-plugin-ai
, you should get an error that says "We can’t find a model resource called opus_false. Run 'heroku addons' to see a list of model resources attached to your app."./bin/run ai:models:detach opus_model -a false-test-app
, you should get an error that says "We can’t find the false-test-app app. Check your spelling."heroku apps:destroy -a test-cli-plugin-ai
SOC2 Compliance
GUS Work Item