Skip to content

Commit

Permalink
feat: [google-cloud-deploy] A new field timed_promote_release_rule
Browse files Browse the repository at this point in the history
…is added to message `.google.cloud.deploy.v1.AutomationRule` (#13274)

- [ ] Regenerate this pull request now.

BEGIN_COMMIT_OVERRIDE
feat: A new field `timed_promote_release_rule` is added to message
`.google.cloud.deploy.v1.AutomationRule`
feat: A new message `TimedPromoteReleaseRule` is added
feat: A new field `timed_promote_release_condition` is added to message
`.google.cloud.deploy.v1.AutomationRuleCondition`
feat: A new message `TimedPromoteReleaseCondition` is added
feat: A new field `timed_promote_release_operation` is added to message
`.google.cloud.deploy.v1.AutomationRun`
feat: A new message `TimedPromoteReleaseOperation` is added
docs: A comment for field `target_id` in message
`.google.cloud.deploy.v1.AutomationRun` is changed
END_COMMIT_OVERRIDE


PiperOrigin-RevId: 695827924

Source-Link:
googleapis/googleapis@4805138

Source-Link:
googleapis/googleapis-gen@2b3fa48
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRlcGxveS8uT3dsQm90LnlhbWwiLCJoIjoiMmIzZmE0OGQ0YTNmZDA5ZTU3NjZmZTJkZDY1YWE2NmRkOTdjMTcyYSJ9

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Nov 13, 2024
1 parent 511d7cc commit f7470ad
Show file tree
Hide file tree
Showing 8 changed files with 240 additions and 8 deletions.
6 changes: 6 additions & 0 deletions packages/google-cloud-deploy/google/cloud/deploy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@
TargetsTypeCondition,
TerminateJobRunRequest,
TerminateJobRunResponse,
TimedPromoteReleaseCondition,
TimedPromoteReleaseOperation,
TimedPromoteReleaseRule,
TimeWindows,
UpdateAutomationRequest,
UpdateCustomTargetTypeRequest,
Expand Down Expand Up @@ -367,6 +370,9 @@
"TargetsTypeCondition",
"TerminateJobRunRequest",
"TerminateJobRunResponse",
"TimedPromoteReleaseCondition",
"TimedPromoteReleaseOperation",
"TimedPromoteReleaseRule",
"TimeWindows",
"UpdateAutomationRequest",
"UpdateCustomTargetTypeRequest",
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__ = "2.3.0" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@
TargetsTypeCondition,
TerminateJobRunRequest,
TerminateJobRunResponse,
TimedPromoteReleaseCondition,
TimedPromoteReleaseOperation,
TimedPromoteReleaseRule,
TimeWindows,
UpdateAutomationRequest,
UpdateCustomTargetTypeRequest,
Expand Down Expand Up @@ -366,6 +369,9 @@
"TerminateJobRunRequest",
"TerminateJobRunResponse",
"TimeWindows",
"TimedPromoteReleaseCondition",
"TimedPromoteReleaseOperation",
"TimedPromoteReleaseRule",
"Type",
"UpdateAutomationRequest",
"UpdateCustomTargetTypeRequest",
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__ = "2.3.0" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,9 @@
TargetsTypeCondition,
TerminateJobRunRequest,
TerminateJobRunResponse,
TimedPromoteReleaseCondition,
TimedPromoteReleaseOperation,
TimedPromoteReleaseRule,
TimeWindows,
UpdateAutomationRequest,
UpdateCustomTargetTypeRequest,
Expand Down Expand Up @@ -340,6 +343,9 @@
"TargetsTypeCondition",
"TerminateJobRunRequest",
"TerminateJobRunResponse",
"TimedPromoteReleaseCondition",
"TimedPromoteReleaseOperation",
"TimedPromoteReleaseRule",
"TimeWindows",
"UpdateAutomationRequest",
"UpdateCustomTargetTypeRequest",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,15 @@
"Automation",
"AutomationResourceSelector",
"AutomationRule",
"TimedPromoteReleaseRule",
"PromoteReleaseRule",
"AdvanceRolloutRule",
"RepairRolloutRule",
"RepairPhaseConfig",
"Retry",
"Rollback",
"AutomationRuleCondition",
"TimedPromoteReleaseCondition",
"CreateAutomationRequest",
"UpdateAutomationRequest",
"DeleteAutomationRequest",
Expand All @@ -179,6 +181,7 @@
"PromoteReleaseOperation",
"AdvanceRolloutOperation",
"RepairRolloutOperation",
"TimedPromoteReleaseOperation",
"RepairPhase",
"RetryPhase",
"RetryAttempt",
Expand Down Expand Up @@ -6517,6 +6520,12 @@ class AutomationRule(proto.Message):
Optional. The ``RepairRolloutRule`` will automatically
repair a failed rollout.
This field is a member of `oneof`_ ``rule``.
timed_promote_release_rule (google.cloud.deploy_v1.types.TimedPromoteReleaseRule):
Optional. The ``TimedPromoteReleaseRule`` will automatically
promote a release from the current target(s) to the
specified target(s) on a configured schedule.
This field is a member of `oneof`_ ``rule``.
"""

Expand All @@ -6538,6 +6547,73 @@ class AutomationRule(proto.Message):
oneof="rule",
message="RepairRolloutRule",
)
timed_promote_release_rule: "TimedPromoteReleaseRule" = proto.Field(
proto.MESSAGE,
number=4,
oneof="rule",
message="TimedPromoteReleaseRule",
)


class TimedPromoteReleaseRule(proto.Message):
r"""The ``TimedPromoteReleaseRule`` will automatically promote a release
from the current target(s) to the specified target(s) on a
configured schedule.
Attributes:
id (str):
Required. ID of the rule. This ID must be unique in the
``Automation`` resource to which this rule belongs. The
format is ``[a-z]([a-z0-9-]{0,61}[a-z0-9])?``.
destination_target_id (str):
Optional. The ID of the stage in the pipeline to which this
``Release`` is deploying. If unspecified, default it to the
next stage in the promotion flow. The value of this field
could be one of the following:
- The last segment of a target name
- "@next", the next target in the promotion sequence
schedule (str):
Required. Schedule in crontab format. e.g. "0 9 \* \* 1" for
every Monday at 9am.
time_zone (str):
Required. The time zone in IANA format `IANA Time Zone
Database <https://www.iana.org/time-zones>`__ (e.g.
America/New_York).
condition (google.cloud.deploy_v1.types.AutomationRuleCondition):
Output only. Information around the state of
the Automation rule.
destination_phase (str):
Optional. The starting phase of the rollout
created by this rule. Default to the first
phase.
"""

id: str = proto.Field(
proto.STRING,
number=1,
)
destination_target_id: str = proto.Field(
proto.STRING,
number=2,
)
schedule: str = proto.Field(
proto.STRING,
number=3,
)
time_zone: str = proto.Field(
proto.STRING,
number=4,
)
condition: "AutomationRuleCondition" = proto.Field(
proto.MESSAGE,
number=5,
message="AutomationRuleCondition",
)
destination_phase: str = proto.Field(
proto.STRING,
number=6,
)


class PromoteReleaseRule(proto.Message):
Expand Down Expand Up @@ -6791,17 +6867,77 @@ class AutomationRuleCondition(proto.Message):
r"""``AutomationRuleCondition`` contains conditions relevant to an
``Automation`` rule.
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
Attributes:
targets_present_condition (google.cloud.deploy_v1.types.TargetsPresentCondition):
Optional. Details around targets enumerated
in the rule.
timed_promote_release_condition (google.cloud.deploy_v1.types.TimedPromoteReleaseCondition):
Optional. TimedPromoteReleaseCondition
contains rule conditions specific to a an
Automation with a timed promote release rule
defined.
This field is a member of `oneof`_ ``rule_type_condition``.
"""

targets_present_condition: "TargetsPresentCondition" = proto.Field(
proto.MESSAGE,
number=1,
message="TargetsPresentCondition",
)
timed_promote_release_condition: "TimedPromoteReleaseCondition" = proto.Field(
proto.MESSAGE,
number=2,
oneof="rule_type_condition",
message="TimedPromoteReleaseCondition",
)


class TimedPromoteReleaseCondition(proto.Message):
r"""``TimedPromoteReleaseCondition`` contains conditions specific to an
Automation with a Timed Promote Release rule defined.
Attributes:
next_promotion_time (google.protobuf.timestamp_pb2.Timestamp):
Output only. When the next scheduled
promotion(s) will occur.
targets_list (MutableSequence[google.cloud.deploy_v1.types.TimedPromoteReleaseCondition.Targets]):
Output only. A list of targets involved in
the upcoming timed promotion(s).
"""

class Targets(proto.Message):
r"""The targets involved in a single timed promotion.
Attributes:
source_target_id (str):
Optional. The source target ID.
destination_target_id (str):
Optional. The destination target ID.
"""

source_target_id: str = proto.Field(
proto.STRING,
number=1,
)
destination_target_id: str = proto.Field(
proto.STRING,
number=2,
)

next_promotion_time: timestamp_pb2.Timestamp = proto.Field(
proto.MESSAGE,
number=1,
message=timestamp_pb2.Timestamp,
)
targets_list: MutableSequence[Targets] = proto.RepeatedField(
proto.MESSAGE,
number=2,
message=Targets,
)


class CreateAutomationRequest(proto.Message):
Expand Down Expand Up @@ -7131,9 +7267,9 @@ class AutomationRun(proto.Message):
Output only. Snapshot of the Automation taken
at AutomationRun creation time.
target_id (str):
Output only. The ID of the target that represents the
promotion stage that initiates the ``AutomationRun``. The
value of this field is the last segment of a target name.
Output only. The ID of the source target that initiates the
``AutomationRun``. The value of this field is the last
segment of a target name.
state (google.cloud.deploy_v1.types.AutomationRun.State):
Output only. Current state of the ``AutomationRun``.
state_description (str):
Expand Down Expand Up @@ -7166,6 +7302,12 @@ class AutomationRun(proto.Message):
repair_rollout_operation (google.cloud.deploy_v1.types.RepairRolloutOperation):
Output only. Repairs a failed 'Rollout'.
This field is a member of `oneof`_ ``operation``.
timed_promote_release_operation (google.cloud.deploy_v1.types.TimedPromoteReleaseOperation):
Output only. Promotes a release to a
specified 'Target' as defined in a Timed Promote
Release rule.
This field is a member of `oneof`_ ``operation``.
wait_until_time (google.protobuf.timestamp_pb2.Timestamp):
Output only. Earliest time the ``AutomationRun`` will
Expand Down Expand Up @@ -7276,6 +7418,12 @@ class State(proto.Enum):
oneof="operation",
message="RepairRolloutOperation",
)
timed_promote_release_operation: "TimedPromoteReleaseOperation" = proto.Field(
proto.MESSAGE,
number=19,
oneof="operation",
message="TimedPromoteReleaseOperation",
)
wait_until_time: timestamp_pb2.Timestamp = proto.Field(
proto.MESSAGE,
number=16,
Expand Down Expand Up @@ -7407,6 +7555,38 @@ class RepairRolloutOperation(proto.Message):
)


class TimedPromoteReleaseOperation(proto.Message):
r"""Contains the information of an automated timed
promote-release operation.
Attributes:
target_id (str):
Output only. The ID of the target that
represents the promotion stage to which the
release will be promoted. The value of this
field is the last segment of a target name.
release (str):
Output only. The name of the release to be
promoted.
phase (str):
Output only. The starting phase of the
rollout created by this operation.
"""

target_id: str = proto.Field(
proto.STRING,
number=1,
)
release: str = proto.Field(
proto.STRING,
number=2,
)
phase: str = proto.Field(
proto.STRING,
number=3,
)


class RepairPhase(proto.Message):
r"""RepairPhase tracks the repair attempts that have been made for each
``RepairPhaseConfig`` specified in the ``Automation`` resource.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-deploy",
"version": "2.3.0"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
Loading

0 comments on commit f7470ad

Please sign in to comment.