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

Create buildConfig or pipeline based on user input #6874

Merged
merged 6 commits into from Nov 3, 2020

Conversation

divyanshiGupta
Copy link
Contributor

@divyanshiGupta divyanshiGupta commented Oct 8, 2020

Story: https://issues.redhat.com/browse/ODC-3779

  • This PR adds the functionality to create pipeline or buildConfig based on user input. If add-pipeline is selected then build configuration advanced option will not be shown.
  • Also if a user adds a pipeline during app creation then on submit the pipeline will now start automatically (pipelineRun gets created on submit) using the created resources.
  • Builds section will not be shown in the sidebar if buildConfig is not present and the app was created using import flows. The latter check is added to make sure that if D/DC was created using CLI/import from yaml then we show the builds section at all times to let the user know that they havent added a buildConfig. Also showing waiting for build alert similar to what is shown in case of buildConfig.
  • Show pipeline not started icon in build-decorator when pipeline didnt get started on submit.
  • Refactored the edit application utilities to get the git and docker specific values from associated pipeline so that the edit flow doesn't break. Also getting the buildStrategy (source/docker) from the associated pipeline since now there can either be a buildConfig or pipeline.

Gif:
Peek 2020-10-14 16-45

Unit test coverage:
image
image
image

@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. component/core Related to console core functionality labels Oct 8, 2020
@openshift-ci-robot openshift-ci-robot added component/dev-console Related to dev-console component/shared Related to console-shared labels Oct 8, 2020
@andrewballantyne
Copy link
Contributor

/cc @karthikjeeyar @andrewballantyne

@divyanshiGupta divyanshiGupta changed the title [WIP]Create buildConfig or pipeline based on user input Create buildConfig or pipeline based on user input Oct 12, 2020
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 12, 2020
@divyanshiGupta
Copy link
Contributor Author

divyanshiGupta commented Oct 14, 2020

@karthikjeeyar we will also need another story for adding the functionality to edit pipeline using the edit app flow because as I mentioned above previously edit flow used to get git data from buildConfig and if the git data was changed then the new values were added to the buildConfig and it was updated but since now if a pipeline is added there will be no buildConfig and thus I am getting git data from the pipeline for the edit flow but as we do not have the functionality for editing/updating the pipeline the changed data is not propagated back to the pipeline. cc: @serenamarie125

@karthikjeeyar
Copy link
Contributor

@divyanshiGupta When you say git data, is it the url and branch name? If Yes, can we use the Deployemnt/DeploymentConfig/KSVC resource's metadata annotations like app.openshift.io/vcs-ref (branch Name) , app.openshift.io/vcs-uri (URL) to pull the data. WDYT?

@divyanshiGupta
Copy link
Contributor Author

divyanshiGupta commented Oct 16, 2020

@divyanshiGupta When you say git data, is it the url and branch name? If Yes, can we use the Deployemnt/DeploymentConfig/KSVC resource's metadata annotations like app.openshift.io/vcs-ref (branch Name) , app.openshift.io/vcs-uri (URL) to pull the data. WDYT?

@karthikjeeyar it's not about from where to get the data but if that data is changed it should be propagated to all the resources that use that data in someway. For example the associated pipeline has a git URL param and we can get that data from this param but if git URL changes we need the functionality to update the git URL param of the pipeline thereby updating the pipeline. Currently we don't have the functionality to update the pipeline using edit flows since we were using buildConfig to build the image but now since we are also using pipeline to the build the image we need to have this functionality. It's not just about updating the git params but also we need to decide upon if we want to show the pipeline section and stuff like that and that's where UX input is needed.

@karthikjeeyar
Copy link
Contributor

@divyanshiGupta I have created a story ODC-5018 to capture the improvements around the edit flows, you have mentioned above.

@karthikjeeyar
Copy link
Contributor

Verified locally, works as expected
/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 19, 2020
@karthikjeeyar
Copy link
Contributor

/retest

@karthikjeeyar
Copy link
Contributor

/kind feature

@openshift-ci-robot openshift-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Oct 19, 2020
Copy link

@bgliwa01 bgliwa01 left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Contributor

@andrewballantyne andrewballantyne left a comment

Choose a reason for hiding this comment

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

Few nits and a change I am unsure I understand. Looks like you were removing support for resources but then added support for resources elsewhere.

Comment on lines +82 to +57
case 'DOCKERFILE':
return { ...param, default: dockerfilePath };
Copy link
Contributor

Choose a reason for hiding this comment

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

+1, good catch. This should have been added by the other work. I forgot about the dockerfile flow Pipeline section 🤦

Copy link
Contributor

Choose a reason for hiding this comment

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

@jerolimov I think we may want to look at back-porting this to piggyback on the work you did for the other params.

cc @karthikjeeyar

@@ -92,6 +93,9 @@ export const Status: React.FC<StatusProps> = ({
case 'Unknown':
return <StatusIconAndText {...statusProps} icon={<UnknownIcon />} />;

case 'PipelineNotStarted':
return <StatusIconAndText {...statusProps} icon={<OutlinedHourglassIcon />} />;
Copy link
Contributor

Choose a reason for hiding this comment

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

Created a Story to update this icon now they have it figured out. https://issues.redhat.com/browse/ODC-5047

frontend/packages/dev-console/src/utils/pipeline-utils.ts Outdated Show resolved Hide resolved
);
} else if (pipeline.template && !dryRun) {
const newPipeline = await createPipelineForImportFlow(formData);
requests.push(createPipelineRunForImportFlow(formData, newPipeline));
Copy link
Contributor

Choose a reason for hiding this comment

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

Also, if this fails (which I don't think is possible today) we'll need to not cancel the submit flow. I've created another story (https://issues.redhat.com/browse/ODC-5048) to chase this down as it may require hacking up the resource in order to test it. No sense in holding up this PR for potentially a non-starter flow.

Copy link
Contributor

@andrewballantyne andrewballantyne left a comment

Choose a reason for hiding this comment

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

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 30, 2020
Copy link
Contributor

@rohitkrai03 rohitkrai03 left a comment

Choose a reason for hiding this comment

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

/approve

@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andrewballantyne, bgliwa01, divyanshiGupta, karthikjeeyar, rohitkrai03

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-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 3, 2020
@openshift-merge-robot
Copy link
Contributor

@divyanshiGupta: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/e2e-gcp-console e2db668 link /test e2e-gcp-console

Full PR test history. Your PR dashboard.

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.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit 5a69792 into openshift:master Nov 3, 2020
@spadgett spadgett added this to the v4.7 milestone Nov 4, 2020
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. component/core Related to console core functionality component/dev-console Related to dev-console component/shared Related to console-shared kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants