Skip to content
GitLab
Next
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • GitLab GitLab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 44,761
    • Issues 44,761
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1,329
    • Merge requests 1,329
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.orgGitLab.org
  • GitLabGitLab
  • Issues
  • #238174
Closed
Open
Issue created Aug 18, 2020 by Kamil Trzciński@ayufan🔴Maintainer8 of 8 checklist items completed8/8 checklist items

[Feature flag] Rollout of `ci_if_parenthesis_enabled`

What

Remove the :ci_if_parenthesis_enabled feature flag ...

Owners

  • Team: CI
  • Most appropriate slack channel to reach out to: #g_ci
  • Best individual to reach out to: @ayufan

Expectations

What are we expecting to happen?

Feature works.

What might happen if this goes wrong?

There's small risk associated with that change, as we fixed the operator precedence handling. It was broken before. This feature flag fixes it as well: !37574 (comment 385057724)

I also discovered that we have a bug today in the current implementation of if: and variables:. This:

$VAR1 == "a" || $VAR2 == "b" && $VAR3 == "c" || $VAR4 == "d" && $VAR5 == "e"

Is evaluated as (right associativity of the operator):

$VAR1 == "a" || ($VAR2 == "b" && ($VAR3 == "c" || ($VAR4 == "d" && $VAR5 == "e")))

Where it should be as:

$VAR1 == "a" || (($VAR2 == "b" && $VAR3 == "c") || ($VAR4 == "d" && $VAR5 == "e"))

I will fix this ~bug as part of this MR, but it does mean that this also will be breaking change.

Example 2

When we have this:

$EXAMPLE_PARAM == 'test1' && $CI_PIPELINE_SOURCE == 'web' || $CI_PIPELINE_SOURCE == 'schedule'

Prior to this change it will be wrongly evaluated as (not in the way how operator precedence is defined):

$EXAMPLE_PARAM == 'test1' && ($CI_PIPELINE_SOURCE == 'web' || $CI_PIPELINE_SOURCE == 'schedule')

Where the properly it should be:

($EXAMPLE_PARAM == 'test1' && $CI_PIPELINE_SOURCE == 'web') || $CI_PIPELINE_SOURCE == 'schedule'

Beta groups/projects

This feature can be enabled globally only.

Roll Out Steps

  • Enable on staging
  • Test on staging
  • Ensure that documentation has been updated
  • Enable on GitLab.com by running chatops command in #production
  • Cross post chatops slack command to #support_gitlab-com (more guidance when this is necessary in the dev docs) and in your team channel
  • Announce on the issue that the flag has been enabled
  • Remove feature flag and add changelog entry
  • After the flag removal is deployed, clean up the feature flag by running chatops command in #production channel
Edited Sep 17, 2020 by Kamil Trzciński
Assignee
Assign to
Time tracking