debian Package

debian Package

A package containing Debian-specific functionality of Distro Tracker.

models Module

Debian-specific models.

class distro_tracker.vendor.debian.models.BuildLogCheckStats(id, package, stats)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception BuildLogCheckStats.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

BuildLogCheckStats.id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

BuildLogCheckStats.objects = <django.db.models.manager.Manager object>
BuildLogCheckStats.package

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

restaurant.place is a ForwardOneToOneDescriptor instance.

BuildLogCheckStats.package_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

BuildLogCheckStats.stats

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class distro_tracker.vendor.debian.models.DebianContributor(*args, **kwargs)[source]

Bases: django.db.models.base.Model

Model containing additional Debian-specific information about contributors.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception DebianContributor.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

DebianContributor.agree_with_low_threshold_nmu

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

DebianContributor.allowed_packages

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

DebianContributor.email

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

restaurant.place is a ForwardOneToOneDescriptor instance.

DebianContributor.email_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

DebianContributor.id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

DebianContributor.is_debian_maintainer

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

DebianContributor.objects = <django.db.models.manager.Manager object>
class distro_tracker.vendor.debian.models.LintianStats(*args, **kwargs)[source]

Bases: django.db.models.base.Model

Model for lintian stats of packages.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception LintianStats.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

LintianStats.get_lintian_url(full=False)[source]

Returns the lintian URL for the package matching the LintianStats.

Parameters:full (Boolean) – Whether the URL should include the full lintian report or only the errors and warnings.
LintianStats.id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

LintianStats.objects = <django.db.models.manager.Manager object>
LintianStats.package

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

restaurant.place is a ForwardOneToOneDescriptor instance.

LintianStats.package_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

LintianStats.stats

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class distro_tracker.vendor.debian.models.PackageExcuses(id, package, excuses)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception PackageExcuses.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

PackageExcuses.excuses

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

PackageExcuses.id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

PackageExcuses.objects = <django.db.models.manager.Manager object>
PackageExcuses.package

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

restaurant.place is a ForwardOneToOneDescriptor instance.

PackageExcuses.package_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class distro_tracker.vendor.debian.models.PackageTransition(id, package, transition_name, status, reject)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception PackageTransition.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

PackageTransition.id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

PackageTransition.objects = <django.db.models.manager.Manager object>
PackageTransition.package

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

PackageTransition.package_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

PackageTransition.reject

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

PackageTransition.status

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

PackageTransition.transition_name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class distro_tracker.vendor.debian.models.UbuntuPackage(id, package, version, bugs, patch_diff)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception UbuntuPackage.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

UbuntuPackage.bugs

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

UbuntuPackage.id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

UbuntuPackage.objects = <django.db.models.manager.Manager object>
UbuntuPackage.package

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

restaurant.place is a ForwardOneToOneDescriptor instance.

UbuntuPackage.package_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

UbuntuPackage.patch_diff

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

UbuntuPackage.version

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

tracker_panels Module

class distro_tracker.vendor.debian.tracker_panels.BackToOldPTS(package, request)[source]

Bases: distro_tracker.core.panels.BasePanel

Display a message to users of the old PTS to encourage them to file bugs about issues that they discover and also to offer them a link back to the old PTS in case they need it.

context
has_content
panel_importance = 100
position = 'center'
template_name = 'debian/back-to-old-pts.html'
title = 'About the new package tracker'
classmethod unregister_plugin()

Bases: distro_tracker.core.panels.LinksPanelItemProvider

get_panel_items()[source]
classmethod unregister_plugin()

Bases: distro_tracker.core.panels.LinksPanelItemProvider

Add a link to debtags editor.

SOURCES_URL_TEMPLATE = 'https://debtags.debian.org/rep/todo/maint/{maint}#{package}'
get_panel_items()[source]
classmethod unregister_plugin()

Bases: distro_tracker.core.panels.LinksPanelItemProvider

If there are any known lintian issues for the package, provides a link to the lintian page.

get_panel_items()[source]
classmethod unregister_plugin()

Bases: distro_tracker.core.panels.LinksPanelItemProvider

POPCON_URL = 'https://qa.debian.org/popcon.php?package={package}'
get_panel_items()[source]
classmethod unregister_plugin()

Bases: distro_tracker.core.panels.LinksPanelItemProvider

Add a link to screenshots.debian.net

SOURCES_URL_TEMPLATE = 'https://screenshots.debian.net/package/{package}'
get_panel_items()[source]
classmethod unregister_plugin()

Bases: distro_tracker.core.panels.LinksPanelItemProvider

Add a link to the security tracker.

URL_TEMPLATE = 'https://security-tracker.debian.org/tracker/source-package/{package}'
get_panel_items()[source]
classmethod unregister_plugin()

Bases: distro_tracker.core.panels.LinksPanelItemProvider

Add links to sources.debian.org source code browser and the codesearch.debian.net code search (if the package is found in unstable).

ALLOWED_REPOSITORIES = ('unstable', 'experimental', 'testing', 'stable', 'oldstable')

A list of repositories that cause the sources.debian.org link to be displayed if the package is found in one of them.

SEARCH_FORM_TEMPLATE = '<form class="code-search-form" action="/codesearch/" method="get" target="_blank"><input type="hidden" name="package" value="{package}"><input type="search" name="query" placeholder="search source code"></form>'
SOURCES_URL_TEMPLATE = 'https://sources.debian.org/src/{package}/{suite}/'
get_panel_items()[source]
classmethod unregister_plugin()
class distro_tracker.vendor.debian.tracker_panels.TransitionsPanel(package, request)[source]

Bases: distro_tracker.core.panels.BasePanel

context
has_content
panel_importance = 2
position = 'center'
template_name = 'debian/transitions-panel.html'
title = 'testing migrations'
classmethod unregister_plugin()
class distro_tracker.vendor.debian.tracker_panels.UbuntuPanel(package, request)[source]

Bases: distro_tracker.core.panels.BasePanel

context
has_content
position = 'right'
template_name = 'debian/ubuntu-panel.html'
title = 'ubuntu'
classmethod unregister_plugin()

tracker_tasks Module

Debian-specific tasks.

class distro_tracker.vendor.debian.tracker_tasks.DebianWatchFileScannerUpdate(force_update=False, *args, **kwargs)[source]

Bases: distro_tracker.core.tasks.BaseTask

ACTION_ITEM_TEMPLATES = {'new-upstream-version': 'debian/new-upstream-version-action-item.html', 'watch-failure': 'debian/watch-failure-action-item.html'}
ACTION_ITEM_TYPE_NAMES = ('new-upstream-version', 'watch-failure')
ITEM_DESCRIPTIONS = {'new-upstream-version': <function DebianWatchFileScannerUpdate.<lambda>>, 'watch-failure': <function DebianWatchFileScannerUpdate.<lambda>>}
ITEM_SEVERITIES = {'new-upstream-version': 3, 'watch-failure': 3}
execute()[source]
get_upstream_status_stats(stats)[source]

Gets the stats from the downloaded data and puts them in the given stats dictionary. The keys of the dict are package names.

Returns:A a two-tuple where the first item is a list of packages which have new upstream versions and the second is a list of packages which have watch failures.
set_parameters(parameters)[source]
classmethod unregister_plugin()
update_action_item(item_type, package, stats)[source]

Updates the action item of the given type for the given package based on the given stats.

The severity of the item is defined by the ITEM_SEVERITIES dict.

The short descriptions are created by passing the ActionItem (with extra data already set) to the callables defined in ITEM_DESCRIPTIONS.

Parameters:
  • item_type (string) – The type of the ActionItem that should be updated.
  • package (distro_tracker.core.models.PackageName) – The package to which this action item should be associated.
  • stats (dict) – The stats which are used to create the action item.
class distro_tracker.vendor.debian.tracker_tasks.MultiArchHintsTask(force_update=False, *args, **kwargs)[source]

Bases: distro_tracker.core.tasks.BaseTask

ACTIONS_URL = 'https://dedup.debian.net/static/multiarch-hints.yaml'
ACTIONS_WEB = 'https://wiki.debian.org/MultiArch/Hints'
ACTION_ITEM_DESCRIPTION = '<a href="{link}">Multiarch hinter</a> reports {count} issue(s)'
ACTION_ITEM_TEMPLATE = 'debian/multiarch-hints.html'
ACTION_ITEM_TYPE_NAME = 'debian-multiarch-hints'
execute()[source]
get_data()[source]
get_packages()[source]
set_parameters(parameters)[source]
classmethod unregister_plugin()
update_action_item(package, severity, description, extra_data)[source]
class distro_tracker.vendor.debian.tracker_tasks.RetrieveDebianMaintainersTask(force_update=False, *args, **kwargs)[source]

Bases: distro_tracker.core.tasks.BaseTask

Retrieves (and updates if necessary) a list of Debian Maintainers.

execute()[source]
set_parameters(parameters)[source]
classmethod unregister_plugin()
class distro_tracker.vendor.debian.tracker_tasks.RetrieveLowThresholdNmuTask(force_update=False, *args, **kwargs)[source]

Bases: distro_tracker.core.tasks.BaseTask

Updates the list of Debian Maintainers which agree with the lowthreshold NMU.

execute()[source]
set_parameters(parameters)[source]
classmethod unregister_plugin()
class distro_tracker.vendor.debian.tracker_tasks.UpdateAutoRemovalsStatsTask(force_update=False, *args, **kwargs)[source]

Bases: distro_tracker.core.tasks.BaseTask

A task for updating autoremovals information on all packages.

ACTION_ITEM_TEMPLATE = 'debian/autoremoval-action-item.html'
ACTION_ITEM_TYPE_NAME = 'debian-autoremoval'
ITEM_DESCRIPTION = 'Marked for autoremoval on {removal_date}: {bugs}'
execute()[source]
get_autoremovals_stats()[source]

Retrieves and parses the autoremoval stats for all packages. Autoremoval stats include the BTS bugs id.

Returns:A dict mapping package names to autoremoval stats.
set_parameters(parameters)[source]
classmethod unregister_plugin()
update_action_item(package, stats)[source]

Creates an ActionItem instance for the given type indicating that the package has an autoremoval issue.

class distro_tracker.vendor.debian.tracker_tasks.UpdateBuildLogCheckStats(force_update=False, *args, **kwargs)[source]

Bases: distro_tracker.core.tasks.BaseTask

ACTION_ITEM_TYPE_NAME = 'debian-build-logcheck'
ITEM_DESCRIPTION = 'Build log checks report <a href="{url}">{report}</a>'
ITEM_FULL_DESCRIPTION_TEMPLATE = 'debian/logcheck-action-item.html'
create_action_item(package, stats)[source]

Creates a distro_tracker.core.models.ActionItem instance for the given package if the build logcheck stats indicate

execute()[source]
get_buildd_stats()[source]
set_parameters(parameters)[source]
classmethod unregister_plugin()
class distro_tracker.vendor.debian.tracker_tasks.UpdateBuildReproducibilityTask(force_update=False, *args, **kwargs)[source]

Bases: distro_tracker.core.tasks.BaseTask

ACTION_ITEM_TEMPLATE = 'debian/build-reproducibility-action-item.html'
ACTION_ITEM_TYPE_NAME = 'debian-build-reproducibility'
BASE_URL = 'https://tests.reproducible-builds.org'
ITEM_DESCRIPTION = {'FTBFS': '<a href="{url}">Fails to build</a> during reproducibility testing', '404': None, 'blacklisted': '<a href="{url}">Blacklisted</a> from build reproducibility testing', 'reproducible': None, 'not for us': None, 'unreproducible': '<a href="{url}">Does not build reproducibly</a> during testing'}
execute()[source]
get_build_reproducibility()[source]
set_parameters(parameters)[source]
classmethod unregister_plugin()
update_action_item(package, status)[source]
class distro_tracker.vendor.debian.tracker_tasks.UpdateDebciStatusTask(force_update=False, *args, **kwargs)[source]

Bases: distro_tracker.core.tasks.BaseTask

Updates packages’ debci status.

ACTION_ITEM_TYPE_NAME = 'debci-failed-tests'
ITEM_DESCRIPTION = 'Debci reports <a href="{debci_url}">failed tests</a> (<a href="{log_url}">log</a>)'
ITEM_FULL_DESCRIPTION_TEMPLATE = 'debian/debci-action-item.html'
execute()[source]
get_debci_status()[source]
set_parameters(parameters)[source]
classmethod unregister_plugin()
update_action_item(package, debci_status)[source]

Updates the ActionItem for the given package based on the DebciStatus <distro_tracker.vendor.debian.models.DebciStatus If the package has test failures an ActionItem is created.

class distro_tracker.vendor.debian.tracker_tasks.UpdateDebianDuckTask(force_update=False, *args, **kwargs)[source]

Bases: distro_tracker.core.tasks.BaseTask

A task for updating upstream url issue information on all packages.

ACTION_ITEM_TEMPLATE = 'debian/duck-action-item.html'
ACTION_ITEM_TYPE_NAME = 'debian-duck'
DUCK_SP_LIST_URL = 'http://duck.debian.net/static/sourcepackages.txt'
ITEM_DESCRIPTION = 'The URL(s) for this package had some recent persistent <a href="{issues_link}">issues</a>'
execute()[source]
set_parameters(parameters)[source]
classmethod unregister_plugin()
update_action_item(package)[source]
class distro_tracker.vendor.debian.tracker_tasks.UpdateExcusesTask(force_update=False, *args, **kwargs)[source]

Bases: distro_tracker.core.tasks.BaseTask

ACTION_ITEM_TYPE_NAME = 'debian-testing-migration'
ITEM_DESCRIPTION = 'The package has not entered testing even though the delay is over'
ITEM_FULL_DESCRIPTION_TEMPLATE = 'debian/testing-migration-action-item.html'
execute()[source]
set_parameters(parameters)[source]
classmethod unregister_plugin()
class distro_tracker.vendor.debian.tracker_tasks.UpdateLintianStatsTask(force_update=False, *args, **kwargs)[source]

Bases: distro_tracker.core.tasks.BaseTask

Updates packages’ lintian stats.

ACTION_ITEM_TYPE_NAME = 'lintian-warnings-and-errors'
ITEM_DESCRIPTION = 'lintian reports <a href="{url}">{report}</a>'
ITEM_FULL_DESCRIPTION_TEMPLATE = 'debian/lintian-action-item.html'
execute()[source]
get_lintian_stats()[source]
set_parameters(parameters)[source]
classmethod unregister_plugin()
update_action_item(package, lintian_stats)[source]

Updates the ActionItem for the given package based on the LintianStats <distro_tracker.vendor.debian.models.LintianStats given in package_stats. If the package has errors or warnings an ActionItem is created.

class distro_tracker.vendor.debian.tracker_tasks.UpdateNewQueuePackages(force_update=False, *args, **kwargs)[source]

Bases: distro_tracker.core.tasks.BaseTask

Updates the versions of source packages found in the NEW queue.

EXTRACTED_INFO_KEY = 'debian-new-queue-info'
execute()[source]
extract_package_info(content)[source]

Extracts the package information from the content of the NEW queue. :returns: A dict mapping package names to a dict mapping the

distribution name in which the package is found to the version information for the most recent version of the package in the dist.
set_parameters(parameters)[source]
classmethod unregister_plugin()
class distro_tracker.vendor.debian.tracker_tasks.UpdatePackageBugStats(force_update=False, *args, **kwargs)[source]

Bases: distro_tracker.core.tasks.BaseTask

Updates the BTS bug stats for all packages (source, binary and pseudo). Creates distro_tracker.core.ActionItem instances for packages which have bugs tagged help or patch.

HELP_BUG_ACTION_ITEM_TYPE_NAME = 'debian-help-bugs-warning'
HELP_ITEM_FULL_DESCRIPTION_TEMPLATE = 'debian/help-bugs-action-item.html'
HELP_ITEM_SHORT_DESCRIPTION = '<a href="{url}">{count}</a> tagged help in the <abbr title="Bug Tracking System">BTS</abbr>'
PATCH_BUG_ACTION_ITEM_TYPE_NAME = 'debian-patch-bugs-warning'
PATCH_ITEM_FULL_DESCRIPTION_TEMPLATE = 'debian/patch-bugs-action-item.html'
PATCH_ITEM_SHORT_DESCRIPTION = '<a href="{url}">{count}</a> tagged patch in the <abbr title="Bug Tracking System">BTS</abbr>'
bug_categories = ('rc', 'normal', 'wishlist', 'fixed', 'patch')
execute()[source]
classmethod unregister_plugin()
update_binary_bugs()[source]

Performs the update of bug statistics for binary packages.

update_source_and_pseudo_bugs()[source]

Performs the update of bug statistics for source and pseudo packages.

class distro_tracker.vendor.debian.tracker_tasks.UpdatePackageScreenshotsTask(force_update=False, *args, **kwargs)[source]

Bases: distro_tracker.core.tasks.BaseTask

Check if a screenshot exists on screenshots.debian.net, and add a key to PackageExtractedInfo if it does.

EXTRACTED_INFO_KEY = 'screenshots'
execute()[source]
set_parameters(parameters)[source]
classmethod unregister_plugin()
class distro_tracker.vendor.debian.tracker_tasks.UpdatePiuPartsTask(force_update=False, *args, **kwargs)[source]

Bases: distro_tracker.core.tasks.BaseTask

Retrieves the piuparts stats for all the suites defined in the distro_tracker.project.local_settings.DISTRO_TRACKER_DEBIAN_PIUPARTS_SUITES

ACTION_ITEM_TEMPLATE = 'debian/piuparts-action-item.html'
ACTION_ITEM_TYPE_NAME = 'debian-piuparts-test-fail'
ITEM_DESCRIPTION = 'piuparts found (un)installation error(s)'
create_action_item(package, suites)[source]

Creates an ActionItem instance for the package based on the list of suites in which the piuparts installation test failed.

execute()[source]
get_piuparts_stats()[source]
set_parameters(parameters)[source]
classmethod unregister_plugin()
class distro_tracker.vendor.debian.tracker_tasks.UpdateSecurityIssuesTask(force_update=False, *args, **kwargs)[source]

Bases: distro_tracker.core.tasks.BaseTask

ACTION_ITEM_TEMPLATE = 'debian/security-issue-action-item.html'
ACTION_ITEM_TYPE_NAME = 'debian-security-issue-in-{}'
ITEM_DESCRIPTION_TEMPLATE = {'nodsa': '<a href="{url}">{count} ignored security {issue}</a> in {release}', 'none': 'No known security issue in {release}', 'open': '<a href="{url}">{count} security {issue}</a> in {release}'}
action_item_type(release)[source]
execute()[source]
classmethod generate_package_data(issues)[source]
classmethod get_issues_stats(content)[source]

Gets package issue stats from Debian’s security tracker.

static get_issues_summary(issues)[source]
process_pkg_action_items(pkgdata, existing_action_items)[source]
set_parameters(parameters)[source]
classmethod unregister_plugin()
update_action_item(stats, action_item)[source]

Updates the debian-security-issue action item based on the count of security issues.

class distro_tracker.vendor.debian.tracker_tasks.UpdateTransitionsTask(force_update=False, *args, **kwargs)[source]

Bases: distro_tracker.core.tasks.BaseTask

PACKAGE_TRANSITION_LIST_URL = 'https://release.debian.org/transitions/export/packages.yaml'
REJECT_LIST_URL = 'https://ftp-master.debian.org/transitions.yaml'
execute()[source]
set_parameters(parameters)[source]
classmethod unregister_plugin()
class distro_tracker.vendor.debian.tracker_tasks.UpdateUbuntuStatsTask(force_update=False, *args, **kwargs)[source]

Bases: distro_tracker.core.tasks.BaseTask

The task updates Ubuntu stats for packages. These stats are displayed in a separate panel.

execute()[source]
get_ubuntu_bug_stats()[source]

Retrieves the Ubuntu bug stats of a package. Bug stats contain the count of bugs and the count of patches.

Returns:A dict mapping package names to a dict of package stats.
get_ubuntu_patch_diffs()[source]

Retrieves the Ubuntu patch diff information. The information consists of the diff URL and the version of the Ubuntu package to which the diff belongs to.

Returns:A dict mapping package names to diff information.
get_ubuntu_versions()[source]

Retrieves the Ubuntu package versions.

Returns:A dict mapping package names to Ubuntu versions.
set_parameters(parameters)[source]
classmethod unregister_plugin()
class distro_tracker.vendor.debian.tracker_tasks.UpdateVcsWatchTask(force_update=False, *args, **kwargs)[source]

Bases: distro_tracker.core.tasks.BaseTask

Updates packages’ vcswatch stats.

ACTION_ITEM_TYPE_NAME = 'vcswatch-warnings-and-errors'
ITEM_FULL_DESCRIPTION_TEMPLATE = 'debian/vcswatch-action-item.html'
VCSWATCH_DATA_URL = 'https://qa.debian.org/data/vcswatch/vcswatch.json.gz'
VCSWATCH_STATUS_DICT = {'COMMITS': {'severity': 2, 'description': '<a href="{url}">{commits} new commit</a> since last upload, time to release an update?'}, 'NEW': {'severity': 2, 'description': 'A new version is <a href="{url}">available in the VCS</a>, consider uploading it.'}, 'OLD': {'severity': 3, 'description': 'The <a href="{url}">VCS repository is not up to date</a>, consider pushing the missing commits.'}, 'UNREL': {'severity': 3, 'description': 'The <a href="{url}">VCS repository is not up to date</a>, consider pushing the missing commits.'}, 'ERROR': {'severity': 3, 'description': '<a href="{url}">Error while accessing the VCS repository</a>. Please troubleshot and fix the issue.'}, 'DEFAULT': {'severity': 3, 'description': '<a href="{url}">Unexpected status</a> ({status}) reported by VcsWatch.'}}
VCSWATCH_URL = 'https://qa.debian.org/cgi-bin/vcswatch?package=%(package)s'
clean_package_info(package_infos_without_watch, todo)[source]

Takes a list of PackageExtractedInfo which do not have a watch entry and cleans it. Then schedule in todo what to do with them.

execute()[source]
get_vcswatch_data()[source]
set_parameters(parameters)[source]
classmethod unregister_plugin()
update_action_item(package, vcswatch_data, action_item, todo)[source]

For a given ActionItem and a given vcswatch data, updates properly the todo dict if required.

Returns dependingly on what has been done. If something is to be updated, returns True, if nothing is to be updated, returns False. If the calling loop should continue, returns None.

Return type:bool or None
update_package_info(package, vcswatch_data, package_info, todo)[source]
update_packages_item(packages, vcswatch_datas)[source]

Generates the lists of ActionItem to be added, deleted or updated regarding the status of their packages.

Categories of statuses are: {u’COMMITS’, u’ERROR’, u’NEW’, u’OK’, u’OLD’, u’UNREL’}

Basically, it fetches all info from PackageExtractedInfo with key=’vcs’, the ones without data matching vcswatch_datas are stored in one variable that’s iterated through directly, and if there was something before, it is purged. Then, all entries in that queryset that have no relevant intel anymore are scheduled to be deleted. The others are only updated.

All PackageExtractedInfo matching vcswatch_datas are stored in another variable. The same is done with the list of ActionItem that match this task type.

Then, it iterates on all vcswatch_datas’ packages and it tries to determine if there are any news, if so, it updates apopriately the prospective ActionItem and PackageExtractedInfo, and schedule them to be updated. If no data was existent, then it creates them and schedule them to be added to the database.

At the end, this function returns a dict of all instances of ActionItem and PackageExtractedInfo stored in subdicts depending on their class and what is to be done with them.

Return type:dict
class distro_tracker.vendor.debian.tracker_tasks.UpdateWnppStatsTask(force_update=False, *args, **kwargs)[source]

Bases: distro_tracker.core.tasks.BaseTask

The task updates the WNPP bugs for all packages.

ACTION_ITEM_TEMPLATE = 'debian/wnpp-action-item.html'
ACTION_ITEM_TYPE_NAME = 'debian-wnpp-issue'
ITEM_DESCRIPTION = '<a href="{url}">{wnpp_type}: {wnpp_msg}</a>'
execute()[source]
get_wnpp_stats()[source]

Retrieves and parses the wnpp stats for all packages. WNPP stats include the WNPP type and the BTS bug id.

Returns:A dict mapping package names to wnpp stats.
set_parameters(parameters)[source]
classmethod unregister_plugin()
update_action_item(package, stats)[source]

Creates an ActionItem instance for the given type indicating that the package has a WNPP issue.

update_depneedsmaint_action_item(package_needs_maintainer, stats)[source]

rules Module

distro_tracker.vendor.debian.rules.add_new_headers(received_message, package_name, keyword)[source]
Debian adds the following new headers:
  • X-Debian-Package
  • X-Debian
Parameters:
  • received_message (email.message.Message) – The original received package message
  • package_name (string) – The name of the package for which the message was intended
  • keyword (string) – The keyword with which the message is tagged.
distro_tracker.vendor.debian.rules.allow_package(stanza)[source]

