Skip to content

Stages.ByName/ByTarget/ThroughTarget: accept numbers#275

Merged
rhatdan merged 1 commit intoopenshift:masterfrom
nalind:target-integer
Jan 12, 2024
Merged

Stages.ByName/ByTarget/ThroughTarget: accept numbers#275
rhatdan merged 1 commit intoopenshift:masterfrom
nalind:target-integer

Conversation

@nalind
Copy link
Copy Markdown
Member

@nalind nalind commented Jan 11, 2024

Accept integer values in ByName(), ByTarget(), and ThroughTarget() as aliases for the stages with that "Position" value. Add a ByPosition() alongside ByName().

It would be faster to just index the stages directly instead of searching for a stage with the right Position value, but this lets us avoid a bounds check and is just easier to explain.

Fixes #274.

Accept integer values in ByName(), ByTarget(), and ThroughTarget() as
aliases for the stages with that "Position" value.  Add a ByPosition()
alongside ByName().

It would be faster to just index the stages directly instead of
searching for a stage with the right Position value, but this lets us
avoid a bounds check and is just easier to explain.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
@openshift-ci openshift-ci bot requested review from mrunalp and rhatdan January 11, 2024 21:24
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 11, 2024
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Jan 11, 2024

@nalind: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

Copy link
Copy Markdown
Contributor

@flouthoc flouthoc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@TomSweeneyRedHat
Copy link
Copy Markdown
Contributor

LGTM

@rhatdan
Copy link
Copy Markdown
Contributor

rhatdan commented Jan 12, 2024

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 12, 2024
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Jan 12, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: flouthoc, nalind, rhatdan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@rhatdan rhatdan merged commit e266867 into openshift:master Jan 12, 2024
@nalind nalind deleted the target-integer branch January 12, 2024 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generic way to build the first stage

4 participants