Skip to content

Commit

Permalink
Merge pull request #3 from mona-actions/feature/continued-work
Browse files Browse the repository at this point in the history
Continued Work: Updating Readme
  • Loading branch information
samueljmello authored May 18, 2023
2 parents beae6f4 + e67586e commit ef24c75
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,32 @@ GitHub CLI extension for analyzing BitBucket Server to get migration statistics.
[![release](https://github.com/mona-actions/gh-migrate-webhook-secrets/actions/workflows/release.yaml/badge.svg)](https://github.com/mona-actions/gh-migrate-webhook-secrets/actions/workflows/release.yaml)

## Under Construction
This is a work-in-progress
This is a work-in-progress. Currently the tool will report:

- Repository disk sizes
- Pull request counts
- Comment counts
- If repository is archived
- If repository is public

Tested on BitBucket Server 8.6.1

Future plans include:
- Attachment counts
- Multithreading

## Prerequisites
- [GitHub CLI](https://cli.github.com/manual/installation) installed.

## Permissions Required
In order for the analysis to work correctly, you will need to utilize a systems admin account so that all project and repository endpoints respond appropriately. If you don't, you will only receive limited information (the projects & repositories the user has access to).

The endpoints currently called are:
- `<server>/<api-url>/projects`
- `<server>/<api-url>/projects/<project-key>/repos`
- `<server>/projects/<project-key>/repos/<repo-slug>/sizes` (non-API endpoint hack)
- `<server>/<api-url>/projects/<project-key>/repos/<repo-slug>/pull_requests`

## Install

```bash
Expand Down
8 changes: 5 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ func Process(cmd *cobra.Command, args []string) (err error) {

// write header
_, err = out_file.WriteString(
fmt.Sprintln("project,repository,size,pull_requests,comments"),
fmt.Sprintln("project,repository,size,pull_requests,comments,archived,public"),
)
if err != nil {
OutputError("Error writing to output file.", true)
Expand All @@ -393,12 +393,14 @@ func Process(cmd *cobra.Command, args []string) (err error) {
_, err = out_file.WriteString(
fmt.Sprintln(
fmt.Sprintf(
"%s,%s,%d,%d,%d",
"%s,%s,%d,%d,%d,%s,%s",
repository.Project.Key,
repository.Slug,
repository.Size.Repository,
len(repository.PullRequests),
repository.CommentCount,
strconv.FormatBool(repository.Archived),
strconv.FormatBool(repository.Public),
),
),
)
Expand Down Expand Up @@ -558,7 +560,7 @@ func BBSHTTPRequest(path string, endpoint string, method string) (data string, e
url := fmt.Sprintf("%s%s%s", bbs_server_url, path, endpoint)
Debug(fmt.Sprintf("Request URL: %s", url))

// set SSL verification using inverse bool from flag
// set SSL verification
tr := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: no_ssl_verify},
}
Expand Down

0 comments on commit ef24c75

Please sign in to comment.