Skip to content

Next

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
GitLab
GitLab
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 26,245
    • Issues 26,245
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 995
    • Merge Requests 995
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Packages
    • Packages
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issues
    • Repository
    • Value Stream
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • GitLab.org
  • GitLabGitLab
  • Merge Requests
  • !6303

Closed
Opened Jun 27, 2018 by Dylan Griffith@DylanGriffith🔴16 of 27 tasks completed16/27 tasks
  • Report abuse
Report abuse

WIP: Resolve "Protected environments"

  • Overview 112
  • Commits 51
  • Pipelines 52
  • Changes 82

What does this MR do?

It includes another section for "Protected Environments"

Are there points in the code the reviewer needs to double check?

  • Architectural review

Why was this MR needed?

Environments can be used for different scopes, so some of them are just for testing while others are for production. As deploy jobs could be raised by different users with different roles, it is very important that specific environments are "protected" to avoid unauthorized people to affect them. This feature ensures that only people with the right privileges can deploy code to the "protected" environments, keeping them safe

Screenshots (if relevant)

Form

without Protected Environments with Protected Environments
Screen_Shot_2018-07-24_at_6.07.58_PM Screen_Shot_2018-07-24_at_6.08.05_PM

Environments overview page

When user has access When user does not have access
Screen_Shot_2018-07-24_at_6.07.58_PM Screen_Shot_2018-07-24_at_6.08.05_PM

CI Job

With not enough permissions
Screen_Shot_2018-07-24_at_5.47.54_PM

Does this MR meet the acceptance criteria?

  • Changelog entry added, if necessary
  • Documentation created/updated
  • Tests added for this feature/bug
  • Conform by the code review guidelines
    • Has been reviewed by a UX Designer
    • Has been reviewed by a Frontend maintainer
    • Has been reviewed by a Backend maintainer
    • Has been reviewed by a Database specialist
  • EE specific content should be in the top level /ee folder
  • Conform by the merge request performance guides
  • Conform by the style guides
  • If you have multiple commits, please combine them into a few logically organized commits by squashing them
  • Internationalization required/considered
  • If paid feature, have we considered GitLab.com plan and how it works for groups and is there a design for promoting it to users who aren't on the correct plan
  • End-to-end tests pass (package-and-qa manual pipeline job)

To do (Backend)

  • Implement Environment Dropdown for "Protect an environment" widget
  • Save Protected Environments into database
  • Create table for "Protected environments" (UI)
  • Add column for "Last Deployment" (UI)
  • Modify Environments API for Environment overview page (https://gitlab.com/gitlab-org/gitlab-ee/issues/2747#environment-overview-page)
  • Model, controller, services logic
  • Specs for model, controller and services
  • Add proper policies
  • Feature specs for UI
  • CI modifications. (New failure_reason)
  • Modify retryable and playable actions to take into account ProtectedEnvironments
  • Enable feature only for GitLab Premium
  • Prepare a script for UX so they can easily test this: https://gitlab.com/snippets/1736674

What are the relevant issue numbers?

Closes #2747 (closed)

Edited Jul 25, 2018 by Mayra Cabrera

Check out, review, and merge locally

Step 1. Fetch and check out the branch for this merge request

git fetch origin
git checkout -b "2747-protected-environments" "origin/2747-protected-environments"

Step 2. Review the changes locally

Step 3. Merge the branch and fix any conflicts that come up

git fetch origin
git checkout "origin/master"
git merge --no-ff "2747-protected-environments"

Step 4. Push the result of the merge to GitLab

git push origin "master"

Note that pushing to GitLab requires write access to this repository.

Tip: You can also checkout merge requests locally by following these guidelines.

Assignee
Assign to
11.2
Milestone
11.2
Assign milestone
Time tracking
4
Labels
Enterprise Edition database devopsconfigure grouporchestration
Assign labels
  • View project labels
Reference: gitlab-org/gitlab!6303