From c5015ba254bd49ad2826bd252e3afef5a7b705d1 Mon Sep 17 00:00:00 2001 From: Andrea Lamparelli Date: Thu, 6 Jul 2023 13:44:23 +0200 Subject: [PATCH] refactor: bper renamed to git-backporting --- README.md | 43 +++++++++++++++++++++++++++++++------------ dist/cli/index.js | 2 +- package-lock.json | 6 +++--- package.json | 7 ++++--- 4 files changed, 39 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index f29311b..2393f6f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@

- BPER
- Git Backporter
+ Git Backporting
:outbox_tray: :inbox_tray:

@@ -8,18 +7,18 @@ ci checks status - - npm version + + npm version

--- -## :bangbang: Starting from v4 bper has been moved under @kiegroup organization :bangbang: +## :bangbang: Starting from v4 git-backporting has been moved under @kiegroup organization and renamed :bangbang: --- -**Git Backporter**, also referenced as **bper**, is a [NodeJS](https://nodejs.org/) command line tool that provides capabilities to *backport* pull requests (on *GitHub*) and merge requests (on *GitLab*) in an automated way. This tool also comes with a predefined *GitHub* action in order to make CI/CD integration easier for all users. +**Git Backporting** is a [NodeJS](https://nodejs.org/) command line tool that provides capabilities to *backport* pull requests (on *GitHub*) and merge requests (on *GitLab*) in an automated way. This tool also comes with a predefined *GitHub* action in order to make CI/CD integration easier for all users. Table of content @@ -31,12 +30,13 @@ Table of content * **[GitHub action](#github-action)** * **[Future works](#future-works)** * **[Release](#release)** +* **[Repository migration](#repository-migration)** * **[Contributing](#contributing)** * **[License](#license)** ## Who is this tool for? -`bper` is a tool that provides capabilities to *backport* pull requests (on *GitHub*) and merge requests (on *GitLab*) in an automated way. +`git-backporting` is a tool that provides capabilities to *backport* pull requests (on *GitHub*) and merge requests (on *GitLab*) in an automated way. > *What is backporting?* - backporting is an action aiming to move a change (usually a commit) from a branch (usually the main one) to another one, which is generally referring to a still maintained release branch. Keeping it simple: it is about to move a specific change or a set of them from one branch to another. @@ -47,24 +47,26 @@ Therefore this tools is for anybody who is working on projects where they have t This tool is released on the [public npm registry](https://www.npmjs.com/), therefore it can be easily installed using `npm`: ```bash -$ npm install -g @kie/bper +$ npm install -g @kie/git-backporting ``` -> **NOTE**: if you want to download version 3 or older you must use the older scope `@lampajr` instead of `@kie`. +> **NOTE**: if you want to download version 3 or older you must use the older package name `@lampajr/bper` instead of `@kie/git-backporting`. Then you just have to choose the pull request (or merge request on *Gitlab*) that you would like to backport and the target branch and the simply run the following command: ```bash -$ bper -tb -pr -a +$ git-backporting -tb -pr -a ``` A real example could be the following one: ```bash -$ bper -tb develop -pr https://github.com/kiegroup/git-backporting-example/pull/47 -a ***** +$ git-backporting -tb develop -pr https://github.com/kiegroup/git-backporting-example/pull/47 -a ***** ``` This is the easiest invocation where you let the tool set / compute most of the backported pull request data. Obviously most of that data can be overridden with appropriate tool options, more details can be found in the [inputs](#inputs) section. +> **NOTE**: if you are still using version 3 or older you must use the older CLI tool name `bper` instead of `git-backporting`. + ### Requirements * Node 16 or higher, more details on Node can be found [here](https://nodejs.org/en). @@ -112,7 +114,7 @@ Keep in mind that its structue MUST match the [Args](src/service/args/args.types ## Supported git services -Right now **bper** supports the following git management services: +Right now **Git Backporting** supports the following git management services: * ***GITHUB***: Introduced since the first release of this tool (version `1.0.0`). The interaction with this system is performed using [*octokit*](https://octokit.github.io/rest.js) client library. * ***GITLAB***: This has been introduced since version `3.0.0`, it works for both public and private *GitLab* servers. The interaction with this service is performed using plain [*axios*](https://axios-http.com) requests. The *gitlab* api version that is used to make requests is `v4`, at the moment there is no possibility to override it. @@ -241,6 +243,23 @@ In case we would like to perform a manual release, it would be enough to open a Once the release preparion pull request got merged, run [Release package](.github/workflows/release.yml) workflow. +## Repository Migration + +From version `v4.0.0` the project has been moved under [@kiegroup](https://github.com/kiegroup) organization. During this migration we changed some things that you should be aware of. I'll try to summarize them in the following table: + +> **NOTE**: these changes did not affect the tool features. + +| | **v4 (after migration)** | v3 or older (before migration) | +|-------------|--------------------------|--------------------------------| +| Owner | kiegroup | lampajr | +| Repository | git-backporting | backporting | +| NPM package | @kie/git-backporting | @lampajr/bper | +| CLI tool | git-backporting | bper | + +So everytime you would use older version keep in mind of these changes. + +> **REMARK**: since from capabilities point of view `v3.1.1` and `v4.0.0` are equivalent we would recommend to directly start using `v4`. + ## Contributing This is an open source project, and you are more than welcome to contribute :heart:! diff --git a/dist/cli/index.js b/dist/cli/index.js index 2da699e..26b95e4 100755 --- a/dist/cli/index.js +++ b/dist/cli/index.js @@ -23331,7 +23331,7 @@ module.exports = axios; /***/ ((module) => { "use strict"; -module.exports = JSON.parse('{"name":"@kie/bper","version":"4.0.0","description":"BPer is a tool to execute automatic git backporting.","author":"","license":"MIT","private":false,"main":"./dist/gha/index.js","bin":{"bper":"./dist/cli/index.js"},"files":["dist/cli/index.js"],"scripts":{"prepare":"husky install","clean":"rm -rf ./build ./dist","compile":"tsc -p tsconfig.json && tsc-alias -p tsconfig.json","package":"npm run package:cli && npm run package:gha","package:cli":"ncc build ./build/src/bin/cli.js -o dist/cli","package:gha":"ncc build ./build/src/bin/gha.js -o dist/gha","build":"npm run clean && npm run compile && npm run package","test":"jest","test:report":"npm test -- --coverage --testResultsProcessor=jest-sonar-reporter","lint":"eslint . --ext .ts","lint:fix":"npm run lint -- --fix","ts-node":"ts-node","postversion":"npm run build && git add dist && rm -rf build","release":"release-it","release:branch":"git checkout -b release/$(release-it --release-version) main","release:prepare":"release-it --no-npm.publish --no-github.release --no-git.push --no-git.tag --no-git.requireUpstream","release:prepare:all":"npm run release:branch && npm run release:prepare"},"repository":{"type":"git","url":"git+https://github.com/kiegroup/git-backporting.git"},"keywords":["backporting","pull-requests","github-action","cherry-pick"],"bugs":{"url":"https://github.com/kiegroup/git-backporting/issues"},"homepage":"https://github.com/kiegroup/git-backporting#readme","devDependencies":{"@commitlint/cli":"^17.4.0","@commitlint/config-conventional":"^17.4.0","@gitbeaker/rest":"^39.1.0","@kie/mock-github":"^1.1.0","@release-it/conventional-changelog":"^5.1.1","@types/fs-extra":"^9.0.13","@types/jest":"^29.2.4","@types/node":"^18.11.17","@typescript-eslint/eslint-plugin":"^5.47.0","@typescript-eslint/parser":"^5.47.0","@vercel/ncc":"^0.36.0","eslint":"^8.30.0","husky":"^8.0.2","jest":"^29.0.0","jest-sonar-reporter":"^2.0.0","release-it":"^15.6.0","semver":"^7.3.8","ts-jest":"^29.0.0","ts-node":"^10.8.1","tsc-alias":"^1.8.2","tsconfig-paths":"^4.1.0","typescript":"^4.9.3","@octokit/webhooks-types":"^6.8.0"},"dependencies":{"@actions/core":"^1.10.0","@octokit/rest":"^18.12.0","axios":"^1.4.0","commander":"^9.3.0","fs-extra":"^11.1.0","https":"^1.0.0","simple-git":"^3.15.1"}}'); +module.exports = JSON.parse('{"name":"@kie/git-backporting","version":"4.0.0","description":"Git backporting is a tool to execute automatic pull request git backporting.","author":"","license":"MIT","private":false,"main":"./dist/gha/index.js","bin":{"git-backporting":"./dist/cli/index.js"},"files":["dist/cli/index.js"],"scripts":{"prepare":"husky install","clean":"rm -rf ./build ./dist","compile":"tsc -p tsconfig.json && tsc-alias -p tsconfig.json","package":"npm run package:cli && npm run package:gha","package:cli":"ncc build ./build/src/bin/cli.js -o dist/cli","package:gha":"ncc build ./build/src/bin/gha.js -o dist/gha","build":"npm run clean && npm run compile && npm run package","test":"jest","test:report":"npm test -- --coverage --testResultsProcessor=jest-sonar-reporter","lint":"eslint . --ext .ts","lint:fix":"npm run lint -- --fix","ts-node":"ts-node","postversion":"npm run build && git add dist && rm -rf build","release":"release-it","release:branch":"git checkout -b release/$(release-it --release-version) main","release:prepare":"release-it --no-npm.publish --no-github.release --no-git.push --no-git.tag --no-git.requireUpstream","release:prepare:all":"npm run release:branch && npm run release:prepare"},"repository":{"type":"git","url":"git+https://github.com/kiegroup/git-backporting.git"},"keywords":["backporting","pull-requests","merge-requests","github-action","cherry-pick"],"bugs":{"url":"https://github.com/kiegroup/git-backporting/issues"},"homepage":"https://github.com/kiegroup/git-backporting#readme","devDependencies":{"@commitlint/cli":"^17.4.0","@commitlint/config-conventional":"^17.4.0","@gitbeaker/rest":"^39.1.0","@kie/mock-github":"^1.1.0","@release-it/conventional-changelog":"^5.1.1","@types/fs-extra":"^9.0.13","@types/jest":"^29.2.4","@types/node":"^18.11.17","@typescript-eslint/eslint-plugin":"^5.47.0","@typescript-eslint/parser":"^5.47.0","@vercel/ncc":"^0.36.0","eslint":"^8.30.0","husky":"^8.0.2","jest":"^29.0.0","jest-sonar-reporter":"^2.0.0","release-it":"^15.6.0","semver":"^7.3.8","ts-jest":"^29.0.0","ts-node":"^10.8.1","tsc-alias":"^1.8.2","tsconfig-paths":"^4.1.0","typescript":"^4.9.3","@octokit/webhooks-types":"^6.8.0"},"dependencies":{"@actions/core":"^1.10.0","@octokit/rest":"^18.12.0","axios":"^1.4.0","commander":"^9.3.0","fs-extra":"^11.1.0","https":"^1.0.0","simple-git":"^3.15.1"}}'); /***/ }), diff --git a/package-lock.json b/package-lock.json index 2e9efdc..aef4198 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "@kie/bper", + "name": "@kie/git-backporting", "version": "4.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "@kie/bper", + "name": "@kie/git-backporting", "version": "4.0.0", "license": "MIT", "dependencies": { @@ -18,7 +18,7 @@ "simple-git": "^3.15.1" }, "bin": { - "bper": "dist/cli/index.js" + "git-backporting": "dist/cli/index.js" }, "devDependencies": { "@commitlint/cli": "^17.4.0", diff --git a/package.json b/package.json index 7ef4a4b..db83dab 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,13 @@ { - "name": "@kie/bper", + "name": "@kie/git-backporting", "version": "4.0.0", - "description": "BPer is a tool to execute automatic git backporting.", + "description": "Git backporting is a tool to execute automatic pull request git backporting.", "author": "", "license": "MIT", "private": false, "main": "./dist/gha/index.js", "bin": { - "bper": "./dist/cli/index.js" + "git-backporting": "./dist/cli/index.js" }, "files": [ "dist/cli/index.js" @@ -38,6 +38,7 @@ "keywords": [ "backporting", "pull-requests", + "merge-requests", "github-action", "cherry-pick" ],