Skip to content

Commit d1af08d

Browse files
committed
Update CodeRepositoryIndex descriptions and remove unused code
1 parent 52fc2ba commit d1af08d

File tree

3 files changed

+8
-172
lines changed

3 files changed

+8
-172
lines changed

mmv1/products/cloudaicompanion/CodeRepositoryIndex.yaml

+8-10
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
---
1515
name: CodeRepositoryIndex
16-
description: The resource for managing Code Repository Indexes for Gemini Code Assist.
16+
description: The resource for managing Code Repository Index for Gemini Code Assist.
1717
min_version: 'beta'
1818
base_url: projects/{{project}}/locations/{{location}}/codeRepositoryIndexes
1919
self_link: projects/{{project}}/locations/{{location}}/codeRepositoryIndexes/{{code_repository_index_id}}
@@ -54,33 +54,31 @@ async:
5454
path: error
5555
message: message
5656
include_project: false
57-
custom_code:
58-
custom_update: templates/terraform/custom_update/code_repository_index.go.tmpl
5957
parameters:
6058
- name: location
6159
type: String
62-
description: Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.
60+
description: The location of the Code Repository Index, for example `us-central1`.
6361
min_version: 'beta'
6462
immutable: true
6563
url_param_only: true
6664
required: true
6765
- name: codeRepositoryIndexId
6866
type: String
69-
description: Required. Id of the requesting object
67+
description: Required. Id of the Code Repository Index.
7068
min_version: 'beta'
7169
immutable: true
7270
url_param_only: true
7371
required: true
7472
properties:
7573
- name: updateTime
7674
type: String
77-
description: Output only. Update time stamp
75+
description: Output only. Update time stamp.
7876
min_version: 'beta'
7977
output: true
8078
- name: state
8179
type: String
8280
description: |-
83-
Output only. Code Repository Index instance State
81+
Output only. Code Repository Index instance State.
8482
Possible values:
8583
STATE_UNSPECIFIED
8684
CREATING
@@ -91,7 +89,7 @@ properties:
9189
output: true
9290
- name: labels
9391
type: KeyValueLabels
94-
description: Optional. Labels as key value pairs
92+
description: Optional. Labels as key value pairs.
9593
min_version: 'beta'
9694
- name: kmsKey
9795
type: String
@@ -102,12 +100,12 @@ properties:
102100
immutable: true
103101
- name: name
104102
type: String
105-
description: Immutable. Identifier. name of resource
103+
description: Immutable. Identifier. Name of Code Repository Index.
106104
min_version: 'beta'
107105
output: true
108106
immutable: true
109107
- name: createTime
110108
type: String
111-
description: Output only. Create time stamp
109+
description: Output only. Create time stamp.
112110
min_version: 'beta'
113111
output: true

mmv1/templates/terraform/custom_update/code_repository_index.go.tmpl

-79
This file was deleted.

mmv1/third_party/terraform/acctest/bootstrap_test_utils.go.tmpl

-83
Original file line numberDiff line numberDiff line change
@@ -1439,89 +1439,6 @@ func SetupProjectsAndGetAccessToken(org, billing, pid, service string, config *t
14391439
return accessToken, nil
14401440
}
14411441

1442-
{{ if ne $.TargetVersionName `ga` -}}
1443-
// BootstrapSharedCodeRepositoryIndex will create a code repository index
1444-
// if it hasn't been created in the test project.
1445-
//
1446-
// BootstrapSharedCodeRepositoryIndex returns a persistent code repository index
1447-
// for a test or set of tests.
1448-
//
1449-
// Deletion of code repository index takes a few minutes, and creation of it
1450-
// currently takes about half an hour.
1451-
// That is the reason to use the shared code repository indexes for test resources.
1452-
const SharedCodeRepositoryIndexPrefix = "tf-bootstrap-cri-"
1453-
1454-
func BootstrapSharedCodeRepositoryIndex(t *testing.T, codeRepositoryIndexId, location, kmsKey string, labels map[string]string) string {
1455-
codeRepositoryIndexId = SharedCodeRepositoryIndexPrefix + codeRepositoryIndexId
1456-
1457-
config := BootstrapConfig(t)
1458-
if config == nil {
1459-
t.Fatal("Could not bootstrap config.")
1460-
}
1461-
1462-
log.Printf("[DEBUG] Getting shared code repository index %q", codeRepositoryIndexId)
1463-
1464-
getURL := fmt.Sprintf("%sprojects/%s/locations/%s/codeRepositoryIndexes/%s", config.GeminiBasePath, config.Project, location, codeRepositoryIndexId)
1465-
1466-
headers := make(http.Header)
1467-
_, err := transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
1468-
Config: config,
1469-
Method: "GET",
1470-
Project: config.Project,
1471-
RawURL: getURL,
1472-
UserAgent: config.UserAgent,
1473-
Timeout: 90 * time.Minute,
1474-
Headers: headers,
1475-
})
1476-
1477-
// CRI not found responds with 404 not found
1478-
if err != nil && transport_tpg.IsGoogleApiErrorWithCode(err, 404) {
1479-
log.Printf("[DEBUG] Code repository index %q not found, bootstrapping", codeRepositoryIndexId)
1480-
postURL := fmt.Sprintf("%sprojects/%s/locations/%s/codeRepositoryIndexes?codeRepositoryIndexId=%s", config.GeminiBasePath, config.Project, location, codeRepositoryIndexId)
1481-
obj := make(map[string]interface{})
1482-
if labels != nil {
1483-
obj["labels"] = labels
1484-
}
1485-
if kmsKey != "" {
1486-
obj["kmsKey"] = kmsKey
1487-
}
1488-
1489-
headers := make(http.Header)
1490-
_, err := transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
1491-
Config: config,
1492-
Method: "POST",
1493-
Project: config.Project,
1494-
RawURL: postURL,
1495-
UserAgent: config.UserAgent,
1496-
Body: obj,
1497-
Timeout: 90 * time.Minute,
1498-
Headers: headers,
1499-
})
1500-
if err != nil {
1501-
t.Fatalf("Error creating code repository index %q: %s", codeRepositoryIndexId, err)
1502-
}
1503-
1504-
_, err = transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
1505-
Config: config,
1506-
Method: "GET",
1507-
Project: config.Project,
1508-
RawURL: getURL,
1509-
UserAgent: config.UserAgent,
1510-
Timeout: 90 * time.Minute,
1511-
Headers: headers,
1512-
})
1513-
if err != nil {
1514-
t.Fatalf("Error getting code repository index %q: %s", codeRepositoryIndexId, err)
1515-
}
1516-
} else if err != nil {
1517-
t.Fatalf("Error getting code repository index %q: %s", codeRepositoryIndexId, err)
1518-
}
1519-
1520-
return codeRepositoryIndexId
1521-
}
1522-
1523-
{{- end }}
1524-
15251442
const sharedTagKeyPrefix = "tf-bootstrap-tagkey"
15261443

15271444
func BootstrapSharedTestTagKey(t *testing.T, testId string) string {

0 commit comments

Comments
 (0)