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 ability to create PipelineRun from YAML [codemirror] #2575

Merged
merged 1 commit into from
Nov 18, 2022

Conversation

marniks7
Copy link
Contributor

@marniks7 marniks7 commented Nov 10, 2022

Changes

Add ability to create PipelineRun from YAML

  1. YAML Mode button on Create Pipeline Page
    image
  2. YAML Mode
    image
  3. New page part is accessible by direct url #/pipelineruns/create?mode=yaml
  4. On create: Validation for non specified pipelinerun
  5. On create: Validation for not specified namespace (namespace in top right corner is ignored even if it is not 'all namespaces`)
  6. On create: Error handling for backend error response
  7. On create: Validation for non parsed yaml

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • Docs included if any changes are user facing
  • Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including
    functionality, content, code)
  • Has a kind label. You can add one by adding a comment on this PR that contains /kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tep
  • Release notes block below has been updated with any user facing changes (new features, significant UI changes, API changes, bug fixes, changes requiring upgrade notices or deprecation warnings)
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

Feature: Add ability to create PipelineRun from YAML

@tekton-robot tekton-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Nov 10, 2022
@tekton-robot
Copy link
Contributor

Hi @marniks7. Thanks for your PR.

I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@tekton-robot tekton-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Nov 10, 2022
@marniks7
Copy link
Contributor Author

/kind feature

@tekton-robot tekton-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Nov 10, 2022
@marniks7 marniks7 changed the title Add yaml mode for create pipelinerun page Add ability to create PipelineRun from YAML Nov 10, 2022
@marniks7 marniks7 changed the title Add ability to create PipelineRun from YAML Add ability to create PipelineRun from YAML [codemirror] Nov 10, 2022
@marniks7
Copy link
Contributor Author

/assign @AlanGreene

@AlanGreene
Copy link
Member

/ok-to-test

@tekton-robot tekton-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 14, 2022
Copy link
Member

@AlanGreene AlanGreene left a comment

Choose a reason for hiding this comment

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

This is looking great @marniks7, thanks for switching to the new editor. I've left a few comments, mostly related to naming / consistency, nothing too major.

I've also left a comment about the CSP value and a pointer to where it needs to be configured for the production build.

Let me know if you have any questions.

src/containers/CreatePipelineRun/YAMLEditor.test.js Outdated Show resolved Hide resolved
src/containers/CreatePipelineRun/YAMLEditor.test.js Outdated Show resolved Hide resolved
src/containers/CreatePipelineRun/YAMLEditor.test.js Outdated Show resolved Hide resolved
packages/e2e/cypress/e2e/run/create-pipelinerun.cy.js Outdated Show resolved Hide resolved
src/containers/CreatePipelineRun/YAMLEditor.js Outdated Show resolved Hide resolved
src/containers/CreatePipelineRun/YAMLEditor.js Outdated Show resolved Hide resolved
src/containers/CreatePipelineRun/YAMLEditor.js Outdated Show resolved Hide resolved
src/containers/CreatePipelineRun/YAMLEditor.js Outdated Show resolved Hide resolved
webpack.dev.js Outdated Show resolved Hide resolved
@tekton-robot tekton-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 14, 2022
@marniks7 marniks7 force-pushed the codemirror branch 2 times, most recently from 663b154 to f771ac9 Compare November 15, 2022 05:08
@tekton-robot tekton-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 15, 2022
pkg/router/router.go Outdated Show resolved Hide resolved
packages/e2e/cypress/e2e/run/create-pipelinerun.cy.js Outdated Show resolved Hide resolved
packages/e2e/cypress/e2e/run/create-pipelinerun.cy.js Outdated Show resolved Hide resolved
Copy link
Member

@AlanGreene AlanGreene left a comment

Choose a reason for hiding this comment

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

I found a bit of a styling issue in dark mode, the colour contrast for some of the YAML tokens is very low rendering them practically invisible.

image

Here's the text highlighted:
image

We should load a dark theme to handle this. In future we will likely roll our own theme to match the rest of the app but for now one of the defaults will be sufficient.

Otherwise this looks great 👍 Thanks for all your hard work so far and quick turnaround on feedback, it's very much appreciated.

@tekton-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: AlanGreene

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

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 16, 2022
@marniks7
Copy link
Contributor Author

Changed to theme=dark. Tested in both light and dark tekton themes - looks good.

@AlanGreene
Copy link
Member

Thanks @marniks7
/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 18, 2022
@tekton-robot tekton-robot merged commit 051c9c9 into tektoncd:main Nov 18, 2022
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/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants