Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
5756bfbf
Unverified
Commit
5756bfbf
authored
Apr 05, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
Apr 05, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #76180 from nikhita/verify-publishing-bot-deps
Show all missing deps when publishing-bot rules has no listed dependencies
parents
0c32c22b
d474631e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
verify-publishing-bot.py
hack/verify-publishing-bot.py
+10
-9
No files found.
hack/verify-publishing-bot.py
View file @
5756bfbf
...
@@ -23,7 +23,7 @@ import json
...
@@ -23,7 +23,7 @@ import json
import
yaml
import
yaml
def
get_go
deps
_dependencies
(
rootdir
,
components
):
def
get_go
mod
_dependencies
(
rootdir
,
components
):
all_dependencies
=
{}
all_dependencies
=
{}
for
component
in
components
:
for
component
in
components
:
with
open
(
os
.
path
.
join
(
rootdir
,
component
,
"go.mod"
))
as
f
:
with
open
(
os
.
path
.
join
(
rootdir
,
component
,
"go.mod"
))
as
f
:
...
@@ -58,8 +58,9 @@ def main():
...
@@ -58,8 +58,9 @@ def main():
components
.
append
(
component
)
components
.
append
(
component
)
components
.
sort
()
components
.
sort
()
godep_dependencies
=
get_godeps_dependencies
(
rootdir
+
'/staging/src/k8s.io/'
,
components
)
rules_file
=
"/staging/publishing/rules.yaml"
rules_dependencies
=
get_rules_dependencies
(
rootdir
+
"/staging/publishing/rules.yaml"
)
gomod_dependencies
=
get_gomod_dependencies
(
rootdir
+
'/staging/src/k8s.io/'
,
components
)
rules_dependencies
=
get_rules_dependencies
(
rootdir
+
rules_file
)
processed_repos
=
[]
processed_repos
=
[]
for
rule
in
rules_dependencies
[
"rules"
]:
for
rule
in
rules_dependencies
[
"rules"
]:
...
@@ -70,10 +71,10 @@ def main():
...
@@ -70,10 +71,10 @@ def main():
raise
Exception
(
"cannot find master source branch for destination
%
s"
%
rule
[
"destination"
])
raise
Exception
(
"cannot find master source branch for destination
%
s"
%
rule
[
"destination"
])
print
(
"processing :
%
s"
%
rule
[
"destination"
])
print
(
"processing :
%
s"
%
rule
[
"destination"
])
if
rule
[
"destination"
]
not
in
go
dep
_dependencies
:
if
rule
[
"destination"
]
not
in
go
mod
_dependencies
:
raise
Exception
(
"missing
Godeps.json
for
%
s"
%
rule
[
"destination"
])
raise
Exception
(
"missing
go.mod
for
%
s"
%
rule
[
"destination"
])
processed_repos
.
append
(
rule
[
"destination"
])
processed_repos
.
append
(
rule
[
"destination"
])
for
dep
in
set
(
go
dep
_dependencies
[
rule
[
"destination"
]]):
for
dep
in
set
(
go
mod
_dependencies
[
rule
[
"destination"
]]):
found
=
False
found
=
False
if
"dependencies"
in
branch
:
if
"dependencies"
in
branch
:
for
dep2
in
branch
[
"dependencies"
]:
for
dep2
in
branch
[
"dependencies"
]:
...
@@ -84,12 +85,12 @@ def main():
...
@@ -84,12 +85,12 @@ def main():
found
=
True
found
=
True
else
:
else
:
raise
Exception
(
raise
Exception
(
"
destination
%
s does not have any dependencies (looking for
%
s)"
%
(
rule
[
"destination"
],
dep
))
"
Please add
%
s as dependencies under destination
%
s in
%
s"
%
(
gomod_dependencies
[
rule
[
"destination"
]],
rule
[
"destination"
],
rules_file
))
if
not
found
:
if
not
found
:
raise
Exception
(
"
destination
%
s does not have dependency
%
s"
%
(
rule
[
"destination"
],
dep
))
raise
Exception
(
"
Please add
%
s as a dependency under destination
%
s in
%
s"
%
(
dep
,
rule
[
"destination"
],
rules_file
))
else
:
else
:
print
(
" found dependency
%
s"
%
dep
)
print
(
" found dependency
%
s"
%
dep
)
items
=
set
(
go
dep
_dependencies
.
keys
())
-
set
(
processed_repos
)
items
=
set
(
go
mod
_dependencies
.
keys
())
-
set
(
processed_repos
)
if
len
(
items
)
>
0
:
if
len
(
items
)
>
0
:
raise
Exception
(
"missing rules for
%
s"
%
','
.
join
(
str
(
s
)
for
s
in
items
))
raise
Exception
(
"missing rules for
%
s"
%
','
.
join
(
str
(
s
)
for
s
in
items
))
print
(
"Done."
)
print
(
"Done."
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment