# @gitlaber/cascade

> The idea of this command came from couple feature proposals - [Cascaded Merge Requests proposal](https://gitlab.com/gitlab-org/gitlab/-/issues/11648) - [Inability to create MRs from the default branch using push options](https://gitlab.com/gitlab-org/gitl

Latest version **0.1.0** (published 2022-09-13) · 0 weekly downloads

## Install

```sh
npm install @gitlaber/cascade
pnpm add @gitlaber/cascade
yarn add @gitlaber/cascade
bun add @gitlaber/cascade
```

Provides the command `cascade`.

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2022-09-13 |
| First published | 2022-09-11 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 9.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | theplenkov-npm |

## Links

- npm: https://www.npmjs.com/package/@gitlaber/cascade
- npm.io page: https://npm.io/package/@gitlaber/cascade

## Dependencies (2)

- [commander](https://npm.io/package/commander.md) ^9.4.0
- [@gitlaber/sdk](https://npm.io/package/@gitlaber/sdk.md) 0.1.0

## Recent versions

- 0.1.0 (latest) — 2022-09-13
- 0.0.15 — 2022-09-11
- 0.0.13 — 2022-09-11

## README

# CLI command implementing cascaded merge requests

The idea of this command came from couple feature proposals
- [Cascaded Merge Requests proposal](https://gitlab.com/gitlab-org/gitlab/-/issues/11648)
- [Inability to create MRs from the default branch using push options](https://gitlab.com/gitlab-org/gitlab/-/issues/214123)

Behind both of features I have in mind Gitlab Flow with [environment branches approach](https://docs.gitlab.com/ee/topics/gitlab_flow.html#environment-branches-with-gitlab-flow)

So this approach suggests moving changes to different environments by use of MRs. With numerous environments it may require large number of MRs to be created and I thought that it would be nice to automate MR creation/update process

## Usage
```
Usage: gitlab cascade [options]

Create/Update cascaded merge request

Options:
  --project <projectPath>      Gitlab project path (default $CI_PROJECT_PATH)
  --source <sourceBranch>      Source branch (default $CI_COMMIT_BRANCH)
  --target <targetBranch>      Target branch
  --title <title>              Merge request title
  --description <description>  Merge request description
  -h, --help                   display help for command
```

This command has the following logic:
- It tries to find the existing open merge requests between source and target branches
- In case if there are no requests - it will create a new MR labeled as cascaded
- In case if there are MRs - it will try to update existing MR's( only those labeled with cascaded ) with the provided title and description

This project also delivers an approximate [template](.gitlab/cascade.gitlab-ci.yml) how this feature can be used.

| This command is a part of @giltaber/cli CLI

---
_Source: https://npm.io/package/@gitlaber/cascade · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
