Skip to content
This repository has been archived by the owner on Dec 31, 2023. It is now read-only.

fix: include the compliance protos #222

Merged
merged 5 commits into from
Jan 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -571,8 +571,8 @@ async def get_vulnerability_occurrences_summary(
The request object. Request to get a vulnerability
summary for some set of occurrences.
parent (:class:`str`):
The name of the project to get a vulnerability summary
for in the form of ``projects/[PROJECT_ID]``.
Required. The name of the project to get a vulnerability
summary for in the form of ``projects/[PROJECT_ID]``.

This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -748,8 +748,8 @@ def get_vulnerability_occurrences_summary(
The request object. Request to get a vulnerability
summary for some set of occurrences.
parent (str):
The name of the project to get a vulnerability summary
for in the form of ``projects/[PROJECT_ID]``.
Required. The name of the project to get a vulnerability
summary for in the form of ``projects/[PROJECT_ID]``.

This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#
import proto # type: ignore

from grafeas.grafeas_v1.types import vulnerability # type: ignore
from grafeas.grafeas_v1.types import severity # type: ignore


__protobuf__ = proto.module(
Expand All @@ -33,8 +33,8 @@ class GetVulnerabilityOccurrencesSummaryRequest(proto.Message):

Attributes:
parent (str):
The name of the project to get a vulnerability summary for
in the form of ``projects/[PROJECT_ID]``.
Required. The name of the project to get a vulnerability
summary for in the form of ``projects/[PROJECT_ID]``.
filter (str):
The filter expression.
"""
Expand All @@ -60,7 +60,7 @@ class FixableTotalByDigest(proto.Message):
Attributes:
resource_uri (str):
The affected resource.
severity (grafeas.v1.vulnerability.Severity):
severity (grafeas.v1.severity.Severity):
The severity for this count. SEVERITY_UNSPECIFIED indicates
total across all severities.
fixable_count (int):
Expand All @@ -72,7 +72,7 @@ class FixableTotalByDigest(proto.Message):
"""

resource_uri = proto.Field(proto.STRING, number=1,)
severity = proto.Field(proto.ENUM, number=2, enum=vulnerability.Severity,)
severity = proto.Field(proto.ENUM, number=2, enum=severity.Severity,)
fixable_count = proto.Field(proto.INT64, number=3,)
total_count = proto.Field(proto.INT64, number=4,)

Expand Down
62 changes: 4 additions & 58 deletions owlbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@
# Fix imported type from grafeas
s.replace(
library / "google/**/types/containeranalysis.py",
"from grafeas\.v1 import vulnerability_pb2",
"from grafeas.grafeas_v1.types import vulnerability"
"from grafeas\.v1 import severity_pb2",
"from grafeas.grafeas_v1.types import severity"
)

# Fix imported type from grafeas
s.replace(
library / "google/**/types/containeranalysis.py",
"vulnerability_pb2",
"vulnerability"
"severity_pb2",
"severity"
)

# Insert helper method to get grafeas client
Expand Down Expand Up @@ -113,58 +113,4 @@

python.py_samples(skip_readmes=True)

# Remove the replacements below once https://github.com/googleapis/synthtool/pull/1188 is merged

# Update googleapis/repo-automation-bots repo to main in .kokoro/*.sh files
s.replace(".kokoro/*.sh", "repo-automation-bots/tree/master", "repo-automation-bots/tree/main")

# Customize CONTRIBUTING.rst to replace master with main
s.replace(
"CONTRIBUTING.rst",
"fetch and merge changes from upstream into master",
"fetch and merge changes from upstream into main",
)

s.replace(
"CONTRIBUTING.rst",
"git merge upstream/master",
"git merge upstream/main",
)

s.replace(
"CONTRIBUTING.rst",
"""export GOOGLE_CLOUD_TESTING_BRANCH=\"master\"""",
"""export GOOGLE_CLOUD_TESTING_BRANCH=\"main\"""",
)

s.replace(
"CONTRIBUTING.rst",
"remote \(``master``\)",
"remote (``main``)",
)

s.replace(
"CONTRIBUTING.rst",
"blob/master/CONTRIBUTING.rst",
"blob/main/CONTRIBUTING.rst",
)

s.replace(
"CONTRIBUTING.rst",
"blob/master/noxfile.py",
"blob/main/noxfile.py",
)

s.replace(
"docs/conf.py",
"master_doc",
"root_doc",
)

s.replace(
"docs/conf.py",
"# The master toctree document.",
"# The root toctree document.",
)

s.shell.run(["nox", "-s", "blacken"], hide_output=False)
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"google-api-core[grpc] >= 1.28.0, <3.0.0dev",
"grpc-google-iam-v1 >= 0.12.3, < 0.13dev",
"proto-plus >= 1.4.0",
"grafeas >=1.0.0, <2.0dev",
"grafeas >=1.4.1, <2.0dev",
]
extras = {"libcst": "libcst >= 0.2.5"}

Expand Down
2 changes: 1 addition & 1 deletion testing/constraints-3.6.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ google-api-core==1.28.0
grpc-google-iam-v1==0.12.3
proto-plus==1.4.0
libcst==0.2.5
grafeas==1.0.0
grafeas==1.4.1