Skip to content

Conversation

@GaneshSPatil
Copy link
Contributor

@GaneshSPatil GaneshSPatil commented May 31, 2019

Show Config Repository Pipeline Configurations in read-only mode

Top Level Changes

  • Show a warning indicating configuration can not be edited. Example: Can not edit pipeline 'yaml-example' as it is defined in the config repository!
  • Show config repo information (config repo id, config repo url) where pipeline configuration is defined.
  • Make /go/admin/pipelines/yaml-example/general page accessible for config repo pipelines
  • Make dashboard pipeline gear/settings icon clickable for all the pipelines. Remove special handling of config repo pipelines.

Pipeline Config Edit Page Changes

  • Disable/Remove Save button.

  • Disable/Remove Cancel button.

  • Pipeline

    • General Options
    • Project Management
    • Stages
      • Disable stage configuration type
      • Disable removal of the stages
      • Disable addition of new stage
      • Allow clicking stage name link which can take a user to the stages tab
    • Environment Variables
    • Parameters
  • Materials

    • Disable removal of material.
    • Disable adding of new material.
    • Allow clicking on the material name to see the material configurations but do not allow modifying any material configurations.
  • Stage

    • Stage Settings
    • Environment Variables
    • Permissions
    • Jobs
      • Disable removal of the jobs
      • Disable addition of a job
      • Allow clicking the job name link which can take a user to the jobs tab
  • Job

    • Job Settings
    • Artifacts
    • Environment Variables
    • Custom Tabs
    • Tasks
      • Disable removal of the task
      • Disable addition of the task
      • Allow clicking the task link to see the task configuration in a popup
  • Task

    • Show task configuration in read-only mode
  • Templates

    • Show templates read-only mode
    • Show link to edit the template configuration
  • Fix pages linking to the pipeline config edit page. Tracked separately at: Enable settings icon for config repo pipelines from all GoCD pages #7401

Screenshots

Screen Shot 2019-05-31 at 5 41 19 PM
Screen Shot 2019-05-31 at 5 41 34 PM
Screen Shot 2019-05-31 at 5 42 23 PM
Screen Shot 2019-05-31 at 5 42 31 PM
Screen Shot 2019-05-31 at 5 42 53 PM

@GaneshSPatil
Copy link
Contributor Author

@arvindsv @maheshp @ketan
This was a small spike to see if showing config repo pipeline configuration in read-only mode is possible or not. I think with some more efforts and small code change its doable.
As we are starting work on the pipeline config spa, so not sure if it still makes sense to put in efforts on the older pages.

@arvindsv
Copy link
Member

@GaneshSPatil Yes, given the work on pipeline config SPA, I think we should just hold on to this idea, to come back to if needed.

@GaneshSPatil
Copy link
Contributor Author

@arvindsv @adityasood -- As we're not doing new pipeline config SPA, should we consider doing this?

@gocd/committers Thoughts??

@arvindsv
Copy link
Member

@GaneshSPatil I think it's worth a look.

@GaneshSPatil GaneshSPatil reopened this Nov 26, 2019
@GaneshSPatil GaneshSPatil force-pushed the config-repo-pipeline-show-read-only-configurations branch from f8efd71 to dd28e7a Compare November 26, 2019 08:57
@GaneshSPatil GaneshSPatil self-assigned this Nov 26, 2019
@GaneshSPatil GaneshSPatil added this to the NextUp milestone Nov 26, 2019
@GaneshSPatil GaneshSPatil force-pushed the config-repo-pipeline-show-read-only-configurations branch 3 times, most recently from 0ddcc66 to c9d0b04 Compare November 29, 2019 08:31
@GaneshSPatil GaneshSPatil force-pushed the config-repo-pipeline-show-read-only-configurations branch 2 times, most recently from 25a2597 to 9d1e437 Compare December 2, 2019 06:05
@GaneshSPatil GaneshSPatil force-pushed the config-repo-pipeline-show-read-only-configurations branch 2 times, most recently from e4ebd2a to 41fc39b Compare December 3, 2019 05:57
@GaneshSPatil GaneshSPatil force-pushed the config-repo-pipeline-show-read-only-configurations branch from 41fc39b to 743125c Compare December 6, 2019 05:44
@GaneshSPatil GaneshSPatil marked this pull request as ready for review December 6, 2019 06:35
@GaneshSPatil
Copy link
Contributor Author

Following things couldn't be tested (mentioned with reasons)

@GaneshSPatil
Copy link
Contributor Author

Testing the changeset with YAML pipeline configuration:

prerequisite
  1. Install go-npm-poller package repository plugin.
  2. Define npmjs GoCD Package Repository.
  3. Install github-pr pluggable scm plugin.
  4. Install docker-registry-artifact-plugin external artifact plugin.
  5. Define store the GoCD artifact store.
  6. Define up42 pipeline having up42_stage stage.
format_version: 3
pipelines:
  pipeline1:
    group: first
    label_template: ${COUNT}
    lock_behavior: lockOnFailure
    tracking_tool:
      link: https://blah.com/${ID}
      regex: (+d)*
    display_order: -1
    timer:
      spec: 0 0 22 ? * *
      only_on_changes: true
    environment_variables:
      plain1: value1
      plain2: value2
    secure_variables:
      admin: AES:1PaiLQnpdzoknufcCdiJkA==:sI5UrvFmFJDvmN0NEzu8nQ==
    materials:
      git1:
        git: https://github.com/someone/someproject
        username: username
        shallow_clone: true
        auto_update: true
        branch: master
        destination: dest
        encrypted_password: AES:xdrx/ilIq0/v7gFwnLJHIA==:s4GuvBFK8UL/vTzU1IqzNw==
      pipeline-material:
        ignore_for_scheduling: true
        pipeline: up42
        stage: up42_stage
      subversion-1:
        svn: https://subversion.url.com
        username: admin
        check_externals: true
        auto_update: true
        destination: dest-2
        encrypted_password: AES:21RibmgqKr0PgZ46U3qngA==:/tX6KLB2t5RKJBSyfFGQcw==
      perforce:
        p4: https://perforceserver:567
        username: admin
        use_tickets: true
        view: this-is-a-very-pretty-perforce-view
        auto_update: true
        destination: dest-3
        encrypted_password: AES:9TANv/PaURebkL0ptKmzQQ==:1q/T4xYc8MZjTPdrBQndMw==
      mercurial:
        hg: https://mercurialserver.com
        username: admin
        auto_update: true
        branch: awesome
        destination: dest-4
        encrypted_password: AES:Xk7kcmDfGQ1lV6iVc3/T0g==:3/PY8d7OaWV29auuwiJwiQ==
      github-pr:
        scm: b787b203-091c-4fbf-881d-8b7d60b3f184
        blacklist:
        - blha/*
        destination: adsf-23
      npmjs_express:
        package: 513068fa-04b6-4093-82c1-1ea264eea07b
    stages:
    - stage:
        fetch_materials: true
        keep_artifacts: true
        clean_workspace: true
        approval:
          type: success
          allow_only_on_success: true
          roles:
          - xyz
          users:
          - jez
        environment_variables:
          env11: value11
        secure_variables:
          admin: AES:Sg3qhHAbAvgnEcFRLW0Csw==:d+e9SFOnrXn9ittPZRrX4Q==
        jobs:
          job:
            timeout: 10
            environment_variables:
              env1: value1
            secure_variables:
              admin: AES:/UmQCc+mLmct5zf9lp5jig==:XEaWlN6/Gmf1CLyqR27W/w==
            tabs:
              tab1: /path/to/home
              tab2: /path/to/home/again
            resources:
            - chrome
            - firefox
            - linux
            artifacts:
            - build:
                source: build-src
                destination: dest
            - test:
                source: test-src
                destination: testoutput
            - external:
                id: blah
                store_id: store
                configuration:
                  options:
                    BuildFile: ''
                    Tag: ''
                    Image: some-image
            tasks:
            - exec:
                on_cancel:
                  exec:
                    arguments:
                    - -f
                    - java
                    command: pkill
                    working_directory: something
                    run_if: passed
                arguments:
                - -alh
                command: ls
                working_directory: something
                run_if: failed
            - fetch:
                on_cancel:
                  exec:
                    arguments:
                    - -alh
                    command: ls
                    working_directory: something
                    run_if: passed
                is_file: true
                source: asfd
                destination: ''
                pipeline: up42
                stage: up42_stage
                job: up42_job
                run_if: passed
            - plugin:
                on_cancel:
                  exec:
                    arguments:
                    - -alhg
                    command: ls
                    working_directory: asdfa
                    run_if: passed
                configuration:
                  id: gradle.task.plugin
                  version: '1'
                options:
                  GradleHome: ''
                  Tasks: asdf
                  Daemon: 'true'
                  UseWrapper: 'true'
                  MakeWrapperExecutable: 'true'
                  Offline: 'true'
                  Debug: 'true'
                  AdditionalOptions: something:is-awesome
                run_if: passed
    parameters:
      param1: value1
      param2: value2

@GaneshSPatil
Copy link
Contributor Author

Merging all the commits from this PR as is, as the commits are made considering individual page/section changes and also include some minor bug fixes. It will be easier to revert a particular commit in-case something goes wrong.

@GaneshSPatil GaneshSPatil merged commit b2d9f17 into gocd:master Dec 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants