Skip to content

Commit

Permalink
fix: make repository and repository_id in CreateRepository required (#…
Browse files Browse the repository at this point in the history
…11749)

BEGIN_COMMIT_OVERRIDE
fix: make repository and repository_id in CreateRepository required
END_COMMIT_OVERRIDE
- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 567370871

Source-Link:
googleapis/googleapis@50f45da

Source-Link:
googleapis/googleapis-gen@a7761fe
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWFydGlmYWN0LXJlZ2lzdHJ5Ly5Pd2xCb3QueWFtbCIsImgiOiJhNzc2MWZlZTdhZDM1MWM0YTAxZTcyYTlkMzQ0MjJlNjc2NGI2M2ZkIn0=

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: ohmayr <omairnaveed@ymail.com>
  • Loading branch information
3 people authored Sep 26, 2023
1 parent a18915b commit 3b8ea3e
Show file tree
Hide file tree
Showing 22 changed files with 77 additions and 56 deletions.
4 changes: 2 additions & 2 deletions packages/google-cloud-artifact-registry/CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,12 @@ Running System Tests
$ nox -s system

# Run a single system test
$ nox -s system- -- -k <name of test>
$ nox -s system-3.11 -- -k <name of test>


.. note::

System tests are only configured to run under Python.
System tests are only configured to run under Python 3.8, 3.9, 3.10 and 3.11.
For expediency, we do not run them in older versions of Python 3.

This alone will not run the tests. You'll need to change some local
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "1.8.3" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "1.8.3" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
from google.cloud.location import locations_pb2 # type: ignore
from google.iam.v1 import iam_policy_pb2 # type: ignore
from google.iam.v1 import policy_pb2 # type: ignore
from google.longrunning import operations_pb2
from google.longrunning import operations_pb2 # type: ignore
from google.protobuf import empty_pb2 # type: ignore
from google.protobuf import field_mask_pb2 # type: ignore
from google.protobuf import struct_pb2 # type: ignore
Expand Down Expand Up @@ -1597,6 +1597,7 @@ async def sample_create_repository():
# Initialize request argument(s)
request = artifactregistry_v1.CreateRepositoryRequest(
parent="parent_value",
repository_id="repository_id_value",
)
# Make the request
Expand Down Expand Up @@ -1999,6 +2000,7 @@ async def sample_list_packages():
Returns:
google.cloud.artifactregistry_v1.services.artifact_registry.pagers.ListPackagesAsyncPager:
The response from listing packages.
Iterating over this object will yield
results and resolve additional pages
automatically.
Expand Down Expand Up @@ -2337,6 +2339,7 @@ async def sample_list_versions():
Returns:
google.cloud.artifactregistry_v1.services.artifact_registry.pagers.ListVersionsAsyncPager:
The response from listing versions.
Iterating over this object will yield
results and resolve additional pages
automatically.
Expand Down Expand Up @@ -2674,6 +2677,7 @@ async def sample_list_files():
Returns:
google.cloud.artifactregistry_v1.services.artifact_registry.pagers.ListFilesAsyncPager:
The response from listing files.
Iterating over this object will yield
results and resolve additional pages
automatically.
Expand Down Expand Up @@ -2888,6 +2892,7 @@ async def sample_list_tags():
Returns:
google.cloud.artifactregistry_v1.services.artifact_registry.pagers.ListTagsAsyncPager:
The response from listing tags.
Iterating over this object will yield
results and resolve additional pages
automatically.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
from google.cloud.location import locations_pb2 # type: ignore
from google.iam.v1 import iam_policy_pb2 # type: ignore
from google.iam.v1 import policy_pb2 # type: ignore
from google.longrunning import operations_pb2
from google.longrunning import operations_pb2 # type: ignore
from google.protobuf import empty_pb2 # type: ignore
from google.protobuf import field_mask_pb2 # type: ignore
from google.protobuf import struct_pb2 # type: ignore
Expand Down Expand Up @@ -2070,6 +2070,7 @@ def sample_create_repository():
# Initialize request argument(s)
request = artifactregistry_v1.CreateRepositoryRequest(
parent="parent_value",
repository_id="repository_id_value",
)
# Make the request
Expand Down Expand Up @@ -2472,6 +2473,7 @@ def sample_list_packages():
Returns:
google.cloud.artifactregistry_v1.services.artifact_registry.pagers.ListPackagesPager:
The response from listing packages.
Iterating over this object will yield
results and resolve additional pages
automatically.
Expand Down Expand Up @@ -2810,6 +2812,7 @@ def sample_list_versions():
Returns:
google.cloud.artifactregistry_v1.services.artifact_registry.pagers.ListVersionsPager:
The response from listing versions.
Iterating over this object will yield
results and resolve additional pages
automatically.
Expand Down Expand Up @@ -3147,6 +3150,7 @@ def sample_list_files():
Returns:
google.cloud.artifactregistry_v1.services.artifact_registry.pagers.ListFilesPager:
The response from listing files.
Iterating over this object will yield
results and resolve additional pages
automatically.
Expand Down Expand Up @@ -3361,6 +3365,7 @@ def sample_list_tags():
Returns:
google.cloud.artifactregistry_v1.services.artifact_registry.pagers.ListTagsPager:
The response from listing tags.
Iterating over this object will yield
results and resolve additional pages
automatically.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
from google.auth.transport.grpc import SslCredentials # type: ignore
from google.auth.transport.requests import AuthorizedSession # type: ignore
from google.cloud.location import locations_pb2 # type: ignore
from google.longrunning import operations_pb2
from google.protobuf import json_format
import grpc # type: ignore
from requests import __version__ as requests_version
Expand Down Expand Up @@ -1334,7 +1333,9 @@ class _CreateRepository(ArtifactRegistryRestStub):
def __hash__(self):
return hash("CreateRepository")

__REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
__REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {
"repositoryId": "",
}

@classmethod
def _get_unset_required_fields(cls, message_dict):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class ProjectSettings(proto.Message):
Attributes:
name (str):
The name of the project's settings.
Always of the form:
projects/{project-id}/projectSettings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ class Tag(proto.Message):
version (str):
The name of the version the tag refers to,
for example:
"projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/sha256:5243811"
If the package or version ID parts contain
slashes, the slashes are escaped.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ class VPCSCConfig(proto.Message):
Attributes:
name (str):
The name of the project's VPC SC Config.
Always of the form:
projects/{projectID}/locations/{location}/vpcscConfig
In update request: never set
In response: always set
vpcsc_policy (google.cloud.artifactregistry_v1.types.VPCSCConfig.VPCSCPolicy):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "1.8.3" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -1134,6 +1134,7 @@ async def sample_list_packages():
Returns:
google.cloud.artifactregistry_v1beta2.services.artifact_registry.pagers.ListPackagesAsyncPager:
The response from listing packages.
Iterating over this object will yield
results and resolve additional pages
automatically.
Expand Down Expand Up @@ -1493,6 +1494,7 @@ async def sample_list_versions():
Returns:
google.cloud.artifactregistry_v1beta2.services.artifact_registry.pagers.ListVersionsAsyncPager:
The response from listing versions.
Iterating over this object will yield
results and resolve additional pages
automatically.
Expand Down Expand Up @@ -1842,7 +1844,6 @@ async def sample_list_files():
parent (:class:`str`):
The name of the repository whose
files will be listed. For example:
"projects/p1/locations/us-central1/repositories/repo1
This corresponds to the ``parent`` field
Expand All @@ -1857,6 +1858,7 @@ async def sample_list_files():
Returns:
google.cloud.artifactregistry_v1beta2.services.artifact_registry.pagers.ListFilesAsyncPager:
The response from listing files.
Iterating over this object will yield
results and resolve additional pages
automatically.
Expand Down Expand Up @@ -2086,6 +2088,7 @@ async def sample_list_tags():
Returns:
google.cloud.artifactregistry_v1beta2.services.artifact_registry.pagers.ListTagsAsyncPager:
The response from listing tags.
Iterating over this object will yield
results and resolve additional pages
automatically.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1461,6 +1461,7 @@ def sample_list_packages():
Returns:
google.cloud.artifactregistry_v1beta2.services.artifact_registry.pagers.ListPackagesPager:
The response from listing packages.
Iterating over this object will yield
results and resolve additional pages
automatically.
Expand Down Expand Up @@ -1793,6 +1794,7 @@ def sample_list_versions():
Returns:
google.cloud.artifactregistry_v1beta2.services.artifact_registry.pagers.ListVersionsPager:
The response from listing versions.
Iterating over this object will yield
results and resolve additional pages
automatically.
Expand Down Expand Up @@ -2115,7 +2117,6 @@ def sample_list_files():
parent (str):
The name of the repository whose
files will be listed. For example:
"projects/p1/locations/us-central1/repositories/repo1
This corresponds to the ``parent`` field
Expand All @@ -2130,6 +2131,7 @@ def sample_list_files():
Returns:
google.cloud.artifactregistry_v1beta2.services.artifact_registry.pagers.ListFilesPager:
The response from listing files.
Iterating over this object will yield
results and resolve additional pages
automatically.
Expand Down Expand Up @@ -2341,6 +2343,7 @@ def sample_list_tags():
Returns:
google.cloud.artifactregistry_v1beta2.services.artifact_registry.pagers.ListTagsPager:
The response from listing tags.
Iterating over this object will yield
results and resolve additional pages
automatically.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ class ListFilesRequest(proto.Message):
parent (str):
The name of the repository whose files will
be listed. For example:
"projects/p1/locations/us-central1/repositories/repo1
filter (str):
An expression for filtering the results of the request.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class ProjectSettings(proto.Message):
Attributes:
name (str):
The name of the project's settings.
Always of the form:
projects/{project-id}/projectSettings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ class Tag(proto.Message):
version (str):
The name of the version the tag refers to,
for example:
"projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/sha256:5243811"
If the package or version ID parts contain
slashes, the slashes are escaped.
Expand Down
23 changes: 1 addition & 22 deletions packages/google-cloud-artifact-registry/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
UNIT_TEST_EXTRAS = []
UNIT_TEST_EXTRAS_BY_PYTHON = {}

SYSTEM_TEST_PYTHON_VERSIONS = []
SYSTEM_TEST_PYTHON_VERSIONS = ["3.8", "3.9", "3.10", "3.11"]
SYSTEM_TEST_STANDARD_DEPENDENCIES = [
"mock",
"pytest",
Expand Down Expand Up @@ -405,24 +405,3 @@ def prerelease_deps(session):
session.run("python", "-c", "import google.auth; print(google.auth.__version__)")

session.run("py.test", "tests/unit")

system_test_path = os.path.join("tests", "system.py")
system_test_folder_path = os.path.join("tests", "system")

# Only run system tests if found.
if os.path.exists(system_test_path):
session.run(
"py.test",
"--verbose",
f"--junitxml=system_{session.python}_sponge_log.xml",
system_test_path,
*session.posargs,
)
if os.path.exists(system_test_folder_path):
session.run(
"py.test",
"--verbose",
f"--junitxml=system_{session.python}_sponge_log.xml",
system_test_folder_path,
*session.posargs,
)
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ async def sample_create_repository():
# Initialize request argument(s)
request = artifactregistry_v1.CreateRepositoryRequest(
parent="parent_value",
repository_id="repository_id_value",
)

# Make the request
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def sample_create_repository():
# Initialize request argument(s)
request = artifactregistry_v1.CreateRepositoryRequest(
parent="parent_value",
repository_id="repository_id_value",
)

# Make the request
Expand Down
Loading

0 comments on commit 3b8ea3e

Please sign in to comment.