queue: don't use the srcpkg to display information
Instead just use the srcinfo and the packages. In case a package moves between bases it would look up the old srcpkg and display outdated names. This is a leftover from when we had no srcinfo data.
This commit is contained in:
@@ -359,6 +359,29 @@ class Package:
|
||||
return state.sourceinfos[self.name].build_version
|
||||
return ""
|
||||
|
||||
@property
|
||||
def repo_url(self) -> str:
|
||||
if self.name in state.sourceinfos:
|
||||
return state.sourceinfos[self.name].repo_url
|
||||
for repo in get_repositories():
|
||||
if repo.name == self.repo:
|
||||
return repo.src_url
|
||||
return ""
|
||||
|
||||
@property
|
||||
def repo_path(self) -> str:
|
||||
if self.name in state.sourceinfos:
|
||||
return state.sourceinfos[self.name].repo_path
|
||||
return self.base
|
||||
|
||||
@property
|
||||
def history_url(self) -> str:
|
||||
return self.repo_url + ("/commits/master/" + quote(self.repo_path))
|
||||
|
||||
@property
|
||||
def source_url(self) -> str:
|
||||
return self.repo_url + ("/tree/master/" + quote(self.repo_path))
|
||||
|
||||
@property
|
||||
def key(self) -> PackageKey:
|
||||
return (self.repo, self.repo_variant,
|
||||
@@ -499,28 +522,19 @@ class Source:
|
||||
|
||||
@property
|
||||
def repo_url(self) -> str:
|
||||
for p in self.packages.values():
|
||||
if p.name in state.sourceinfos:
|
||||
return state.sourceinfos[p.name].repo_url
|
||||
for repo in get_repositories():
|
||||
if repo.name == p.repo:
|
||||
return repo.src_url
|
||||
return ""
|
||||
return self._package.repo_url
|
||||
|
||||
@property
|
||||
def repo_path(self) -> str:
|
||||
for p in self.packages.values():
|
||||
if p.name in state.sourceinfos:
|
||||
return state.sourceinfos[p.name].repo_path
|
||||
return self.name
|
||||
return self._package.repo_path
|
||||
|
||||
@property
|
||||
def source_url(self) -> str:
|
||||
return self.repo_url + ("/tree/master/" + quote(self.repo_path))
|
||||
return self._package.source_url
|
||||
|
||||
@property
|
||||
def history_url(self) -> str:
|
||||
return self.repo_url + ("/commits/master/" + quote(self.repo_path))
|
||||
return self._package.history_url
|
||||
|
||||
@property
|
||||
def filebug_url(self) -> str:
|
||||
|
||||
@@ -65,26 +65,22 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for (srcpkg, s, p, status) in updates %}
|
||||
{% for (srcinfo, p, status) in updates %}
|
||||
<tr>
|
||||
<td class="mytooltip">
|
||||
<a href="{{ srcpkg.history_url }}">{{ srcpkg.date.split()[0] }}</a>
|
||||
<a href="{{ srcinfo.history_url }}">{{ srcinfo.date.split()[0] }}</a>
|
||||
<template class="mytooltip-content">
|
||||
{{ srcpkg.date }} <span class="text-muted">(UTC)</span>
|
||||
{{ srcinfo.date }} <span class="text-muted">(UTC)</span>
|
||||
</template>
|
||||
</td>
|
||||
{% if s %}
|
||||
<td><a href="{{ url_for('base', base_name=s.name) }}">{{ s.name }}</a></td>
|
||||
{% else %}
|
||||
<td><a href="{{ srcpkg.source_url }}">{{ srcpkg.pkgbase }}</a></td>
|
||||
{% endif %}
|
||||
<td><a href="{{ srcinfo.source_url }}">{{ srcinfo.pkgbase }}</a></td>
|
||||
{% if p %}
|
||||
<td class="text-version">{{ p.version }}</td>
|
||||
{% else %}
|
||||
<td>-</td>
|
||||
{% endif %}
|
||||
<td>→</td>
|
||||
<td class="text-version">{{ srcpkg.build_version }}</td>
|
||||
<td class="text-version">{{ srcinfo.build_version }}</td>
|
||||
<td class="mytooltip text-{{ status[0].category or 'muted' }}">
|
||||
{{ status[0].status }}
|
||||
{% for s in status %}
|
||||
@@ -147,10 +143,10 @@ SigLevel = Never</code></pre>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for s, p, note in removals %}
|
||||
{% for p, note in removals %}
|
||||
<tr>
|
||||
<td class="mytooltip">
|
||||
<a href="{{ s.history_url }}">{{ (p.builddate|timestamp).split()[0] }}</a>
|
||||
<a href="{{ p.history_url }}">{{ (p.builddate|timestamp).split()[0] }}</a>
|
||||
<template class="mytooltip-content">
|
||||
{{ p.builddate|timestamp }} <span class="text-muted">(UTC)</span>
|
||||
</template>
|
||||
|
||||
14
app/web.py
14
app/web.py
@@ -585,7 +585,7 @@ def get_build_status(srcinfo: SrcInfoPackage, repo_list: Set[str] = set()) -> Li
|
||||
async def queue(request: Request, response: Response, repo: str = "") -> Response:
|
||||
# Create entries for all packages where the version doesn't match
|
||||
|
||||
UpdateEntry = Tuple[SrcInfoPackage, Optional[Source], Optional[Package], List[PackageBuildStatus]]
|
||||
UpdateEntry = Tuple[SrcInfoPackage, Optional[Package], List[PackageBuildStatus]]
|
||||
|
||||
repo_filter = repo or None
|
||||
repos = get_repositories()
|
||||
@@ -602,7 +602,7 @@ async def queue(request: Request, response: Response, repo: str = "") -> Respons
|
||||
if version_is_newer_than(srcinfo.build_version, p.version):
|
||||
srcinfo_repos.setdefault(srcinfo.pkgbase, set()).add(srcinfo.repo)
|
||||
repo_list = srcinfo_repos[srcinfo.pkgbase] if not repo_filter else set([repo_filter])
|
||||
grouped[srcinfo.pkgbase] = (srcinfo, s, p, get_build_status(srcinfo, repo_list))
|
||||
grouped[srcinfo.pkgbase] = (srcinfo, p, get_build_status(srcinfo, repo_list))
|
||||
|
||||
# new packages
|
||||
available: Dict[str, List[SrcInfoPackage]] = {}
|
||||
@@ -619,12 +619,10 @@ async def queue(request: Request, response: Response, repo: str = "") -> Respons
|
||||
for srcinfo in srcinfos:
|
||||
srcinfo_repos.setdefault(srcinfo.pkgbase, set()).add(srcinfo.repo)
|
||||
repo_list = srcinfo_repos[srcinfo.pkgbase] if not repo_filter else set([repo_filter])
|
||||
src, pkg = None, None
|
||||
pkg = None
|
||||
if srcinfo.pkgbase in grouped:
|
||||
src, pkg = grouped[srcinfo.pkgbase][1:3]
|
||||
elif srcinfo.pkgbase in state.sources:
|
||||
src = state.sources[srcinfo.pkgbase]
|
||||
grouped[srcinfo.pkgbase] = (srcinfo, src, pkg, get_build_status(srcinfo, repo_list))
|
||||
pkg = grouped[srcinfo.pkgbase][1]
|
||||
grouped[srcinfo.pkgbase] = (srcinfo, pkg, get_build_status(srcinfo, repo_list))
|
||||
|
||||
updates: List[UpdateEntry] = []
|
||||
updates = list(grouped.values())
|
||||
@@ -641,7 +639,7 @@ async def queue(request: Request, response: Response, repo: str = "") -> Respons
|
||||
if p.name not in state.sourceinfos:
|
||||
# FIXME: can also break things if it's the only provides and removed,
|
||||
# and also is ok to remove if there is a replacement
|
||||
removals.append((s, p, ", ".join([d.name for d in p.rdepends])))
|
||||
removals.append((p, ", ".join([d.name for d in p.rdepends])))
|
||||
|
||||
return templates.TemplateResponse("queue.html", {
|
||||
"request": request,
|
||||
|
||||
Reference in New Issue
Block a user