Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Custom Scheduler Name to Build and BuildRun objects #1770

Merged
merged 3 commits into from
Feb 21, 2025

Conversation

dorzel
Copy link
Contributor

@dorzel dorzel commented Jan 8, 2025

Changes

Fixes #1637

Submitter Checklist

  • Includes tests if functionality changed/was added
  • Includes docs if changes are user-facing
  • Set a kind label on this PR
  • Release notes block has been filled in, or marked NONE

See the contributor guide
for details on coding conventions, github and prow interactions, and the code review process.

Release Notes

Add Custom Scheduler Name to Build and BuildRun objects

@openshift-ci openshift-ci bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note Label for when a PR has specified a release note labels Jan 8, 2025
@pull-request-size pull-request-size bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Jan 8, 2025
@dorzel
Copy link
Contributor Author

dorzel commented Jan 8, 2025

/kind feature

@openshift-ci openshift-ci bot added the kind/feature Categorizes issue or PR as related to a new feature. label Jan 8, 2025
@dorzel dorzel force-pushed the MULTIARCH-5140 branch 4 times, most recently from 213215f to 02dfeeb Compare January 21, 2025 18:49
@dorzel dorzel force-pushed the MULTIARCH-5140 branch 4 times, most recently from 1997d43 to 47478bc Compare January 27, 2025 20:59
@dorzel dorzel force-pushed the MULTIARCH-5140 branch 3 times, most recently from 168706d to 8dca9b7 Compare January 30, 2025 19:17
@dorzel dorzel force-pushed the MULTIARCH-5140 branch 2 times, most recently from bf67139 to 95cf628 Compare February 4, 2025 18:44
@pull-request-size pull-request-size bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Feb 4, 2025
@pull-request-size pull-request-size bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Feb 4, 2025
@pull-request-size pull-request-size bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Feb 5, 2025
@pull-request-size pull-request-size bot removed the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 7, 2025
@dorzel dorzel force-pushed the MULTIARCH-5140 branch 4 times, most recently from 734e205 to 7c64e81 Compare February 12, 2025 19:29
@dorzel
Copy link
Contributor Author

dorzel commented Feb 12, 2025

Ok, this is ready for review. I relied on unit tests instead of creating a custom scheduler for testing, as was mentioned in https://github.com/shipwright-io/community/blob/main/ships/0039-build-scheduler-opts.md#test-plan. I also included the suggestions in the comments from #1711 in this PR.

@dorzel dorzel marked this pull request as ready for review February 12, 2025 20:34
@dorzel dorzel changed the title WIP Add Custom Scheduler Name to Build and BuildRun objects Add Custom Scheduler Name to Build and BuildRun objects Feb 12, 2025
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 12, 2025
Copy link
Member

@SaschaSchwarze0 SaschaSchwarze0 left a comment

Choose a reason for hiding this comment

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

Overall nice, please adjust the Go type.

@SaschaSchwarze0 SaschaSchwarze0 added the kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API label Feb 20, 2025
Signed-off-by: Dylan Orzel <dorzel@redhat.com>
Signed-off-by: Dylan Orzel <dorzel@redhat.com>
@dorzel dorzel force-pushed the MULTIARCH-5140 branch 3 times, most recently from 33d10f5 to fae087f Compare February 20, 2025 20:02
Copy link
Member

@SaschaSchwarze0 SaschaSchwarze0 left a comment

Choose a reason for hiding this comment

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

Looks good. Just two Expects that should be the other way around, I think.


tr, err := tb.GetTaskRunFromBuildRun(buildRunObject.Name)
Expect(err).To(BeNil())
Expect(*buildObject.Spec.SchedulerName).To(Equal(tr.Spec.PodTemplate.SchedulerName))
Copy link
Member

Choose a reason for hiding this comment

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

I think we should turn that around.

Suggested change
Expect(*buildObject.Spec.SchedulerName).To(Equal(tr.Spec.PodTemplate.SchedulerName))
Expect(tr.Spec.PodTemplate.SchedulerName).To(Equal(*buildObject.Spec.SchedulerName))


tr, err := tb.GetTaskRunFromBuildRun(buildRunObject.Name)
Expect(err).To(BeNil())
Expect(*br.Spec.SchedulerName).To(Equal(tr.Spec.PodTemplate.SchedulerName))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Expect(*br.Spec.SchedulerName).To(Equal(tr.Spec.PodTemplate.SchedulerName))
Expect(tr.Spec.PodTemplate.SchedulerName).To(Equal(*br.Spec.SchedulerName))

Signed-off-by: Dylan Orzel <dorzel@redhat.com>
Copy link
Member

@SaschaSchwarze0 SaschaSchwarze0 left a comment

Choose a reason for hiding this comment

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

/approve
/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 21, 2025
Copy link
Contributor

openshift-ci bot commented Feb 21, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: SaschaSchwarze0

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

The pull request process is described here

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 21, 2025
@SaschaSchwarze0 SaschaSchwarze0 added this to the release-v0.15.0 milestone Feb 21, 2025
@openshift-merge-bot openshift-merge-bot bot merged commit a3d5d5d into shipwright-io:main Feb 21, 2025
19 checks passed
@dorzel dorzel deleted the MULTIARCH-5140 branch February 24, 2025 16:32
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. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. release-note Label for when a PR has specified a release note size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

SHIP-0039: Allow custom scheduler to be used for Build and BuildRun
2 participants