-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow user to specify format using --format=detail|commit|markdown
feat: support git submodules as default observed dependencies
- Loading branch information
Tomas Peterka
committed
Feb 5, 2024
1 parent
102365b
commit 98b7c1d
Showing
8 changed files
with
214 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,71 @@ | ||
# Gira | ||
|
||
Gira checks for changes in projects dependencies and prints out all JIRA tags | ||
found in commit messages between old and new version. | ||
Gira gathers JIRA tickets from commit messages of your updated dependencies when you | ||
change them in one of: `pyproject.toml`, `poetry.lock`, `west.yaml`, and `pubspec.yaml`. | ||
It is especially usefull in "prepare-commit-msg" stage of [pre-commit](https://pre-commit.com) | ||
|
||
Dependency changes are taken from current staged/unstaged or previous commit diff | ||
of available lock files (poetry, pyproject, package-lock...). | ||
//Disclaimer: works the best if your dependencies follow [semantic release](https://semantic-release.gitbook.io/semantic-release/) (have tags in `v{X.Y.*}` format)// | ||
|
||
Commit messages are taken from projects that follow semantic release (have tags in | ||
`v{X.Y.*}` format). | ||
|
||
JIRA tickets are parsed based on a regular expression `[A-Z]+-\d+`. | ||
## Usage | ||
|
||
The unified output is as following | ||
```bash | ||
gira [-r revision] [--format="commit|detail|markdown"] | ||
``` | ||
|
||
Revision can be tag/branch or a commit. Gira will check dependency files for changes between | ||
the current version and the revision version. | ||
|
||
Format is useful if you generate into a commit message (only ticket names (e.g. JIRA-1234)) | ||
or you want a user readable "detailed" print or the same but markdown formatted. | ||
|
||
```bash | ||
$ gira | ||
$ gira [--format=commit] | ||
internal-dependency1 <versionB> => <versionB>: JIRA-123, JIRA-567 | ||
other-followed-lib <versionB> => <versionB>: JIRA-876, JIRA-543 | ||
``` | ||
|
||
## Configuration | ||
|
||
Gira is configured either by pyproject.toml or standalone .gira file. Gira | ||
needs to know the names of followed dependencies and their git urls. | ||
Gira is configured either by pyproject.toml or standalone .gira.yaml or actually any other | ||
YAML file that you specify with `-c` and has "gira.observe" and optionally "gira.jira" keys. | ||
|
||
### Observed Dependencies | ||
|
||
Example config: | ||
Observed dependencies are in form of NAME=git-url where NAME must be the same as specified | ||
in your dependency file (e.g. pyproject.toml or a YAML). | ||
|
||
```toml | ||
[tool.gira.dependencies] | ||
[tool.gira.observe] | ||
internal-lib1 = "github.com/company/internal-lib1" | ||
other-dependency = "bitbucket.com/company/other-dependency" | ||
``` | ||
|
||
## Optional configuration: JIRA | ||
### Submodules | ||
|
||
```toml | ||
[tool.gira.jira] | ||
url = "jira.yourcompany.com" | ||
token = "token" | ||
Submodules are automatically added into observed dependencies. You can turn off support | ||
for submodules by settings `gira.submodules=false` in your config file. | ||
|
||
|
||
### JIRA (optional) | ||
|
||
Example of a YAML configuration file section for JIRA (for pyproject.toml use `tool.gira.jira`). | ||
Token and email can be passed via environment variables `JIRA_TOKEN` or `GIRA_JIRA_TOKEN` and | ||
`JIRA_EMAIL` or `GIRA_JIRA_EMAIL`. | ||
|
||
```yaml | ||
jira: | ||
url: jira.yourcompany.com | ||
token: token | ||
email: [email protected] | ||
``` | ||
If you provide valid JIRA connection infromation the output will change to | ||
Setting JIRA connection information allows for "detailed" and "markdown" formatting of the output | ||
as follows: | ||
```bash | ||
$ gira | ||
internal-dependency1 <versionB> => <versionB>: | ||
JIRA-123: details about the issue (summary) | ||
JIRA-567: details about the issue (summary) | ||
JIRA-123: details about the issue (url) | ||
JIRA-567: details about the issue (url) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.