Skip to content

Commit

Permalink
fix: remove unused YAML fields to fix presubmit (#265)
Browse files Browse the repository at this point in the history
* fix: remove unused YAML fields for repo

* test: remove patch on goldens test for repo

* test: update goldens
  • Loading branch information
dandhlee authored Nov 2, 2022
1 parent ff8902e commit 10ecc44
Show file tree
Hide file tree
Showing 200 changed files with 0 additions and 3,059 deletions.
10 changes: 0 additions & 10 deletions docfx_yaml/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -935,11 +935,6 @@ def _update_friendly_package_name(path):
'name': short_name,
'fullName': name,
'source': {
'remote': {
'path': path,
'branch': app.env.docfx_branch,
'repo': app.env.docfx_remote,
},
'id': short_name,
'path': path,
'startLine': start_line,
Expand Down Expand Up @@ -1735,11 +1730,6 @@ def convert_module_to_package_if_needed(obj):
except NameError:
pass

if 'source' in obj and (not obj['source']['remote']['repo'] or \
obj['source']['remote']['repo'] == 'https://apidrop.visualstudio.com/Content%20CI/_git/ReferenceAutomation'):
del(obj['source'])


# Extract any missing cross references where applicable.
# Potential targets are instances of full uid shown, or
# if we find a short form of the uid of one of current
Expand Down
13 changes: 0 additions & 13 deletions tests/test_goldens.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,19 +97,6 @@ def test_goldens(update_goldens, test_dir):

if update_goldens:
shutil.rmtree(golden_dir, ignore_errors=True)
files_to_move = out_dir.rglob("*")

# Overwrite incorrect repo data used compared to GH Action.
incorrect_repo = "git@github.com:googleapis/sphinx-docfx-yaml.git"
correct_repo = "https://github.com/googleapis/sphinx-docfx-yaml"

for yaml_file in files_to_move:
with open(yaml_file) as file:
lines = file.read()
lines = lines.replace(incorrect_repo, correct_repo)
with open(yaml_file, 'w') as file:
file.write(lines)

shutil.copytree(out_dir, golden_dir, dirs_exist_ok=True)
pytest.skip(
"Updated goldens! Re-run the test without the --update-goldens flag."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ items:
source:
id: TextToSpeechAsyncClient
path: tests/testdata/gapic-auto/google/cloud/texttospeech_v1/services/text_to_speech/async_client.py
remote:
branch: add_goldens
path: tests/testdata/gapic-auto/google/cloud/texttospeech_v1/services/text_to_speech/async_client.py
repo: https://github.com/googleapis/sphinx-docfx-yaml
startLine: 41
summary: 'Service that implements Google Cloud Text-to-Speech API.
Expand All @@ -65,10 +61,6 @@ items:
source:
id: TextToSpeechAsyncClient
path: tests/testdata/gapic-auto/google/cloud/texttospeech_v1/services/text_to_speech/async_client.py
remote:
branch: add_goldens
path: tests/testdata/gapic-auto/google/cloud/texttospeech_v1/services/text_to_speech/async_client.py
repo: https://github.com/googleapis/sphinx-docfx-yaml
startLine: 41
summary: 'Instantiates the text to speech client.
Expand Down Expand Up @@ -117,10 +109,6 @@ items:
source:
id: common_billing_account_path
path: tests/testdata/gapic-auto/google/cloud/texttospeech_v1/services/text_to_speech/client.py
remote:
branch: add_goldens
path: tests/testdata/gapic-auto/google/cloud/texttospeech_v1/services/text_to_speech/client.py
repo: https://github.com/googleapis/sphinx-docfx-yaml
startLine: 185
summary: 'Returns a fully-qualified billing_account string.
Expand All @@ -141,10 +129,6 @@ items:
source:
id: common_folder_path
path: tests/testdata/gapic-auto/google/cloud/texttospeech_v1/services/text_to_speech/client.py
remote:
branch: add_goldens
path: tests/testdata/gapic-auto/google/cloud/texttospeech_v1/services/text_to_speech/client.py
repo: https://github.com/googleapis/sphinx-docfx-yaml
startLine: 200
summary: 'Returns a fully-qualified folder string.
Expand All @@ -165,10 +149,6 @@ items:
source:
id: common_location_path
path: tests/testdata/gapic-auto/google/cloud/texttospeech_v1/services/text_to_speech/client.py
remote:
branch: add_goldens
path: tests/testdata/gapic-auto/google/cloud/texttospeech_v1/services/text_to_speech/client.py
repo: https://github.com/googleapis/sphinx-docfx-yaml
startLine: 245
summary: 'Returns a fully-qualified location string.
Expand All @@ -189,10 +169,6 @@ items:
source:
id: common_organization_path
path: tests/testdata/gapic-auto/google/cloud/texttospeech_v1/services/text_to_speech/client.py
remote:
branch: add_goldens
path: tests/testdata/gapic-auto/google/cloud/texttospeech_v1/services/text_to_speech/client.py
repo: https://github.com/googleapis/sphinx-docfx-yaml
startLine: 215
summary: 'Returns a fully-qualified organization string.
Expand All @@ -213,10 +189,6 @@ items:
source:
id: common_project_path
path: tests/testdata/gapic-auto/google/cloud/texttospeech_v1/services/text_to_speech/client.py
remote:
branch: add_goldens
path: tests/testdata/gapic-auto/google/cloud/texttospeech_v1/services/text_to_speech/client.py
repo: https://github.com/googleapis/sphinx-docfx-yaml
startLine: 230
summary: 'Returns a fully-qualified project string.
Expand All @@ -237,10 +209,6 @@ items:
source:
id: from_service_account_file
path: tests/testdata/gapic-auto/google/cloud/texttospeech_v1/services/text_to_speech/async_client.py
remote:
branch: add_goldens
path: tests/testdata/gapic-auto/google/cloud/texttospeech_v1/services/text_to_speech/async_client.py
repo: https://github.com/googleapis/sphinx-docfx-yaml
startLine: 87
summary: "Creates an instance of this client using the provided credentials\n \
\ file.\n"
Expand All @@ -265,10 +233,6 @@ items:
source:
id: from_service_account_info
path: tests/testdata/gapic-auto/google/cloud/texttospeech_v1/services/text_to_speech/async_client.py
remote:
branch: add_goldens
path: tests/testdata/gapic-auto/google/cloud/texttospeech_v1/services/text_to_speech/async_client.py
repo: https://github.com/googleapis/sphinx-docfx-yaml
startLine: 72
summary: "Creates an instance of this client using the provided credentials\n \
\ info.\n"
Expand All @@ -293,10 +257,6 @@ items:
source:
id: from_service_account_json
path: tests/testdata/gapic-auto/google/cloud/texttospeech_v1/services/text_to_speech/async_client.py
remote:
branch: add_goldens
path: tests/testdata/gapic-auto/google/cloud/texttospeech_v1/services/text_to_speech/async_client.py
repo: https://github.com/googleapis/sphinx-docfx-yaml
startLine: 87
summary: "Creates an instance of this client using the provided credentials\n \
\ file.\n"
Expand All @@ -321,10 +281,6 @@ items:
source:
id: get_mtls_endpoint_and_cert_source
path: tests/testdata/gapic-auto/google/cloud/texttospeech_v1/services/text_to_speech/async_client.py
remote:
branch: add_goldens
path: tests/testdata/gapic-auto/google/cloud/texttospeech_v1/services/text_to_speech/async_client.py
repo: https://github.com/googleapis/sphinx-docfx-yaml
startLine: 105
summary: 'Return the API endpoint and client cert source for mutual TLS.
Expand Down Expand Up @@ -390,10 +346,6 @@ items:
source:
id: get_transport_class
path: null
remote:
branch: add_goldens
path: null
repo: https://github.com/googleapis/sphinx-docfx-yaml
startLine: null
summary: 'Returns an appropriate transport class.
Expand All @@ -413,10 +365,6 @@ items:
source:
id: list_voices
path: tests/testdata/gapic-auto/google/cloud/texttospeech_v1/services/text_to_speech/async_client.py
remote:
branch: add_goldens
path: tests/testdata/gapic-auto/google/cloud/texttospeech_v1/services/text_to_speech/async_client.py
repo: https://github.com/googleapis/sphinx-docfx-yaml
startLine: 201
summary: "Returns a list of Voice supported for synthesis.\n\n```python\n# This\
\ snippet has been automatically generated and should be regarded as a\n# code\
Expand Down Expand Up @@ -477,10 +425,6 @@ items:
source:
id: model_path
path: tests/testdata/gapic-auto/google/cloud/texttospeech_v1/services/text_to_speech/client.py
remote:
branch: add_goldens
path: tests/testdata/gapic-auto/google/cloud/texttospeech_v1/services/text_to_speech/client.py
repo: https://github.com/googleapis/sphinx-docfx-yaml
startLine: 163
summary: 'Returns a fully-qualified model string.
Expand All @@ -501,10 +445,6 @@ items:
source:
id: parse_common_billing_account_path
path: tests/testdata/gapic-auto/google/cloud/texttospeech_v1/services/text_to_speech/client.py
remote:
branch: add_goldens
path: tests/testdata/gapic-auto/google/cloud/texttospeech_v1/services/text_to_speech/client.py
repo: https://github.com/googleapis/sphinx-docfx-yaml
startLine: 194
summary: 'Parse a billing_account path into its component segments.
Expand All @@ -525,10 +465,6 @@ items:
source:
id: parse_common_folder_path
path: tests/testdata/gapic-auto/google/cloud/texttospeech_v1/services/text_to_speech/client.py
remote:
branch: add_goldens
path: tests/testdata/gapic-auto/google/cloud/texttospeech_v1/services/text_to_speech/client.py
repo: https://github.com/googleapis/sphinx-docfx-yaml
startLine: 209
summary: 'Parse a folder path into its component segments.
Expand All @@ -549,10 +485,6 @@ items:
source:
id: parse_common_location_path
path: tests/testdata/gapic-auto/google/cloud/texttospeech_v1/services/text_to_speech/client.py
remote:
branch: add_goldens
path: tests/testdata/gapic-auto/google/cloud/texttospeech_v1/services/text_to_speech/client.py
repo: https://github.com/googleapis/sphinx-docfx-yaml
startLine: 256
summary: 'Parse a location path into its component segments.
Expand All @@ -573,10 +505,6 @@ items:
source:
id: parse_common_organization_path
path: tests/testdata/gapic-auto/google/cloud/texttospeech_v1/services/text_to_speech/client.py
remote:
branch: add_goldens
path: tests/testdata/gapic-auto/google/cloud/texttospeech_v1/services/text_to_speech/client.py
repo: https://github.com/googleapis/sphinx-docfx-yaml
startLine: 224
summary: 'Parse a organization path into its component segments.
Expand All @@ -597,10 +525,6 @@ items:
source:
id: parse_common_project_path
path: tests/testdata/gapic-auto/google/cloud/texttospeech_v1/services/text_to_speech/client.py
remote:
branch: add_goldens
path: tests/testdata/gapic-auto/google/cloud/texttospeech_v1/services/text_to_speech/client.py
repo: https://github.com/googleapis/sphinx-docfx-yaml
startLine: 239
summary: 'Parse a project path into its component segments.
Expand All @@ -621,10 +545,6 @@ items:
source:
id: parse_model_path
path: tests/testdata/gapic-auto/google/cloud/texttospeech_v1/services/text_to_speech/client.py
remote:
branch: add_goldens
path: tests/testdata/gapic-auto/google/cloud/texttospeech_v1/services/text_to_speech/client.py
repo: https://github.com/googleapis/sphinx-docfx-yaml
startLine: 176
summary: 'Parses a model path into its component segments.
Expand All @@ -645,10 +565,6 @@ items:
source:
id: synthesize_speech
path: tests/testdata/gapic-auto/google/cloud/texttospeech_v1/services/text_to_speech/async_client.py
remote:
branch: add_goldens
path: tests/testdata/gapic-auto/google/cloud/texttospeech_v1/services/text_to_speech/async_client.py
repo: https://github.com/googleapis/sphinx-docfx-yaml
startLine: 303
summary: "Synthesizes speech synchronously: receive results\nafter all text input\
\ has been processed.\n\n```python\n# This snippet has been automatically generated\
Expand Down Expand Up @@ -723,10 +639,6 @@ items:
source:
id: transport
path: null
remote:
branch: add_goldens
path: null
repo: https://github.com/googleapis/sphinx-docfx-yaml
startLine: null
summary: 'Returns the transport used by the client instance.
Expand Down
Loading

0 comments on commit 10ecc44

Please sign in to comment.