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

Search Engine TF Provider #9822

Merged

Conversation

Pratster95
Copy link
Contributor

@Pratster95 Pratster95 commented Jan 15, 2024

Release Note Template for Downstream PRs (will be copied)

`google_discovery_engine_search_engine`

@modular-magician
Copy link
Collaborator

Hello! I am a robot. It looks like you are a: Community Contributor Googler Core Contributor. Tests will run automatically.

@shuyama1, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look.

You can help make sure that review is quick by doing a self-review and by running impacted tests locally.

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 6 files changed, 1127 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 6 files changed, 1127 insertions(+), 2 deletions(-))
TF Conversion: Diff ( 1 file changed, 168 insertions(+))
TF OiCS: Diff ( 4 files changed, 117 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 4
Passed tests 2
Skipped tests: 0
Affected tests: 2

Click here to see the affected service packages
  • discoveryengine

Action taken

Found 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccDiscoveryEngineSearchEngine_discoveryengineSearchengineBasicExample_update|TestAccDiscoveryEngineSearchEngine_discoveryengineSearchengineBasicExample

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccDiscoveryEngineSearchEngine_discoveryengineSearchengineBasicExample_update[Error message] [Debug log]
TestAccDiscoveryEngineSearchEngine_discoveryengineSearchengineBasicExample[Error message] [Debug log]

$\textcolor{red}{\textsf{Please fix these to complete your PR.}}$
View the build log or the debug log for each test

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 6 files changed, 1127 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 6 files changed, 1127 insertions(+), 2 deletions(-))
TF Conversion: Diff ( 1 file changed, 168 insertions(+))
TF OiCS: Diff ( 4 files changed, 117 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 4
Passed tests 2
Skipped tests: 0
Affected tests: 2

Click here to see the affected service packages
  • discoveryengine

Action taken

Found 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccDiscoveryEngineSearchEngine_discoveryengineSearchengineBasicExample|TestAccDiscoveryEngineSearchEngine_discoveryengineSearchengineBasicExample_update

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccDiscoveryEngineSearchEngine_discoveryengineSearchengineBasicExample[Error message] [Debug log]
TestAccDiscoveryEngineSearchEngine_discoveryengineSearchengineBasicExample_update[Error message] [Debug log]

$\textcolor{red}{\textsf{Please fix these to complete your PR.}}$
View the build log or the debug log for each test

@Pratster95
Copy link
Contributor Author

Pratster95 commented Jan 16, 2024

I ran make fmt in my local and don't see any gofmt errors after that but after pushing the code I am seeing gofmt error for terraform-provider-google-beta-build-and-unit-tests and terraform-provider-google-build-and-unit-tests

@shuyama1
Copy link
Member

Can you try gofmt -w mmv1/third_party/terraform/services/discoveryengine/resource_discovery_engine_search_engine_test.go, if you're running it in the upstream repo magic-modules

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 6 files changed, 1122 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 6 files changed, 1122 insertions(+), 2 deletions(-))
TF Conversion: Diff ( 1 file changed, 168 insertions(+))
TF OiCS: Diff ( 4 files changed, 117 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 4
Passed tests 2
Skipped tests: 0
Affected tests: 2

Click here to see the affected service packages
  • discoveryengine

Action taken

Found 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccDiscoveryEngineSearchEngine_discoveryengineSearchengineBasicExample|TestAccDiscoveryEngineSearchEngine_discoveryengineSearchengineBasicExample_update

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccDiscoveryEngineSearchEngine_discoveryengineSearchengineBasicExample[Error message] [Debug log]
TestAccDiscoveryEngineSearchEngine_discoveryengineSearchengineBasicExample_update[Error message] [Debug log]

$\textcolor{red}{\textsf{Please fix these to complete your PR.}}$
View the build log or the debug log for each test

@Pratster95
Copy link
Contributor Author

Can you try gofmt -w mmv1/third_party/terraform/services/discoveryengine/resource_discovery_engine_search_engine_test.go, if you're running it in the upstream repo magic-modules

Thank You @shuyama1 I was able to fix that issue. For the VCR test I would have to merge the test of datastore and app in one test file and refer to the datastore created using the Datastore TF Provider. I used a Datastore ID from my test project and the acceptance tests passed locally

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 6 files changed, 1140 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 6 files changed, 1140 insertions(+), 2 deletions(-))
TF Conversion: Diff ( 1 file changed, 168 insertions(+))
TF OiCS: Diff ( 4 files changed, 117 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 4
Passed tests 2
Skipped tests: 0
Affected tests: 2

Click here to see the affected service packages
  • discoveryengine

Action taken

Found 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccDiscoveryEngineSearchEngine_discoveryengineSearchengineBasicExample|TestAccDiscoveryEngineSearchEngine_discoveryengineSearchengineBasicExample_update

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccDiscoveryEngineSearchEngine_discoveryengineSearchengineBasicExample_update[Debug log]

Rerun these tests in REPLAYING mode to catch issues

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccDiscoveryEngineSearchEngine_discoveryengineSearchengineBasicExample[Error message] [Debug log]

$\textcolor{red}{\textsf{Please fix these to complete your PR.}}$
View the build log or the debug log for each test

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 6 files changed, 1158 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 6 files changed, 1158 insertions(+), 2 deletions(-))
TF Conversion: Diff ( 1 file changed, 168 insertions(+))
TF OiCS: Diff ( 4 files changed, 126 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 4
Passed tests 3
Skipped tests: 0
Affected tests: 1

Click here to see the affected service packages
  • discoveryengine

Action taken

Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccDiscoveryEngineSearchEngine_discoveryengineSearchengineBasicExample

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccDiscoveryEngineSearchEngine_discoveryengineSearchengineBasicExample[Debug log]

Rerun these tests in REPLAYING mode to catch issues

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{green}{\textsf{All tests passed!}}$
View the build log or the debug log for each test

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 6 files changed, 1158 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 6 files changed, 1158 insertions(+), 2 deletions(-))
TF Conversion: Diff ( 1 file changed, 168 insertions(+))
TF OiCS: Diff ( 4 files changed, 126 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 4
Passed tests 4
Skipped tests: 0
Affected tests: 0

Click here to see the affected service packages
  • discoveryengine

$\textcolor{green}{\textsf{All tests passed in REPLAYING mode.}}$
View the build log

@Pratster95
Copy link
Contributor Author

@5fff Could you verify your CLA. It is causing CLA test to fail

Copy link
Member

@shuyama1 shuyama1 left a comment

Choose a reason for hiding this comment

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

Would you mind also adding create + update test coverage on fields common_config and search_engine_config detected in the Missing test report #9822 (comment)? Thank you!

values:
- :SEARCH_TIER_STANDARD
- :SEARCH_TIER_ENTERPRISE
default_from_api: true
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
default_from_api: true
default_value: SEARCH_TIER_STANDARD

Then we may want to set default value if the default is fixed

mmv1/products/discoveryengine/SearchEngine.yaml Outdated Show resolved Hide resolved
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 6 files changed, 1192 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 6 files changed, 1192 insertions(+), 2 deletions(-))
TF Conversion: Diff ( 1 file changed, 164 insertions(+))
TF OiCS: Diff ( 4 files changed, 118 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 4
Passed tests 3
Skipped tests: 0
Affected tests: 1

Click here to see the affected service packages
  • discoveryengine

Action taken

Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccDiscoveryEngineSearchEngine_discoveryengineSearchengineBasicExample_update

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccDiscoveryEngineSearchEngine_discoveryengineSearchengineBasicExample_update[Debug log]

Rerun these tests in REPLAYING mode to catch issues

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{green}{\textsf{All tests passed!}}$
View the build log or the debug log for each test

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 6 files changed, 1192 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 6 files changed, 1192 insertions(+), 2 deletions(-))
TF Conversion: Diff ( 1 file changed, 164 insertions(+))
TF OiCS: Diff ( 4 files changed, 118 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 4
Passed tests 4
Skipped tests: 0
Affected tests: 0

Click here to see the affected service packages
  • discoveryengine

$\textcolor{green}{\textsf{All tests passed in REPLAYING mode.}}$
View the build log

mmv1/products/discoveryengine/SearchEngine.yaml Outdated Show resolved Hide resolved
immutable: false
properties:
- !ruby/object:Api::Type::Enum
name: 'searchTier'

Choose a reason for hiding this comment

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

Thanks! SGTM to make it required as a start to ask customers always set the tier explicitly. We can resolve the comment

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 6 files changed, 1199 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 6 files changed, 1199 insertions(+), 2 deletions(-))
TF Conversion: Diff ( 1 file changed, 164 insertions(+))
TF OiCS: Diff ( 4 files changed, 122 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 6
Passed tests 5
Skipped tests: 0
Affected tests: 1

Click here to see the affected service packages
  • discoveryengine

Action taken

Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccDiscoveryEngineSearchEngine_discoveryengineSearchengineBasicExample

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccDiscoveryEngineSearchEngine_discoveryengineSearchengineBasicExample[Debug log]

Rerun these tests in REPLAYING mode to catch issues

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{green}{\textsf{All tests passed!}}$
View the build log or the debug log for each test

Copy link
Member

@shuyama1 shuyama1 left a comment

Choose a reason for hiding this comment

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

Mostly LGTM! Thanks! Some small comments only


parameters:
- !ruby/object:Api::Type::String
name: 'engine_id'
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
name: 'engine_id'
name: 'engineId'

Sorry for missing it. Should not affect generated code downstream though

immutable: true
url_param_only: true
- !ruby/object:Api::Type::String
name: 'collection_id'
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
name: 'collection_id'
name: 'collectionId'

characters.
output: true
- !ruby/object:Api::Type::Enum
name: 'industryVertical'
Copy link
Member

Choose a reason for hiding this comment

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

We may need to set default value for this field since the default is fixed. Does the API return the default value for this field if it's not explicitly set? I don't see a test config without this field, so I'm not sure the API behavior. We may consider removing all optional fields from the basic example to ensure we have required fields set correctly and we handle fields that have default values returned from the API.

Choose a reason for hiding this comment

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

SG. Let's add "default_value: :GENERIC". This is the default server behavior.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tested the provider in a TF directory without the industry_vertical field and it takes the default as generic. I will also add its default_value under properties

Copy link
Contributor Author

@Pratster95 Pratster95 Jan 31, 2024

Choose a reason for hiding this comment

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

Also for the Search and Chat Engine the industry_field should be derived from datastore's industry_vertical so it has a dependency that's why in the example also I refer it to the Datastore's industry_vertical while creating the Search Engine resource,instead of leaving it out.
@shuyama1 @chenlei1216 Let me know your thoughts

name: 'searchEngineConfig'
description: |
Configurations for a Search Engine.
# default_from_api: true
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# default_from_api: true

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 6 files changed, 1195 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 6 files changed, 1195 insertions(+), 2 deletions(-))
TF Conversion: Diff ( 1 file changed, 164 insertions(+))
TF OiCS: Diff ( 4 files changed, 119 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 6
Passed tests 5
Skipped tests: 0
Affected tests: 1

Click here to see the affected service packages
  • discoveryengine

Action taken

Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccDiscoveryEngineSearchEngine_discoveryengineSearchengineBasicExample

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccDiscoveryEngineSearchEngine_discoveryengineSearchengineBasicExample[Debug log]

Rerun these tests in REPLAYING mode to catch issues

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{green}{\textsf{All tests passed!}}$
View the build log or the debug log for each test

Copy link
Member

@shuyama1 shuyama1 left a comment

Choose a reason for hiding this comment

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

Thank you!

@shuyama1 shuyama1 merged commit 69eb35b into GoogleCloudPlatform:main Jan 31, 2024
12 checks passed
tdbhacks pushed a commit to tdbhacks/magic-modules that referenced this pull request Feb 6, 2024
* Search Engine TF Provider

* Discovery Engine Search Engine

* Formatted Test File

* Updated Test File

* Added Examples to SearchEngine Config and added DS to basic test example

* Update mmv1/products/discoveryengine/SearchEngine.yaml

Co-authored-by: Ray <[email protected]>

* Updated SearchEngine.yaml file

* Updated SearchEngine.yaml

* Updated Search TF Files as per PR Review

* Updated files as per PR Review

* Set searchEngineConfig as required field in SearchEngine.yaml

* Removed default_from_api from SearchEngineConfig

* Added Changes as per PR review

---------

Co-authored-by: Ray <[email protected]>
balanaguharsha pushed a commit to balanaguharsha/magic-modules that referenced this pull request Apr 19, 2024
* Search Engine TF Provider

* Discovery Engine Search Engine

* Formatted Test File

* Updated Test File

* Added Examples to SearchEngine Config and added DS to basic test example

* Update mmv1/products/discoveryengine/SearchEngine.yaml

Co-authored-by: Ray <[email protected]>

* Updated SearchEngine.yaml file

* Updated SearchEngine.yaml

* Updated Search TF Files as per PR Review

* Updated files as per PR Review

* Set searchEngineConfig as required field in SearchEngine.yaml

* Removed default_from_api from SearchEngineConfig

* Added Changes as per PR review

---------

Co-authored-by: Ray <[email protected]>
balanaguharsha pushed a commit to balanaguharsha/magic-modules that referenced this pull request May 2, 2024
* Search Engine TF Provider

* Discovery Engine Search Engine

* Formatted Test File

* Updated Test File

* Added Examples to SearchEngine Config and added DS to basic test example

* Update mmv1/products/discoveryengine/SearchEngine.yaml

Co-authored-by: Ray <[email protected]>

* Updated SearchEngine.yaml file

* Updated SearchEngine.yaml

* Updated Search TF Files as per PR Review

* Updated files as per PR Review

* Set searchEngineConfig as required field in SearchEngine.yaml

* Removed default_from_api from SearchEngineConfig

* Added Changes as per PR review

---------

Co-authored-by: Ray <[email protected]>
pengq-google pushed a commit to pengq-google/magic-modules that referenced this pull request May 21, 2024
* Search Engine TF Provider

* Discovery Engine Search Engine

* Formatted Test File

* Updated Test File

* Added Examples to SearchEngine Config and added DS to basic test example

* Update mmv1/products/discoveryengine/SearchEngine.yaml

Co-authored-by: Ray <[email protected]>

* Updated SearchEngine.yaml file

* Updated SearchEngine.yaml

* Updated Search TF Files as per PR Review

* Updated files as per PR Review

* Set searchEngineConfig as required field in SearchEngine.yaml

* Removed default_from_api from SearchEngineConfig

* Added Changes as per PR review

---------

Co-authored-by: Ray <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants