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

move pkg/build to external client and types #20659

Merged
merged 19 commits into from
Aug 21, 2018

Conversation

mfojtik
Copy link
Contributor

@mfojtik mfojtik commented Aug 15, 2018

Moves pkg/build to external clients and external types.

Follow ups:

  • Move relevant consts and vars from consts.go to library-go or openshift/api
  • Move extended tests to external clients
  • Move generator to external client (so we can get rid of internal build client)
  • Sort out mixed internal and external printers

/cc @bparees
/cc @deads2k

@openshift-ci-robot openshift-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Aug 15, 2018
@mfojtik mfojtik force-pushed the build-01-external branch from b7f1d9e to 81ccd3e Compare August 15, 2018 18:44
@bparees
Copy link
Contributor

bparees commented Aug 15, 2018

this isn't going into 3.11 is it?

@adambkaplan @coreydaley @nalind fyi, i don't think this will conflict w/ anything you're doing since that code should be using the external api already, if it's doing anything.

@mfojtik
Copy link
Contributor Author

mfojtik commented Aug 15, 2018

@bparees I don't see a reason why this should not land in 3.11 (this is not a feature, just technical debt)

@mfojtik
Copy link
Contributor Author

mfojtik commented Aug 15, 2018

For CLI parts:

/cc @soltysh
/cc @juanvallejo

@openshift-ci-robot
Copy link

@mfojtik: GitHub didn't allow me to request PR reviews from the following users: or, for, CLI, parts.

Note that only openshift members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @soltysh or @juanvallejo for CLI parts

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.

@mfojtik
Copy link
Contributor Author

mfojtik commented Aug 15, 2018

FYI: I will split this big commit into interesting and boring changes tomorrow (and this will be ready for review)

@bparees
Copy link
Contributor

bparees commented Aug 15, 2018

@bparees I don't see a reason why this should not land in 3.11 (this is not a feature, just technical debt)

well we are trying to minimize the risk of 3.11 slipping, so if there's any chance this can regress something, that is a reason not to do it in 3.11.

@jwforres
Copy link
Member

jwforres commented Aug 15, 2018

why are we merging any significant changesets to the 3.11 codestream? I agree with ben here, this seems like a bad idea. Especially given that we are actively trying to get branches set up ASAP for 3.11 maintenance

@derekwaynecarr
Copy link
Member

i followed up off list, but i think this pr is low risk and has future benefits.

@mfojtik mfojtik force-pushed the build-01-external branch 6 times, most recently from 9726f21 to 96c5791 Compare August 16, 2018 14:41
@@ -10,6 +10,7 @@ import (
"github.com/docker/distribution/registry/api/errcode"
"github.com/golang/glog"

corev1 "k8s.io/api/core/v1"
Copy link
Contributor

@juanvallejo juanvallejo Aug 16, 2018

Choose a reason for hiding this comment

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

This might conflict with @soltysh 's current PR :)

from := buildapihelpers.GetInputReference(strategy)
func (p *pruner) addBuildStrategyImageReferencesToGraph(referrer *corev1.ObjectReference, strategy buildapi.BuildStrategy, predecessor gonum.Node) []error {
externalStrategy := buildv1.BuildStrategy{}
if err := legacyscheme.Scheme.Convert(&strategy, &externalStrategy, nil); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we use pkg/build/apis/build/v1#Convert_build_BuildStrategy_To_v1_BuildStrategy instead here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

both legacyscheme and this are ugly, I found legacyscheme a little less ugly as it allow us to track the usages

@@ -217,7 +217,7 @@ func (o *CancelBuildOptions) RunCancelBuild() error {
return err
}

if stateMatch && !buildutil.IsTerminalPhase(internalBuildStatus.Phase) {
if stateMatch && !buildapi.IsInternalTerminalPhase(internalBuildStatus.Phase) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: s/IsInternalTerminalPhase/IsTerminalPhaseInternal

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that sounds like the intent of that check is to determine if the phase is "internal" ;-)

Copy link
Contributor

Choose a reason for hiding this comment

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

"is internal terminal phase" sounds like that too. So let's go w/ @juanvallejo's suggestion so it's at least consistent w/ the other helpers, unless there's a third alternative.

@@ -371,21 +371,32 @@ func (o *EnvOptions) RunEnv() error {
continue
}

// TODO: For Maciej: the ConvertInteralPodSpecToExternal should not be needed?
Copy link
Contributor

Choose a reason for hiding this comment

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


triggerExternal := &buildv1.BuildTriggerPolicy{}

if err := legacyscheme.Scheme.Convert(&trigger, triggerExternal, nil); err != nil {
Copy link
Contributor

@juanvallejo juanvallejo Aug 16, 2018

Choose a reason for hiding this comment

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

Convert_build_BuildTriggerPolicy_To_v1_BuildTriggerPolicy?

@@ -256,7 +258,7 @@ func printTemplateList(list *templateapi.TemplateList, w io.Writer, opts kprinte
return nil
}

func printBuild(build *buildapi.Build, w io.Writer, opts kprinters.PrintOptions) error {
func printBuild(build *buildv1.Build, w io.Writer, opts kprinters.PrintOptions) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

hm, does it make sense to have external handlers in the internalversion package? Might make more sense to duplicate externals into a package of their own within oc tree?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agree, I don't like mixing these here as well, but I don't want to bloat this PR with that change. Will you be ok with follow up to fix this?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep, followup PR is fine

@juanvallejo
Copy link
Contributor

left a few comments for cli pieces. A portion of the changes will overlap with Maciej's graph PR

@mfojtik mfojtik force-pushed the build-01-external branch from 96c5791 to ee165b5 Compare August 17, 2018 10:10
@mfojtik mfojtik force-pushed the build-01-external branch from 560d071 to f6c1d1c Compare August 21, 2018 09:02
@mfojtik
Copy link
Contributor Author

mfojtik commented Aug 21, 2018

@deads2k @bparees @soltysh this should get green tests and should merge immediately after tagged. There are couple follow ups here that we can distribute perhaps:

  1. We need to move generator to external client and types
  2. We need to move GIT server and template instances to external client so we can delete internal build client
  3. @juanvallejo @soltysh I copied the pkg/envresolve to pkg/envresolve/internal_version... @juanvallejo please delete it in your PR where you switching the oc set to external
  4. External tests should move to external client (kind of required for 2)

@mfojtik
Copy link
Contributor Author

mfojtik commented Aug 21, 2018

/retest

3 similar comments
@mfojtik
Copy link
Contributor Author

mfojtik commented Aug 21, 2018

/retest

@mfojtik
Copy link
Contributor Author

mfojtik commented Aug 21, 2018

/retest

@mfojtik
Copy link
Contributor Author

mfojtik commented Aug 21, 2018

/retest

Copy link
Contributor

@soltysh soltysh left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 21, 2018
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mfojtik, soltysh

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-merge-robot openshift-merge-robot merged commit 305555a into openshift:master Aug 21, 2018
@mfojtik mfojtik deleted the build-01-external branch September 5, 2018 21:07
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. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants