Tabia means characteristic in Swahili. Tabia is giving us insights on the characteristics of our code bases.
Copy .env.example to .env and fill out the bitbucket token. This environment variable is read by the CLI and tests. Also vscode will read the variable when running tests or starting debugger.
cp .env.example .env
source .env
env | grep TABIAInstall required tools:
make install-toolsAdd your $GO_PATH/bin folder to your path to make the installed Go tools globally available.
export GO_PATH="$HOME/go"
export PATH="$GO_PATH/bin:$PATH"To build the CLI you can make use of the build target using make.
make buildTo run tests you can make use of the test target using make.
make testTo interact with Bitbucket tabia makes use of the Bitbucket 1.0 Rest API.
bin/tabia bitbucket --help
bin/tabia bitbucket projects --help
bin/tabia bitbucket repositories --helpTo interact with Github tabia makes use of the Github graphql API.
bin/tabia github --help
bin/tabia github repositories --helpTo expose the repositories in Grimoirelab projects.json format, you can optionally provide a json file to map repositories to projects. By default the project will be mapped to the owner of the repository. Anything not matching the rules will fall back to this default.
E.g.:
bin/tabia -O philips-labs -M github-projects.json -F grimoirelab > projects.jsonRegexes should be defined in the following format.
{
"rules": {
"One Codebase": { "url": "tabia|varys|garo|^code\\-chars$" },
"HSDP": { "url": "(?i)hsdp" },
"iX": { "url": "(?i)ix\\-" },
"Licensing Entitlement": { "url": "(?i)lem\\-" },
"Code Signing": { "url": "(?i)^code\\-signing$|notary" }
}
}To generate the output for example in a markdown format you can use the option for a templated output format. This requires you to provide the path to a template file as well. Templates can be defined using the following template/text package syntax.
E.g.:
# Our repositories
Our repository overview. Private/Internal repositories are marked with a __*__
{{range .}}* [{{ .Name}}]({{ .URL }}) {{if .IsPrivate() }}__*__{{end}}
{{end}}Using above template we can now easily generate a markdown file with this unordered list of repository links.
bin/tabia -O philips-labs -F templated -T markdown.tmpl > repositories.mdThe following repository fields can be filtered on.
- ID
- Name
- Description
- URL
- SSHURL
- Owner
- Visibility
- CreatedAt
- UpdatedAt
- PushedAt
- Topics
The following functions are available.
func (RepositoryFilterEnv) Contains(s, substr string) boolfunc (Repository) IsPublic() boolfunc (Repository) IsInternal() boolfunc (Repository) IsPrivate() boolfunc (Repository) HasTopic(topic string) boolfunc (Repository) CreatedSince(date string) boolfunc (Repository) UpdatedSince(date string) boolfunc (Repository) PushedSince(date string) bool
$ bin/tabia github repositories -O philips-labs -f '{ !.IsPrivate() && !.IsInternal() && !Contains(.Name, "terraform") }'
Name Owner Visibility Clone
0001 helm2cf philips-labs Public https://github.com/philips-labs/helm2cf
0002 dct-notary-admin philips-labs Public https://github.com/philips-labs/dct-notary-admin
0003 notary philips-labs Public https://github.com/philips-labs/notary
0004 about-this-organization philips-labs Public https://github.com/philips-labs/about-this-organization
0005 sonar-scanner-action philips-labs Public https://github.com/philips-labs/sonar-scanner-action
0006 medical-delivery-drone philips-labs Public https://github.com/philips-labs/medical-delivery-drone
0007 dangerous-dave philips-labs Public https://github.com/philips-labs/dangerous-dave
0008 varys philips-labs Public https://github.com/philips-labs/varys
0009 garo philips-labs Public https://github.com/philips-labs/garo
..........
...........
........The following member fields can be filtered on.
- ID
- Login
- Name
- Organization
- SamlIdentity
- ID
The following functions are available.
func (MemberFilterEnv) Contains(s, substr string) bool
bin/tabia github contents --repo philips-labs/tabia --file README.md --output downloads/tabia/README.md
$ cat downloads/tabia/README.md
# Tabia
[](https://github.com/philips-labs/tabia/actions)
[](https://codecov.io/gh/philips-labs/tabia)
...
...
..