Skip to content

Commit

Permalink
linting errors resolves
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Horton <phorton@sonatype.com>
  • Loading branch information
madpah committed Dec 10, 2024
1 parent f745224 commit 9c67c30
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ Introduce your project here. A short summary about what its purpose and scope is

This tool queries your Source Control Management (SCM) system and creates Organizations and Applications in Sonatype Lifecycle in bulk.

This tool is intended to be run against either an empty Sonatype Lifecycle installation or a specific Organization that represents a given SCM connection ONCE.

This tool is NOT intended to be run multiple times to continuously import/keep Sonatype Lifecycle up to date with newly created Projects or Repositories in your SCM system - to do this (once you've run this tool once successfully), use [Easy SCM Onboarding](https://help.sonatype.com/en/easy-scm-onboarding.html).

Currently supports:
- ✅ Azure DevOps

Expand Down
15 changes: 12 additions & 3 deletions iq/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,10 @@ func (s *NxiqServer) CreateOrganization(org scm.Organization, parentOrgId string
}

func (s *NxiqServer) OrganizationExists(org scm.Organization, parentOrgId string) (*sonatypeiq.ApiOrganizationDTO, error) {
s.InitCache()
err := s.InitCache()
if err != nil {
log.Fatalln(err)
}
for _, existingOrg := range s.existingOrganizations {
if *existingOrg.Name == org.SafeName() && *existingOrg.ParentOrganizationId == parentOrgId {
return existingOrg, nil
Expand Down Expand Up @@ -370,7 +373,10 @@ func (s *NxiqServer) CreateApplication(app scm.Application, parentOrgId string)
}

func (s *NxiqServer) ApplicationExists(app scm.Application, parentOrgId string) (*sonatypeiq.ApiApplicationDTO, error) {
s.InitCache()
err := s.InitCache()
if err != nil {
log.Fatalln(err)
}
for _, existingApp := range s.existingApplications {
if *existingApp.Name == app.SafeName() && *existingApp.OrganizationId == parentOrgId {
return existingApp, nil
Expand Down Expand Up @@ -445,7 +451,10 @@ func (s *NxiqServer) getUniqueOrganizationId(id string) string {
}

func (s *NxiqServer) ValidateOrganizationByName(organizationName string) *sonatypeiq.ApiOrganizationDTO {
s.InitCache()
err := s.InitCache()
if err != nil {
log.Fatalln(err)
}

for _, o := range s.existingOrganizations {
if *o.Name == organizationName {
Expand Down

0 comments on commit 9c67c30

Please sign in to comment.