This repository was archived by the owner on Dec 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Import cycle not allowed #303
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't working
Description
What happened?
I am having some "import cycle" issues when running make reviewable on my Terrajet project. Below is three resources that generates the import cycle not allowed error.
-
Team Routing Rule resource references.
team_id=> typeTeamnotify.id=> typeEscalation
-
Escalation resource references,
owner_team_id=> typeTeamrules.recipient.id=> typeTeam
This will generate the following error on running make reviewable.
WARN [runner] Can't run linter goanalysis_metalinter: bodyclose: failed prerequisites: [[email protected]/ok-amba/provider-jet-opsgenie/apis/team/v1alpha1: analysis skipped: errors in package: [/home/kerwood/Git/provider-jet-opsgenie/apis/team/v1alpha1/zz_generated.resolvers.go:23:11: could not import github.com/ok-amba/provider-jet-opsgenie/apis/escalation/v1alpha1 (-: import cycle not allowed: import stack: [github.com/ok-amba/provider-jet-opsgenie/apis github.com/ok-amba/provider-jet-opsgenie/apis/escalation/v1alpha1 github.com/ok-amba/provider-jet-opsgenie/apis/team/v1alpha1 github.com/ok-amba/provider-jet-opsgenie/apis/escalation/v1alpha1])]]
WARN [runner] Can't run linter unused: buildir: analysis skipped: errors in package: [-: import cycle not allowed: import stack: [github.com/ok-amba/provider-jet-opsgenie/apis github.com/ok-amba/provider-jet-opsgenie/apis/escalation/v1alpha1 github.com/ok-amba/provider-jet-opsgenie/apis/team/v1alpha1 github.com/ok-amba/provider-jet-opsgenie/apis/escalation/v1alpha1]]
ERRO Running error: buildir: analysis skipped: errors in package: [-: import cycle not allowed: import stack: [github.com/ok-amba/provider-jet-opsgenie/apis github.com/ok-amba/provider-jet-opsgenie/apis/escalation/v1alpha1 github.com/ok-amba/provider-jet-opsgenie/apis/team/v1alpha1 github.com/ok-amba/provider-jet-opsgenie/apis/escalation/v1alpha1]]
11:35:52 [FAIL]
make[2]: *** [build/makelib/golang.mk:194: go.lint] Error 1
make[1]: *** [build/makelib/common.mk:357: lint] Error 2
make: *** [build/makelib/common.mk:425: reviewable] Error 2
My guess is that its importing github.com/ok-amba/provider-jet-opsgenie/apis/escalation/v1alpha1 multiple times for some reason.
[
github.com/ok-amba/provider-jet-opsgenie/apis
github.com/ok-amba/provider-jet-opsgenie/apis/escalation/v1alpha1
github.com/ok-amba/provider-jet-opsgenie/apis/team/v1alpha1
github.com/ok-amba/provider-jet-opsgenie/apis/escalation/v1alpha1
]
Links to files
Team Routing Rule config.go file: https://github.com/ok-amba/provider-jet-opsgenie/blob/1d82bf7f2d5477d61db916c4868333187a0b10b1/config/teamroutingrule/config.go
Escalation config.go file: https://github.com/ok-amba/provider-jet-opsgenie/blob/1d82bf7f2d5477d61db916c4868333187a0b10b1/config/escalation/config.go
How can we reproduce it?
git clone [email protected]:ok-amba/provider-jet-opsgenie.git
cd provider-jet-opsgenie
git checkout 1d82bf7f2d5477d61db916c4868333187a0b10b1
make submodules
make reviewable
mewm
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
