Skip to content
This repository was archived by the owner on Nov 13, 2024. It is now read-only.
This repository was archived by the owner on Nov 13, 2024. It is now read-only.

D7 feature revert breaks if only one branch name is set #344

Description

@EmlynK

The branches/sites on which feature reverting occurs is handled in the config.ini file (or buildtype.config.ini file). If, however, only one branch name is set, then feature reverting doesn't occur at all.

For example, if we have a prod.config.ini file which contains the following:

[Drupal]
drupal_version=7
fra=True
branches=prod

This is because of the following:

if feature_branches is not None:
revert_branches = []
if feature_branches == "*":
revert_branches.append(branch)
else:
feature_branches = feature_branches.split(',')
for each_branch in feature_branches:
each_branch = each_branch.strip()
revert_branches.append(each_branch)
else:
revert_branches = ['master', 'stage']

In particular,

feature_branches = feature_branches.split(',')

If there isn't a comma in that option in the INI file, then there's nothing to split on. Therefore, the feature_branches variable is empty.

This can be worked around by simply making the list branches greater than one, i.e:

branches=stage,prod

Or by using the wildcard option:

branches=*

Providing the wildcard does work as intended, this may be less of a bug and more a documentation issue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions