Allow chatops to be used to operate feature flags in ops
Summary
The /chatops run feature set
command is usually used to enable feature flags in all GitLab instances (.com, dev). Unfortunately, this cannot currently be used to enable/disable feature flags in ops because the token used by chatops to call APIs on ops is not an admin token. The feature flag API requires an admin token.
The token currently in use for ops (GITLAB_OPS_TOKEN
) is a token of the https://ops.gitlab.net/gitlab-release-tools-bot user. This token will need to continue being used for auto_deploy
and release
commands, since these are commands usually executed by Delivery team Release Managers. The actions taken by those commands need to be done by the gitlab-release-tools-bot
user.
Proposal
One way to achieve this would be:
- Create a
GITLAB_OPS_ADMIN_TOKEN
variable, and set the value to an admin token from the ops.gitlab.net instance. - Use the above token in chatops/command/feature.rb, wherever a
Gitlab::Client
is instantiated. For example: chatops/commands/feature.rb#L278.
Edited by Reuben Pereira