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

[Devtooling-672] Added Missing Attributes and Refactor #1491

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

BrianMoyles
Copy link
Collaborator

This PR is a Refactor of Knowledge Document Variation
It incorporates the missing 'name' field, missing 'context' field and missing 'properties' field
It also resolves bugs found during the refactor.
Amazon Q was used to check for potential nil pointers, errors, etc

proxy := newVariationRequestProxy(sdkConfig)

name := d.Get("name").(string)
knowledgeBaseID := d.Get("knowledge_base_id").(string)
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably a good idea to use buildVariationId() and splitVariationId() functions to ensure consistency for handling.

}

for _, knowledgeDocumentVariation := range *knowledgeDocumentVariations {
id := fmt.Sprintf("%s %s %s", *knowledgeDocumentVariation.Id, *knowledgeDoc.KnowledgeBase.Id, *knowledgeDoc.Id)
Copy link
Contributor

Choose a reason for hiding this comment

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

This has bugged the heck out of me whenever I've happened across this particular resource. The building of the ID is not consistent. It seems like it should be knowledge base ID + knowledge doc ID + knowledge variation ID to align with the hierarchy of the parent resources.

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

Successfully merging this pull request may close these issues.

2 participants