Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restricting promotions to prod to commits in main branch #333

Open
aguschin opened this issue Jan 25, 2023 · 0 comments
Open

Restricting promotions to prod to commits in main branch #333

aguschin opened this issue Jan 25, 2023 · 0 comments
Labels
enhancement New feature or request stages Stages mechanics and how they work

Comments

@aguschin
Copy link
Contributor

aguschin commented Jan 25, 2023

A question from a client:

Right now we have two working branches. + feature branches.
The Idea is that if we merge into development, we can test all integrations before going into main/master branch.
When using tags in studio you can circumvent the whole process by just tagging something production. Any Idea on how to restrict this?
How should the working process Ideally be? It looks like our process does not fit the style of tagging

workaround

A workaround would be to configure CI/CD workflow so it will run in main branch only (not just for git tags like model#production). Note you can't do that in the job definition, like this (remember you workflow is triggered by a Git tag, not by a push to branch):

on:
  push:
    branches:
      - main
      - 'releases/**'

So you need to do that check manually in one of your workflow jobs (not handy).

Then a Git tag created, but the commit it points to doesn't belong to main, the CI will start, but the job will stop after your check.

configuring this restriction

The other option is to implement a configuration. Since Studio reads the config from the main branch, you can write something like:

#.gto.yaml
stages:
  production:
    branches: [main]

which will prevent you from running gto assign on some other branch.
Although, this doesn't prevent you from creating renegade git tags manually.

somewhat related #138

@aguschin aguschin added enhancement New feature or request stages Stages mechanics and how they work labels Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stages Stages mechanics and how they work
Projects
None yet
Development

No branches or pull requests

1 participant