The function provides a way for vendors to exclude some packages from being saved in the database.

In Debian’s case, this is done for packages where the Extra-Source-Only is set since those packages are in the repository only for various compliance reasons.

Parameters:stanza (case-insensitive dict) – The raw package entry from a Sources file.
distro_tracker.vendor.debian.rules.approve_default_message(msg)[source]

Debian approves a default message only if it has a X-Bugzilla-Product header.

Parameters:msg (email.message.Message) – The original received package message
distro_tracker.vendor.debian.rules.classify_message(msg, package, keyword)[source]
distro_tracker.vendor.debian.rules.create_dak_rm_news(message, package, body=None, version='')[source]
distro_tracker.vendor.debian.rules.create_news_from_email_message(message)[source]

In Debian’s implementation, this function creates news when the received mail’s origin is either the testing watch or katie.

distro_tracker.vendor.debian.rules.get_binary_package_bug_stats(binary_name)[source]

Returns the bug statistics for the given binary package.

Debian’s implementation filters out some of the stored bug category stats. It also provides a different, more verbose, display name for each of them. The included categories and their names are:

  • rc - critical, grave serious
  • normal - important and normal
  • wishlist - wishlist and minor
  • fixed - pending and fixed
distro_tracker.vendor.debian.rules.get_bug_panel_stats(package_name)[source]

Returns bug statistics which are to be displayed in the bugs panel (BugsPanel).

Debian wants to include the merged bug count for each bug category (but only if the count is different than non-merged bug count) so this function is used in conjunction with a custom bug panel template which displays this bug count in parentheses next to the non-merged count.

Each bug category count (merged and non-merged) is linked to a URL in the BTS which displays more information about the bugs found in that category.

A verbose name is included for each of the categories.

The function includes a URL to a bug history graph which is displayed in the rendered template.

distro_tracker.vendor.debian.rules.get_bug_tracker_url(package_name, package_type, category_name)[source]

Returns a URL to the BTS for the given package for the given bug category name.

The following categories are recognized for Debian’s implementation:

  • all - all bugs for the package
  • all-merged - all bugs, including the merged ones
  • rc - release critical bugs
  • rc-merged - release critical bugs, including the merged ones
  • normal - bugs tagged as normal and important
  • normal - bugs tagged as normal and important, including the merged ones
  • wishlist - bugs tagged as wishlist and minor
  • wishlist-merged - bugs tagged as wishlist and minor, including the merged ones
  • fixed - bugs tagged as fixed and pending
  • fixed-merged - bugs tagged as fixed and pending, including the merged ones
Parameters:
  • package_name – The name of the package for which the BTS link should be provided.
  • package_type – The type of the package for which the BTS link should be provided. For Debian this is one of: source, pseudo, binary.
  • category_name – The name of the bug category for which the BTS link should be provided. It is one of the categories listed above.
Return type:

string or None if there is no BTS bug for the given category.

distro_tracker.vendor.debian.rules.get_developer_information_url(developer_email)[source]

Return a URL to extra information about a developer, by email address.

distro_tracker.vendor.debian.rules.get_external_version_information_urls(package_name)[source]

The function returns a list of external Web resources which provide additional information about the versions of a package.

distro_tracker.vendor.debian.rules.get_extra_versions(package)[source]
Returns:The versions of the package found in the NEW queue.
distro_tracker.vendor.debian.rules.get_maintainer_extra(developer_email, package_name=None)[source]

The function returns a list of additional items that are to be included in the general panel next to the maintainer. This includes:

  • Whether the maintainer agrees with lowthreshold NMU
  • Whether the maintainer is a Debian Maintainer
distro_tracker.vendor.debian.rules.get_package_information_site_url(package_name, source_package=False, repository=None, version=None)[source]

Return a link pointing to more information about a package in a given repository.

distro_tracker.vendor.debian.rules.get_pseudo_package_list()[source]

Existing pseudo packages for Debian are obtained from BTS

distro_tracker.vendor.debian.rules.get_uploader_extra(developer_email, package_name=None)[source]

The function returns a list of additional items that are to be included in the general panel next to an uploader. This includes:

  • Whether the uploader is a DebianMaintainer
distro_tracker.vendor.debian.rules.post_logout(request, user, next_url=None)[source]

If the user is authenticated via the SSO, sign them out at the SSO level too.

distro_tracker.vendor.debian.rules.pre_login(form)[source]

If the user has a @debian.org email associated, don’t let them log in directly through local authentication.

tests Module

Tests for Debian-specific modules/functionality of Distro Tracker.

class distro_tracker.vendor.debian.tests.CodeSearchLinksTest(methodName='runTest')[source]

Bases: distro_tracker.test.TestCase

Tests that the code search links are shown in the package page.

get_package_page_response(package_name)[source]
search_form_in_content(content)[source]
setUp()[source]
test_code_search_view_empty_query()[source]

Test codesearch view with empty query

test_code_search_view_missing_package_parameter()[source]

Test codesearch view with missing package parameter

test_code_search_view_missing_query_parameter()[source]

Test codesearch view with missing query parameter

test_code_search_view_redirect_simple()[source]

Test codesearch view redirects properly

test_code_search_view_urlencode_where_needed()[source]

Test codesearch view urlencode stuff

test_package_in_stable()[source]

Tests that only the browse source code link appears when the package is only in stable.

test_package_in_unstable()[source]

Tests that the search form is shown in addition to the browse source link if the package is found in unstable.

test_package_not_in_allowed_repository()[source]

Tests that no links are added when the package is not found in one of the allowed repositories (distro_tracker.vendor.debian.tracker_panels.SourceCodeSearchLinks.ALLOWED_REPOSITORIES)

test_pseudo_package()[source]

Tests that neither link is shown when the package is a pseudo package, instead of a source package.

class distro_tracker.vendor.debian.tests.DebianBugActionItemsTests(methodName='runTest')[source]

Bases: distro_tracker.test.TestCase

Tests the creation of distro_tracker.core.ActionItem instances based on Debian bug stats.

add_help_bug(package, bug_count)[source]

Helper method adding help bugs to the stub return value.

add_patch_bug(package, bug_count)[source]

Helper method adding patch bugs to the stub return value.

add_udd_bug_category(package, category, bug_count)[source]

Adds stats for a bug category to the stub response, as if the category was found in the UDD bug stats.

get_help_action_type()[source]

Helper method returning a distro_tracker.core.models.ActionItemType for the debian help bug warning action item type.

get_patch_action_type()[source]

Helper method returning a distro_tracker.core.models.ActionItemType for the debian patch bug warning action item type.

run_task()[source]
setUp()[source]
static stub_tagged_bugs(tag, user=None, help_bugs=None, newcomer_bugs=None)[source]
test_action_item_for_multiple_packages()[source]

Tests that action items are correctly created when more than one package has bug warnings.

test_help_action_item_updated()[source]

Tests that an already existing action item is updated after running the task.

test_help_bug_action_item()[source]

Tests that an action item is created when there are bugs tagged help.

test_help_bug_action_item_removed()[source]

Tests that an already existing action item is removed after the update does not contain any more bugs in the help category.

test_help_bug_action_item_removed_no_data()[source]

Tests that an already existing action item is removed if the update does not give any stats at all.

test_help_bug_action_item_removed_no_data_for_category()[source]

Tests that an already existing action item is removed if the update does not contain stats for the help category, but does contain stats for different categories.

test_multiple_action_items_for_package()[source]

Tests that multiple distro_tracker.core.models.ActionItem instances are created for a package if it contains both patch and help bugs.

test_patch_bug_action_item()[source]

Tests that an action item is created when there are bugs tagged patch.

test_patch_bug_action_item_removed()[source]

Tests that an already existing action item is removed after the update does not contain any more bugs in the patch category.

test_patch_bug_action_item_removed_no_data()[source]

Tests that an already existing action item is removed if the update does not give any stats at all.

test_patch_bug_action_item_removed_no_data_for_category()[source]

Tests that an already existing action item is removed if the update does not contain stats for the patch category, but does contain stats for different categories.

test_patch_bug_action_item_updated()[source]

Tests that an already existing action item is updated after running the task.

class distro_tracker.vendor.debian.tests.DebianContributorExtraTest(methodName='runTest')[source]

Bases: distro_tracker.test.TestCase

test_maintainer_extra()[source]
test_uploader_extra()[source]
class distro_tracker.vendor.debian.tests.DebianNewsFromEmailTest(methodName='runTest')[source]

Bases: distro_tracker.test.TestCase

Tests creating Debian-specific news from received emails.

add_header(header_name, header_value)[source]
get_accepted_subject(pkg, version)[source]

Helper method returning the subject of an email notifying of a new source upload.

get_removed_from_testing_subject(pkg)[source]

Helper method providing the subject of an email from testing watch.

process_mail()[source]
setUp()[source]
set_message_content(content)[source]
set_subject(subject)[source]
test_dak_not_rm()[source]

Tests that a message with an X-DAK header different from dak rm does not create any news item.

test_dak_rm_news()[source]

Tests that a dak rm message creates a news.

test_dak_rm_no_package()[source]

Tests that a dak rm message referencing a package which Distro Tracker does not track, does not create any news.

test_multiple_removes()[source]

Tests that multiple news items are created when the dak rm message contains multiple remove notifications.

test_source_upload_news()[source]

Tests the news created when a notification of a new source upload is received.

test_source_upload_package_does_not_exist()[source]

Tests that a news and the associated source package are created when the notification of a new source upload for a package not yet tracked by Distro Tracker is received.

test_testing_watch_news()[source]

Tests that an email received from the Testing Watch is turned into a news item.

test_testing_watch_package_no_exist()[source]

Tests that an email received from the Testing Watch which references a package not tracked by Distro Tracker does not create any news items.

class distro_tracker.vendor.debian.tests.DebianSsoLoginTests(methodName='runTest')[source]

Bases: distro_tracker.test.TestCase

Tests relating to logging in via the sso.debian.org via DACS (which sets REMOTE_USER).

ALIOTH_EMAIL = 'foo-guest@users.alioth.debian.org'
ALIOTH_USER = 'DEBIANORG::DEBIAN:foo-guest@users.alioth.debian.org'
DD_EMAIL = 'user@debian.org'
DD_USER = 'DEBIANORG::DEBIAN:user'
INVALID_USER = 'FEDERATION::JURISDICTION:user'
assert_no_user_logged_in()[source]
assert_user_logged_in(user)[source]
get_page(remote_user=None)[source]
test_authenticate_returns_correct_class(get_user_details)[source]
test_authenticate_returns_correct_class_with_existing_user(get_user_details)[source]
test_first_log_in(get_user_details)[source]

Tests that when a Debian Developer first logs in an account is automatically created.

test_first_log_in_preexisting(get_user_details)[source]

Tests that an already existing user is logged in without modifying the account fields.

test_first_log_in_preexisting_associated(get_user_details)[source]

Tests that an already existing user that has an associated (not main_email) @debian.org address is logged in without modifying the account fields.

test_first_log_in_preexisting_useremail(get_user_details)[source]
test_first_log_in_via_alioth(get_user_details)[source]

Tests that when an Alioth user first logs in an account is automatically created.

test_no_log_in_invalid_username(get_user_details)[source]

Tests that no user is logged in when the federation or jurisdiction are incorrect.

test_user_logged_out(get_user_details)[source]

Tests that Distro Tracker logs out the user after the SSO headers are invalid.

test_user_logged_out_no_header(get_user_details)[source]

Tests that Distro Tracker logs out the user if the SSO headers are gone.

class distro_tracker.vendor.debian.tests.DebianSsoLoginWithSSLClientCertificateTests(methodName='runTest')[source]

Bases: distro_tracker.vendor.debian.tests.DebianSsoLoginTests

Tests relating to logging in with a SSL client certificate generated on sso.debian.org. See https://wiki.debian.org/DebianSingleSignOn

ALIOTH_EMAIL = 'foo-guest@users.alioth.debian.org'
ALIOTH_USER = 'foo-guest@users.alioth.debian.org'
DD_EMAIL = 'user@debian.org'
DD_USER = 'user@debian.org'
get_page(remote_user=None)[source]
test_no_log_in_invalid_username()[source]
class distro_tracker.vendor.debian.tests.DebianWatchFileScannerUpdateTests(methodName='runTest')[source]

Bases: distro_tracker.test.TestCase

Tests that distro_tracker.core.models.ActionItem instances are correctly created when running the distro_tracker.vendor.debian.tracker_tasks.UpdateBuildLogCheckStats task.

get_item_type(type_name)[source]

Helper method returning a distro_tracker.core.models.ActionItemType instance with the given type name.

run_task()[source]
setUp()[source]
set_upstream_status_content(content)[source]

Sets the stub content returned to the task as UDD DEHS data. :param content: A list of dicts of information returned by UDD. The

content given as a response to the task will be the YAML encoded representation of this list.
test_new_upstream_version_item_created()[source]

Tests that a new upstream version item is created when a package has a newer upstream version according to DEHS data retrieved from UDD.

test_new_upstream_version_item_removed()[source]

Tests that a new upstream version item is removed when a package no longer has a newer upstream version.

test_new_upstream_version_item_updated()[source]

Tests that a new upstream version action item is updated when there is newer data available for the package.

test_no_dehs_data()[source]

Tests that when there is no DEHS data at all, no action items are created.

test_watch_failure_item_created()[source]

Tests that a watch-failure action item is created when the package contains a watch failure as indicated by DEHS data returned by UDD.

test_watch_failure_item_removed()[source]

Tests that a watch-failure item is removed when a package no longer has the issue.

test_watch_failure_item_updated()[source]

Tests that a watch-failure action item is updated when there is newer data available for the package.

class distro_tracker.vendor.debian.tests.DebtagsLinkTest(methodName='runTest')[source]

Bases: distro_tracker.test.TestCase

Tests that the debtags link is added to source package pages.

get_package_page_response(package_name)[source]
test_pseudo_package()[source]
test_source_package()[source]
class distro_tracker.vendor.debian.tests.DispatchDebianSpecificTest(methodName='runTest')[source]

Bases: distro_tracker.test.TestCase, distro_tracker.mail.tests.tests_dispatch.DispatchTestHelperMixin

Tests Debian-specific keyword classification.

GIT_HEADERS = ('X-Git-Repo', 'X-GitLab-Project')
define_bts_mail(package, message='report 12345', source=None)[source]
define_dak_mail(package='foo', subject=None, dak_cmd='dak process-upload')[source]
define_dak_rm_mail(**kwargs)[source]
run_classify(package=None, keyword=None)[source]
setUp()[source]
test_classify_binary_upload_mails()[source]
test_classify_bts_control_traffic_with_correct_keyword()[source]
test_classify_bts_mail_does_not_override_suggestion()[source]

This case ensures that we can send a X-Debbugs-Cc copy of a bug report to another maintainer via pkg-foo@packages.debian.org and still get the bug forwarded to the pkg-foo subscribers under the contact keyword.

test_classify_bts_mail_on_multiple_packages_with_suggestion()[source]

Suggested package takes precedence when the mail header mentions multiple packages.

test_classify_bts_mail_on_multiple_packages_without_suggestion()[source]

Since we have no suggested package, we assume all packages need to be informed and we return a list

test_classify_bts_mail_traffic_of_normal_package()[source]
test_classify_bts_mail_traffic_of_pseudo_package()[source]
test_classify_bts_mail_traffic_with_correct_keyword()[source]
test_classify_buildd_mail()[source]
test_classify_converts_legacy_keyword()[source]
test_classify_creates_package_name_on_first_accepted_mail()[source]
test_classify_dak_rm_mail()[source]
test_classify_dak_rm_mail_multiple_sources()[source]
test_classify_does_not_store_dak_binary_accepted_as_news(mock_create_news)[source]
test_classify_generates_news_with_dak_rm_mail()[source]
test_classify_generates_news_with_testing_watch_mail()[source]
test_classify_git_mail()[source]
test_classify_git_mail_drops_git_suffix_from_repo_name()[source]
test_classify_git_mail_keeps_basename_only()[source]
test_classify_identifies_package_in_dak_mails()[source]
test_classify_other_archive_mails()[source]
test_classify_source_upload_mails()[source]
test_classify_stores_dak_source_accepted_as_news(mock_create_news)[source]
test_classify_testing_watch_mail()[source]
test_debian_specific_headers()[source]

Tests that debian specific headers are included in forwarded messages.

test_debian_trusts_bugzilla()[source]

Tests that messages tagged with the default keyword are forwarded when they originated from Bugzilla.

test_default_not_trusted()[source]

Tests that a non-trusted default message is dropped.

class distro_tracker.vendor.debian.tests.GetDeveloperInformationSiteUrlTest(methodName='runTest')[source]

Bases: distro_tracker.test.SimpleTestCase

test_get_developer_site_info_url()[source]

Test retrieving a URL to a developer information Web site.

class distro_tracker.vendor.debian.tests.GetPackageInformationSiteUrlTest(methodName='runTest')[source]

Bases: distro_tracker.test.SimpleTestCase

setUp()[source]
test_get_binary_package_url()[source]

Tests retrieving a URL to the package information site for a binary package.

test_get_source_package_url()[source]

Tests retrieving a URL to the package information site for a source package.

class distro_tracker.vendor.debian.tests.GetPseudoPackageListTest(methodName='runTest')[source]

Bases: distro_tracker.test.TestCase

test_debian_pseudo_packages(mock_requests)[source]

Tests that Debian-specific function for retrieving allowed pseudo packages uses the correct source and properly parses it.

class distro_tracker.vendor.debian.tests.ImportOldNewsTests(methodName='runTest')[source]

Bases: distro_tracker.test.TestCase

Tests the management command for importing old news.

create_message(subject, from_email, date, content)[source]
test_news_created()[source]
class distro_tracker.vendor.debian.tests.ImportOldSubscribersTests(methodName='runTest')[source]

Bases: distro_tracker.test.TestCase

Tests for the distro_tracker.vendor.debian.management.commands.tracker_import_old_subscriber_dump management command.

assert_subscribed_to_package(package, subscribers)[source]
get_input()[source]
run_command()[source]
setUp()[source]
set_package_subscribers(package, subscribers)[source]
test_existing_package_imported()[source]

Tests that when a package already exists, only a subscription is created, without modifying the package.

test_multiple_subscriptions_imported()[source]

Tests that multiple subscriptions for a single user are imported.

test_non_existing_package_imported()[source]

Test that when a package that is found in the dump being imported does not exist, a new “subscription-only” package is automatically created.

class distro_tracker.vendor.debian.tests.ImportTagsTests(methodName='runTest')[source]

Bases: distro_tracker.test.TestCase

Tests for the management command for importing the dump of user tags (subscription-specific keywords and user default keywords).

add_default_tags(email, tags)[source]
add_subscription_specific_tags(email, package, tags)[source]
assert_keyword_sets_equal(set1, set2)[source]
get_input()[source]
run_command()[source]
setUp()[source]
test_both_types_imported()[source]
test_default_keywords_imported()[source]
test_legacy_mapping_import()[source]
test_subscription_specific_keywords_imported()[source]
class distro_tracker.vendor.debian.tests.NewQueueVersionsPanelTests(methodName='runTest')[source]

Bases: distro_tracker.test.TestCase

Tests that the NEW queue versions are displayed in the versions panel.

add_new_queue_entry(distribution, version)[source]
get_package_page_response(package_name)[source]
setUp()[source]
test_multiple_distributions()[source]

Tests for when a package has a version in NEW for multiple distributions.

test_single_new_version()[source]

Tests for when a package has a version in NEW for only one distribution.

class distro_tracker.vendor.debian.tests.PopconLinkTest(methodName='runTest')[source]

Bases: distro_tracker.test.TestCase

Tests that the popcon link is added to source package pages.

get_package_page_response(package_name)[source]
test_pseudo_package()[source]
test_source_package()[source]
class distro_tracker.vendor.debian.tests.RetrieveDebianMaintainersTest(methodName='runTest')[source]

Bases: distro_tracker.test.TestCase

test_developer_delete_from_dm_list(mock_requests)[source]

Tests updating the DM list when one of the developers has changes in the allowed packages list.

test_developer_did_not_exist(mock_requests)[source]

Tests updating the DM list when a new developer is to be added.

test_developer_existed(mock_requests)[source]

Tests updating the DM list when the developer was previously registered in the database.

test_developer_update_dm_list(mock_requests)[source]

Tests updating the DM list when one of the developers has changes in the allowed packages list.

class distro_tracker.vendor.debian.tests.RetrieveLowThresholdNmuTest(methodName='runTest')[source]

Bases: distro_tracker.test.TestCase

test_developer_did_not_exist(mock_requests)[source]

Tests updating the list of developers that allow the low threshold NMU when the developer did not previously exist in the database.

test_developer_existed(mock_requests)[source]

Tests updating the list of developers that allow the low threshold NMU when the developer was previously registered in the database.

test_developer_remove_nmu(mock_requests)[source]

Tests updating the list of NMU developers when one of them needs to be removed from the list.

class distro_tracker.vendor.debian.tests.RetrieveSourcesInformationDebian(methodName='runTest')[source]

Bases: distro_tracker.test.TestCase

Tests the Debian-specific aspects of retrieving package information from a repository.

fixtures = ['repository-test-fixture.json']
setUp()[source]
test_extra_source_only_ignored(mock_update_repositories)[source]

Tests that the packages with the ‘Extra-Source-Only’ key are ignored.

class distro_tracker.vendor.debian.tests.ScreenshotsLinkTest(methodName='runTest')[source]

Bases: distro_tracker.test.TestCase

Tests that the screenshots link is added to source package pages.

get_package_page_response(package_name)[source]
setUp()[source]
test_pseudo_package()[source]
test_source_package_with_screenshot()[source]
test_source_package_without_screenshot()[source]
class distro_tracker.vendor.debian.tests.UbuntuPanelTests(methodName='runTest')[source]

Bases: distro_tracker.test.TestCase

Tests for the distro_tracker.vendor.debian.tracker_panels.UbuntuPanel panel.

get_package_page_response(package_name)[source]
setUp()[source]
test_bugs_displayed()[source]

Tests that the Ubuntu bug counts are displayed in the Ubuntu panel, if they exist for the package.

test_panel_displayed()[source]

Tests that the panel is displayed when the package has a known Ubuntu version.

test_panel_not_displayed()[source]

Tests tat the panel is not displayed when the package has no known Ubuntu versions.

test_patch_diff_displayed()[source]

Tests that the Ubuntu patch diff link is displayed in the Ubuntu panel, if it exists for the package.

ubuntu_panel_in_content(content)[source]
class distro_tracker.vendor.debian.tests.UpdateAutoRemovalsStatsTaskTest(methodName='runTest')[source]

Bases: distro_tracker.test.TestCase

Tests for the distro_tracker.vendor.debian.tracker_tasks .UpdateAutoRemovalsStatsTask task.

run_task()[source]

Runs the autoremovals status update task.

setUp()[source]
test_action_item_is_dropped_when_autoremovals_reports_nothing_again(mock_requests)[source]

Tests that ActionItems are dropped when a package was previousy reported but is now not reported anymore.

test_action_item_when_in_list(mock_requests)[source]

Tests that an ActionItem is created for a package reported by autoremovals.

test_no_action_item_when_not_in_list(mock_requests)[source]

Tests that no ActionItem is created for a package not reported by autoremovals.

class distro_tracker.vendor.debian.tests.UpdateBuildLogCheckStatsActionItemTests(methodName='runTest')[source]

Bases: distro_tracker.test.TestCase

Tests that distro_tracker.core.models.ActionItem instances are correctly created when running the distro_tracker.vendor.debian.tracker_tasks.UpdateBuildLogCheckStats task.

get_action_item_type()[source]
run_task()[source]
setUp()[source]
set_buildd_content(content)[source]

Sets the stub value for buildd data which the task will see once it runs.

test_action_item_created()[source]

Tests that a new action item is created when a package has errors or warnings.

test_action_item_error_high_severity()[source]

Tests that action items have high severity if the package has only errors.

test_action_item_multiple_packages()[source]

Tests that an action item is correctly created for multple packages found in the buildd response.

test_action_item_not_created()[source]

Tests that a new action item is not created when the package does not have any errors or warnings.

test_action_item_not_updated()[source]

Tests that an already existing action item is unchanged if the new data does not differ from the already stored data.

test_action_item_removed()[source]

Tests that an already existing action item is removed when the package no longer has any warnings or errors (but still has buildd stats).

test_action_item_removed_all_stats()[source]

Tests that an already existing action item is removed when the package no longer has any buildd stats.

test_action_item_updated()[source]

Tests that an already existing action item is updated when the task runs.

test_action_item_warning_low_severity()[source]

Tests that action items have low severity if the package only has warnings.

class distro_tracker.vendor.debian.tests.UpdateBuildReproducibilityTaskTest(methodName='runTest')[source]

Bases: distro_tracker.test.TestCase

Tests for the:class:distro_tracker.vendor.debian.tracker_tasks. UpdateBuildReproducibilityTask task.

run_task()[source]

Runs the build reproducibility status update task.

setUp()[source]
test_action_item_is_dropped_when_status_is_reproducible(mock_requests)[source]

Ensure the action item is dropped when status switches from unreproducible to reproducible.

test_extractedinfo_is_dropped_when_data_is_gone(mock_requests)[source]

Tests that PackageExtractedInfo is dropped if reproducibility info goes away.

test_extractedinfo_with_reproducibility(mock_requests)[source]

Tests that PackageExtractedInfo for a package with reproducibility info is correct.

test_extractedinfo_without_reproducibility(mock_requests)[source]

Tests that packages without reproducibility info don’t claim to have them.

test_no_extractedinfo_for_unknown_package(mock_requests)[source]

Tests that BuildReproducibilityTask doesn’t fail with an unknown package.

test_other_extractedinfo_keys_not_dropped(mock_requests)[source]

Ensure that other PackageExtractedInfo keys are not dropped when deleting the reproducibility key.

class distro_tracker.vendor.debian.tests.UpdateDebciStatusTaskTest(methodName='runTest')[source]

Bases: distro_tracker.test.TestCase

Tests for the distro_tracker.vendor.debian.tracker_tasks.UpdateDebciStatusTask task.

run_task()[source]

Runs the debci status update task.

setUp()[source]
test_action_item_for_failing_test(mock_requests)[source]

Tests that a proper ActionItem is created for a failing test on a known package.

test_action_item_is_dropped_when_info_vanishes(mock_requests)[source]

Tests that ActionItems are dropped when the debci report doesn’t mention the package.

test_action_item_is_dropped_when_test_passes_again(mock_requests)[source]

Tests that ActionItems are dropped when the test passes again.

Tests that links to lib packages’ log files are correct.

test_no_action_item_for_passing_test(mock_requests)[source]

Tests that an ActionItem isn’t created for a passing debci status.

test_no_action_item_for_unknown_package(mock_requests)[source]

Tests that an ActionItem isn’t created for an unknown package.

class distro_tracker.vendor.debian.tests.UpdateDebianDuckTaskTest(methodName='runTest')[source]

Bases: distro_tracker.test.TestCase

Tests for the distro_tracker.vendor.debian.tracker_tasks.UpdateDebianDuckTask task.

run_task()[source]

Runs the Duck status update task.

setUp()[source]
test_action_item_is_dropped_when_duck_reports_nothing_again(mock_requests)[source]

Tests that ActionItems are dropped when a package was previousy reported but is now not reported anymore.

test_action_item_when_in_list(mock_requests)[source]

Tests that an ActionItem is created for a package reported by duck.

test_no_action_item_when_not_in_list(mock_requests)[source]

Tests that no ActionItem is created for a package not reported by duck.

class distro_tracker.vendor.debian.tests.UpdateExcusesTaskActionItemTest(methodName='runTest')[source]

Bases: distro_tracker.test.TestCase

Tests for the creating of action items by the distro_tracker.vendor.debian.tracker_tasks.UpdateExcusesTask.

get_action_item_type()[source]
run_task()[source]
setUp()[source]
set_update_excuses_content(content)[source]

Sets the stub content of the update_excuses.html that the task will have access to.

set_update_excuses_content_from_file(file_name)[source]

Sets the stub content of the update_excuses.html that the task will have access to based on the content of the test file with the given name.

test_action_item_created()[source]

Tests that an action item is created when a package has not moved to testing after the allocated period.

test_action_item_not_created()[source]

Tests that an action item is not created when the allocated time period has not yet passed.

test_action_item_removed()[source]

Tests that an already existing action item is removed when the package is no longer problematic.

test_action_item_updated()[source]

Tests that an already existing action item’s extra data is updated.

class distro_tracker.vendor.debian.tests.UpdateLintianStatsTaskTest(methodName='runTest')[source]

Bases: distro_tracker.test.TestCase

Tests for the distro_tracker.vendor.debian.tracker_tasks.UpdateLintianStatsTask task.

assert_action_item_warnings_and_errors_count(item, errors=0, warnings=0)[source]

Helper method which checks if an instance of distro_tracker.core.ActionItem contains the given error and warning count in its extra_data.

assert_correct_category_stats(stats, expected_stats)[source]

Helper method which asserts that the given stats match the expected stats.

Parameters:
  • stats (dict) – Mapping category names to count
  • expected_stats (list) – A list of counts as given by the Web lintian resource
get_action_item_type()[source]
run_task()[source]

Runs the lintian stats update task.

setUp()[source]
test_action_item_created_errors(mock_requests)[source]

Tests that an action item is created when the package has errors.

test_action_item_created_errors_and_warnings(mock_requests)[source]

Tests that an action item is created when the package has errors and warnings.

test_action_item_created_multiple_packages(mock_requests)[source]

Tests that action items are created correctly when there are stats for multiple different packages in the response.

test_action_item_created_warnings(mock_requests)[source]

Tests that an action item is created when the package has warnings.

test_action_item_not_created(mock_requests)[source]

Tests that no action item is created when the package has no errors or warnings.

test_action_item_not_updated(mock_requests)[source]

Tests that an existing action item is left unchanged when the update shows unchanged lintian stats.

test_action_item_removed(mock_requests)[source]

Tests that a previously existing action item is removed if the updated stats no longer contain errors or warnings.

test_action_item_removed_no_data(mock_requests)[source]

Tests that a previously existing action item is removed when the updated stats no longer contain any information for the package.

test_action_item_updated(mock_requests)[source]

Tests that an existing action item is updated with new data.

test_correct_url_used(mock_requests)[source]

Tests that lintian stats are retrieved from the correct URL.

test_parse_error(mock_requests)[source]

Tests that when a parse error is encountered for a single package, it is skipped without affected the rest of the packages in the response.

test_stats_created(mock_requests)[source]

Tests that stats are created for a package that previously did not have any lintian stats.

test_stats_created_multiple_packages(mock_requests)[source]

Tests that stats are correctly creatd when there are stats for multiple packages in the response.

test_stats_updated(mock_requests)[source]

Tests that when a package already had associated linian stats, they are correctly updated after running the task.

test_unknown_package(mock_requests)[source]

Tests that when an unknown package is encountered, no stats are created.

test_update_does_not_affect_other_item_types(mock_requests)[source]

Tests that running an update of lintian stats does not cause other package categories to be removed.

class distro_tracker.vendor.debian.tests.UpdateNewQueuePackagesTests(methodName='runTest')[source]

Bases: distro_tracker.test.TestCase

Tests for the distro_tracker.vendor.debian.tracker_tasks.UpdateNewQueuePackages task.

add_package_to_new(package)[source]
get_new_info(package)[source]

Helper method which returns the package’s PackageExtractedInfo instance containing the NEW queue info, or None if there is no such instance.

run_task()[source]
setUp()[source]
test_entry_dropped()[source]

Tests that the NEW entry is correctly dropped from PackageExtractedInfo when the entry is gone.

test_entry_updated()[source]

Tests that the NEW info is updated when the entry is updated.

test_malformed_entry()[source]

Tests that nothing is created when the package’s entry is missing the Queue field.

test_multiple_distributions()[source]

Tests that the NEW queue information is correctly extracted when the package has multiple distributions in the NEW queue.

test_multiple_entries_single_distribution()[source]

Tests that the latest version is always used for a distribution no matter if it is found in a separate entry instead of being in the same Version field.

test_single_distribution()[source]

Tests that the NEW queue information is correctly extracted when the package is found in only one distribution in the NEW queue.

test_single_distribution_multiple_versions()[source]

Tests that the NEW queue information is correctly extracted when the package has multiple versions for a distribution.

class distro_tracker.vendor.debian.tests.UpdatePackageScreenshotsTaskTest(methodName='runTest')[source]

Bases: distro_tracker.test.TestCase

Tests for the:class:distro_tracker.vendor.debian.tracker_tasks. UpdatePackageScreenshotsTask task.

run_task()[source]

Runs the screenshots status update task.

setUp()[source]
test_extractedinfo_for_package_with_screenshots(mock_requests)[source]

Tests that PackageExtractedInfo for a package with a screenshot is correct.

test_extractedinfo_is_dropped_when_no_more_screenshot(mock_requests)[source]

Tests that PackageExtractedInfo is dropped if screenshot goes away.

test_extractedinfo_item_for_without_screenshot(mock_requests)[source]

Tests that packages without screenshots don’t claim to have them.

test_no_extractedinfo_for_unknown_package(mock_requests)[source]

Tests that UpdatePackageScreenshotsTask doesn’t fail with an unknown package.

test_other_extractedinfo_keys_not_dropped(mock_requests)[source]

Ensure that other PackageExtractedInfo keys are not dropped when deleting the screenshot key.

class distro_tracker.vendor.debian.tests.UpdatePiupartsTaskTests(methodName='runTest')[source]

Bases: distro_tracker.test.TestCase

assert_get_piuparts_called_with(suites)[source]

Asserts that the _get_piuparts_content method was called only with the given suites.

get_action_item_type()[source]
run_task()[source]
setUp()[source]
set_piuparts_content(suite, fail_packages, pass_packages=())[source]

Sets the given list of packages as a stub value which is returned to the task for the given suite.

set_suites(suites)[source]

Sets the list of suites which the task should use.

static stub_get_piuparts_content(suite, stub_data)[source]
suites = []
test_action_item_created()[source]

Tests that an action item is created when a source package is found to be failing the piuparts test in a single suite.

test_action_item_multiple_suites()[source]

Tests that an action item contains all suites in which a failure was detected.

test_action_item_not_created()[source]

Tests that an action item is not created when a source package is found to be passing the piuparts test.

test_action_item_not_updated_when_unchanged()[source]

Tests that an existing action item is not updated when the update detects that the stats have not changed.

test_action_item_removed()[source]

Tests that an existing action item is removed if the update indicates the package is passing piuparts tests in all suites.

test_action_item_removed_no_stats()[source]

Tests that an existing action item is removed if the update indicates the package no longer has any piuparts stats.

test_action_item_updated()[source]

Tests that an existing action item is updated when there are updated piuparts stats for the package.

test_retrieves_all_suites()[source]

Tests that the task tries to retrieve the data for each of the suites given in the distro_tracker.project.local_settings.DISTRO_TRACKER_DEBIAN_PIUPARTS_SUITES setting.

class distro_tracker.vendor.debian.tests.UpdateSecurityIssuesTaskTests(methodName='runTest')[source]

Bases: distro_tracker.test.TestCase

get_item_type()[source]
load_test_json(key)[source]
mock_json_data(key=None, content={})[source]
run_task()[source]
setUp()[source]
test_action_item_created()[source]

Tests that an action item is created when a package has security issues.

test_action_item_removed()[source]

Tests that an action item is removed when a package no longer has security issues.

test_action_item_updated()[source]

Tests that an action item is updated when there are no package security issue stats.

test_execute_create_data()[source]
test_execute_drop_data()[source]
test_execute_update_data()[source]
test_execute_update_data_skipped()[source]
test_get_issues_stats()[source]
test_get_issues_summary_has_details()[source]
test_get_issues_summary_with_eol()[source]
test_get_issues_summary_with_nodsa()[source]
test_get_issues_summary_with_open()[source]
test_get_issues_summary_with_unimportant()[source]
test_get_template_action_item()[source]
test_update_action_item()[source]
class distro_tracker.vendor.debian.tests.UpdateUbuntuStatsTaskTests(methodName='runTest')[source]

Bases: distro_tracker.test.TestCase

Tests for the distro_tracker.vendor.debian.tracker_taks.UpdateUbuntuStatsTask task.

run_task()[source]
setUp()[source]
set_bugs_content(bugs)[source]

Sets the stub content for the list of Ubuntu package bugs.

Parameters:bugs – A list of (package_name, bug_count, patch_count) tuples which should be found in the response.
set_diff_content(diffs)[source]

Sets the stub content for the list of diff URLs.

Parameters:diffs – A list of (package_name, diff_url) pairs which should be found in the response.
set_versions_content(versions)[source]

Sets the stub content for the list of Ubuntu package versions.

Parameters:versions – A list of (package_name, version) pairs which should be found in the response.
test_ubuntu_package_bug_stats_removed()[source]

Tests that an existing distro_tracker.vendor.debian.models.UbuntuPackage instance is correctly updated to contain no bug stats when there are no bug stats found for the package by the update.

test_ubuntu_package_bugs_created()[source]

Tests that a distro_tracker.vendor.debian.models.UbuntuPackage instance which is created for a new Ubuntu package contains the bugs count.

test_ubuntu_package_bugs_updated()[source]

Tests that an existing distro_tracker.vendor.debian.models.UbuntuPackage instance is correctly updated to contain the new Ubuntu package bugs when it previously contained no bug information.

test_ubuntu_package_bugs_updated_existing()[source]

Tests that an existing distro_tracker.vendor.debian.models.UbuntuPackage instance is correctly updated to contain the new Ubuntu package bugs when it previously contained older bug information.

test_ubuntu_package_created()[source]

Tests that a new distro_tracker.vendor.debian.models.UbuntuPackage model instance is created if an Ubuntu version of the package is found.

test_ubuntu_package_diff_created()[source]

Tests that a distro_tracker.vendor.debian.models.UbuntuPackage instance which is created for a new Ubuntu package contains the diff info.

test_ubuntu_package_diff_removed()[source]

Tests that an existing distro_tracker.vendor.debian.models.UbuntuPackage instance is correctly updated to contain no diff info when there is no diff info found for the package by the update.

test_ubuntu_package_diff_updated()[source]

Tests that an existing distro_tracker.vendor.debian.models.UbuntuPackage instance is correctly updated to contain the new Ubuntu patch diffs when it previously contained no diff info.

test_ubuntu_package_diff_updated_existing()[source]

Tests that an existing distro_tracker.vendor.debian.models.UbuntuPackage instance is correctly updated to contain the new Ubuntu patch diff info when it previously contained older patch diff info.

test_ubuntu_package_removed()[source]

Tests that an existing distro_tracker.vendor.debian.models.UbuntuPackage instance is removed if an Ubuntu version of the package is no longer found.

class distro_tracker.vendor.debian.tests.UpdateVcsWatchTaskTest(methodName='runTest')[source]

Bases: distro_tracker.test.TestCase

Tests for the:class:distro_tracker.vendor.debian.tracker_tasks. UpdateVcsWatchTask task.

run_task()[source]
setUp()[source]
test_action_item_is_dropped_when_status_is_ok()[source]

Ensure the action item is dropped when status switches from not “OK” to “OK”.

test_action_item_is_updated_when_extra_data_changes()[source]

Ensures that the action item is updated when extra_data changes.

test_extractedinfo_is_dropped_when_data_is_gone()[source]

Tests that PackageExtractedInfo is dropped if vcswatch info goes away.

test_extractedinfo_is_updated_if_needed()[source]

Tests that PackageExtractedInfo is updated if vcswatch_url changes.

test_extractedinfo_with_vcswatch()[source]

Tests that PackageExtractedInfo for a package with vcswatch info is correct.

test_extractedinfo_without_vcswatch()[source]

Tests that packages without vcswatch info don’t claim to have them.

test_no_extractedinfo_for_unknown_package()[source]

Tests that the task doesn’t fail with an unknown package.

test_other_extractedinfo_keys_not_dropped()[source]

Ensure that other PackageExtractedInfo keys are not dropped when deleting the vcs key.

class distro_tracker.vendor.debian.tests.UpdateWnppStatsTaskTests(methodName='runTest')[source]

Bases: distro_tracker.test.TestCase

Tests for the distro_tracker.vendor.debian.tracker_tasks.UpdateWnppStatsTask task.

get_action_item_type()[source]
run_task()[source]
setUp()[source]
set_wnpp_content(content)[source]

Sets the stub wnpp content which the task will retrieve once it runs. :param content: A list of (package_name, issues) pairs. issues is

a list of dicts describing the WNPP bugs the package has.
test_action_item_created(mock_requests)[source]

Tests that an ActionItem instance is created when the package has a WNPP bug.

test_action_item_created_unknown_type(mock_requests)[source]

Tests that an ActionItem instance is created when the package has a WNPP bug of an unknown type.

test_action_item_multiple_packages(mock_requests)[source]

Tests that an ActionItem instance is created for multiple packages.

test_action_item_not_created(mock_requests)[source]

Tests that an ActionItem instance is not created for non existing packages.

test_action_item_not_updated(mock_requests)[source]

Tests that an existing ActionItem instance is not updated when there are no changes to the WNPP bug info.

test_action_item_removed(mock_requests)[source]

Tests that an existing ActionItem instance is removed when there is no more WNPP bug info.

test_action_item_updated(mock_requests)[source]

Tests that an existing ActionItem instance is updated when there are changes to the WNPP bug info.