1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284
|
{% set branch = env.get('SYSTEM_PULLREQUEST_SOURCEBRANCH') if env.get('SYSTEM_PULLREQUEST_SOURCEBRANCH') else env.get('BUILD_SOURCEBRANCHNAME') %}
{% set build = env.get('BUILD_BUILDNUMBER') %}
{% set build_url = '%s%s/_build/results?buildId=%s' % (env.get('SYSTEM_TEAMFOUNDATIONCOLLECTIONURI'), env.get('SYSTEM_TEAMPROJECT'), env.get('BUILD_BUILDID')) %}
{% set commit = env.get('BUILD_SOURCEVERSION') %}
{% set isfork = env.get('SYSTEM_PULLREQUEST_ISFORK') == 'True' %}
{% set rel_url = env.get('RELEASE_RELEASEWEBURL') %}
{% set release = env.get('RELEASE_RELEASENAME') %}
{% set repo = env.get('BUILD_REPOSITORY_NAME') if isfork else ('Azure/' + repo_name) %}
{% macro pluralize(num, singular, plural) -%}
{% if num == 1 %}{{ singular }}{% else %}{{ plural }}{% endif %}
{%- endmacro %}
<!DOCTYPE html>
<html>
<head>
<title>{{ repo_name|capitalize }} Dependency Report</title>
<meta charset="UTF-8"/>
<style>
body {
font-family: Verdana, sans-serif;
font-size: 14px;
text-size-adjust: none;
}
table {
border-spacing: 0px;
width: 65%;
font-size: 14px;
}
table.condensed tr td {
padding: 7px 15px;
}
th, td {
padding: 15px;
border-bottom: 1px solid #ddd;
vertical-align:top;
}
tr:nth-child(even) {
background-color: #f2f2f2;
}
th {
background-color: #2E7CAF;
color: white;
font-weight: 300;
text-align: left;
}
th a {
color: white;
}
th.inconsistent {
background-color: #FF0000;
}
td.version {
width: 75px;
}
.tooltip {
position: relative;
display: inline-block;
border-bottom: 1px dotted black;
}
.tooltip .tooltiptext {
visibility: hidden;
background-color: black;
color: #fff;
white-space: nowrap;
text-align: left;
padding: 5px;
font-size: 14px;
position: absolute;
z-index: 1;
margin-top: 7px;
top: 100%;
left: 0%;
}
.tooltip .tooltiptext::after {
content: " ";
position: absolute;
bottom: 100%; /* At the top of the tooltip */
left: 5%;
margin-left: -5px;
border-width: 5px;
border-style: solid;
border-color: transparent transparent black transparent;
}
.tooltip:hover .tooltiptext {
visibility: visible;
}
.success {
color: #00CC00;
}
.fail {
color: #CC0000;
}
.dep_type {
border: 1px solid gray;
border-radius: 2px;
background: lightgray;
font-size: 10px;
padding: 1px 2px;
}
@media only screen and (max-width: 1350px) {
body, table {
font-size: 25px;
}
table {
width: 95%;
}
td.version {
width: 35px;
}
}
</style>
</head>
<body>
<center>
<h1>{{ repo_name|capitalize }} Dependency Report</h1>
<h3>
Generated at {{ curtime.replace(microsecond=0).isoformat() }}Z
{% if release %}
for release <a href="{{ rel_url }}">{{ release }}</a>
{% elif build %}
for build <a href="{{ build_url }}">{{ build }}</a>
{% if branch %}
<br/>from branch <a href="https://github.com/{{ repo }}/tree/{{ branch }}">{{ branch }}</a>
{% if isfork %}
in repo <a href="https://github.com/{{ repo }}">{{ repo }}</a>
{% endif %}
{% endif %}
{% if commit %}
(<a href="https://github.com/{{ repo }}/commit/{{ commit }}">{{ commit[:7] }}</a>)
{% endif %}
{% endif %}
</h3>
<p>
{{ dependencies|length - external|length }} internal and {{ external|length }} external package <a href="#dependencies">{{ pluralize(dependencies|length,'dependency</a> was','dependencies</a> were') }} analyzed to determine if any packages declare inconsistent dependency versions.<br/>
{% if inconsistent %}
<strong>{{ inconsistent|length }} inconsistent package dependency {{ pluralize(inconsistent|length,'version was','versions were') }} discovered.</strong><br/><br/>
{% else %}
No inconsistent package dependency versions were discovered.<br/><br/>
{% endif %}
{% if frozen %}
{{ frozen|length }} dependency {{ pluralize(frozen|length,'version was','versions were') }} discovered in the <a href="#lockfile">lockfile</a>.<br/>
{% if override_count %}
<strong>{{ override_count }} dependency version {{ pluralize(override_count,'override is','overrides are') }} present, causing dependency versions to differ from the version in the lockfile.</strong><br/>
{% endif %}
{% if new_reqs %}
<strong>{{ new_reqs|length }} {{ pluralize(new_reqs|length,'dependency is','dependencies are') }} missing from the lockfile.</strong><br/>
{% endif %}
{% if non_overridden_reqs_count %}
<strong>{{ non_overridden_reqs_count }} dependency {{ pluralize(non_overridden_reqs_count,'version does','versions do') }} not match the version in the lockfile.</strong><br/>
{% endif %}
{% if not new_reqs and not non_overridden_reqs_count %}
All declared dependency versions were validated against those in the lockfile.<br/>
{% endif %}
{% else %}
<strong>No lockfile is present in the repo, declared dependency versions were not able to be validated.</strong><br/>
{% endif %}
<br/>This report scanned {{ packages|length }} <a href="#packages">{{ pluralize(packages|length,'package','packages') }}</a>.
</p>
<a name="dependencies"/>
{% for dep_name in ordered_deps %}
<a name="dep_{{ dep_name }}"/>
<table>
<thead>
{% if loop.index == 1 %}
<tr><th colspan="2"><strong>Dependencies Discovered in Packages</strong></th></tr>
{% endif %}
<tr>
{% if dep_name in external %}
{% set dep_type = "external" %}
{% else %}
{% set dep_type = "internal" %}
{% endif %}
{% if dep_name in inconsistent %}
{% set dep_type = "inconsistent " + dep_type %}
{% endif %}
<th colspan="2" class="{{ dep_type }}"><strong>{{ dep_type|title }} Dependency:</strong> {{ dep_name }}</th></tr>
</thead>
<tbody>
{% for requirement, packages in dependencies[dep_name]|dictsort %}
<tr>
<td class="version">{{ requirement if requirement else '(empty)' }}</td>
<td>
{% for package_name in packages|sort %}
{{ package_name }}
{% if dep_name in overrides and requirement in overrides[dep_name] and package_name in overrides[dep_name][requirement] %}
<span class="dep_type">override</span>
{% endif %}
<br/>
{% endfor %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
<br/>
{% endfor %}
<br/><br/><hr/><br/><br/>
<a name="lockfile"/>
<table class="condensed">
<thead>
<tr><th colspan="3"><strong>Dependencies Frozen in Lockfile</strong></th></tr>
{% if frozen %}
<tr><th>Dependency</th><th>Frozen Version</th><th>Dependency State</th></tr>
{% endif %}
</thead>
<tbody>
{% for name, versions in frozen|dictsort %}
<tr>
<td><a href="#dep_{{ name }}">{{ name }}</a></td>
<td>{{ versions[0] if versions[0] else '(empty)' }}</td>
{% if name in missing_reqs %}
<td>⚠️ No packages reference this dependency</td>
{% elif name in changed_reqs %}
<td>
<div class="tooltip">❌ One or more packages reference a different version of this dependency
<span class="tooltiptext">
{% for spec, libs in dependencies[name]|dictsort %}
{% if spec != versions[0] %}
{% for package in libs|sort %}
{{ package }} ({{ spec }})
<br/>
{% endfor %}
{% endif %}
{% endfor %}
</span>
</div>
</td>
{% else %}
<td>✅ All packages validated against this dependency and version</td>
{% endif %}
</tr>
{% endfor %}
{% if not frozen %}
<tr><td colspan="2">Unable to open shared_requirements.txt, shared requirements have not been validated</td></tr>
{% endif %}
</tbody>
</table>
{% if frozen and new_reqs %}
<br/>
{% for name in new_reqs|sort %}
<table class="condensed">
<thead>
{% if loop.index == 1 %}
<tr><th colspan="2" class="inconsistent"><strong>Dependencies Missing from Lockfile</strong></th></tr>
{% endif %}
<tr><th colspan="2" class="inconsistent"><strong>Missing Dependency:</strong> <a href="#dep_{{ name }}">{{ name }}</a></th></tr>
</thead>
<tbody>
{% for requirement, packages in dependencies[name]|dictsort %}
<tr>
<td class="version">{{ requirement if requirement else '(empty)' }}</td>
<td>
{% for package_name in packages|sort %}
{{ package_name }}<br/>
{% endfor %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endfor %}
{% endif %}
<br/><br/><hr/><br/><br/>
<a name="packages"/>
<table class="condensed">
<thead>
<tr><th colspan="3"><strong>Packages Scanned for this Report</strong></th></tr>
<tr><th>Package Analyzed</th><th>Package Version</th><th>Package Source</th></tr>
</thead>
<tbody>
{% for name, info in packages|dictsort %}
<tr>
<td>{{ name }}</td>
<td>{{ info.version }}</td>
<td>{{ info.source }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</center>
</body>
</html>
|