Skip to content

fix: do not create more than 1 assistant projects #30

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

Merged
merged 12 commits into from
Apr 24, 2024

Conversation

rajatagarwal-ibm
Copy link
Member

Description

There was a bug in getting the assistant integration ID, as when you do terraform apply back to back it won't return assistant integration ID...

that's because if you apply multiple times it will create many projects - hence there will be more than 1 assistance ID...

10281 ± curl -X GET -u "apikey:<apikey>" "https://api.us-south.assistant.watson.cloud.ibm.com/instances/999a9ef2-db68-42d9-bc06-9927883f7be8/v2/assistants?version=2023-06-1
5" | jq -r '.assistants[] | select(.name == "gen-ai-rag-sample-app-assistant") | .assistant_id '

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2931  100  2931    0     0   3192      0 --:--:-- --:--:-- --:--:--  3189
f5b94c74-691f-485b-b09b-783885e31b92
60390afc-b12f-4c88-8fac-94e3aa01e9d6
2a03a7c9-c2bd-4698-9c03-e485eeacb889
31d746c1-e01b-4b5d-ac2c-14c825dbca43
7c1054ba-b4c5-4c61-9dd9-ffc5eaad83ff

But the script assumes only 1 assistant ID to be returned. I discussed with @brendankellyibm and it was concluded to restrict creating more than 1 project.

Release required?

  • No release
  • Patch release (x.x.X)
  • Minor release (x.X.x)
  • Major release (X.x.x)
Release notes content

Run the pipeline

If the CI pipeline doesn't run when you create the PR, the PR requires a user with GitHub collaborators access to run the pipeline.

Run the CI pipeline when the PR is ready for review and you expect tests to pass. Add a comment to the PR with the following text:

/run pipeline

Checklist for reviewers

  • If relevant, a test for the change is included or updated with this PR.
  • If relevant, documentation for the change is included or updated with this PR.

For mergers

  • Use a conventional commit message to set the release level. Follow the guidelines.
  • Include information that users need to know about the PR in the commit message. The commit message becomes part of the GitHub release notes.
  • Use the Squash and merge option.

@rajatagarwal-ibm
Copy link
Member Author

/run pipeline

@rajatagarwal-ibm
Copy link
Member Author

/run pipeline

@rajatagarwal-ibm
Copy link
Member Author

/run pipeline

@brendankellyibm brendankellyibm dismissed their stale review April 19, 2024 16:48

Conall's changes should be implemented - I will do the same for discovery scripts

@rajatagarwal-ibm
Copy link
Member Author

/run pipeline

@rajatagarwal-ibm
Copy link
Member Author

/run pipeline

@rajatagarwal-ibm
Copy link
Member Author

/run pipeline

@rajatagarwal-ibm
Copy link
Member Author

/run pipeline

curl --retry 3 -fLsS -X POST --location "$WATSON_ASSISTANT_URL/v2/assistants?version=2023-06-15" \
--header "Authorization: Bearer $token" \
--header "Content-Type: application/json" \
--data "{\"name\":\"gen-ai-rag-sample-app-assistant\",\"language\":\"en\",\"description\":\"Generative AI sample app assistant\"}"
Copy link
Contributor

Choose a reason for hiding this comment

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

We can use project_name parameter here for the name

@vburckhardt vburckhardt merged commit a6a8653 into main Apr 24, 2024
@vburckhardt vburckhardt deleted the create-single-assistant-project branch April 24, 2024 09:02
@terraform-ibm-modules-ops
Copy link
Contributor

🎉 This PR is included in version 1.4.7 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants