Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: clone_url naming #39

Merged
merged 1 commit into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ Before you begin, make sure to familiarize yourself with the [Code of Conduct](C

## Prerequisites

If you have a golang development environment installed, a `go generate` command must be issued after modifying the source files.

The other option is to install the [cdo] tool and perform the tasks described here. The [cdo] tool can most conveniently be installed using the [eget] tool.
The tools listed in the [tools] section should be installed before contributing. It is advisable to first install the [cdo] tool, which can be used to easily perform the tasks described here. The [cdo] tool can most conveniently be installed using the [eget] tool.

```bash
eget szkiba/cdo
Expand Down Expand Up @@ -44,7 +42,7 @@ The JSON schema of the registry can be found in the [registry.schema.yaml] file,

```bash
yq -o=json -P docs/registry.schema.yaml > docs/registry.schema.json
go-jsonschema -p k6registry --only-models -o registry_gen.go docs/registry.schema.yaml
go-jsonschema --capitalization URL -p k6registry --only-models -o registry_gen.go docs/registry.schema.yaml
```

[registry.schema.json]: docs/registry.schema.json
Expand Down
10 changes: 5 additions & 5 deletions cmd/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,13 @@ func loadGitHub(ctx context.Context, module string) (*k6registry.Repository, err

repo.Topics = rep.Topics

repo.Url = rep.GetHTMLURL()
repo.URL = rep.GetHTMLURL()
repo.Name = rep.GetName()
repo.Owner = rep.GetOwner().GetLogin()

repo.Homepage = rep.GetHomepage()
if len(repo.Homepage) == 0 {
repo.Homepage = repo.Url
repo.Homepage = repo.URL
}

repo.Archived = rep.GetArchived()
Expand All @@ -172,7 +172,7 @@ func loadGitHub(ctx context.Context, module string) (*k6registry.Repository, err
repo.Timestamp = float64(ts.Unix())
}

repo.CloneUrl = rep.GetCloneURL()
repo.CloneURL = rep.GetCloneURL()

tags, _, err := client.Repositories.ListTags(ctx, owner, name, &github.ListOptions{PerPage: 100})
if err != nil {
Expand Down Expand Up @@ -214,12 +214,12 @@ func loadGitLab(ctx context.Context, module string) (*k6registry.Repository, err
repo.Description = proj.Description
repo.Stars = proj.StarCount
repo.Archived = proj.Archived
repo.Url = proj.WebURL
repo.URL = proj.WebURL
repo.Homepage = proj.WebURL
repo.Topics = proj.Topics
repo.Public = len(proj.Visibility) == 0 || proj.Visibility == gitlab.PublicVisibility

repo.CloneUrl = proj.HTTPURLToRepo
repo.CloneURL = proj.HTTPURLToRepo

if proj.LastActivityAt != nil {
repo.Timestamp = float64(proj.LastActivityAt.Unix())
Expand Down
4 changes: 2 additions & 2 deletions registry_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading