From Fedora Project Wiki
mNo edit summary
mNo edit summary
(17 intermediate revisions by the same user not shown)
Line 1: Line 1:
<!-- Self Contained or System Wide Change Proposal?
Use this guide to determine to which category your proposed change belongs to.
Self Contained Changes are:
* changes to isolated/leaf package without the impact on other packages/rest of the distribution
* limited scope changes without the impact on other packages/rest of the distribution
* coordinated effort within SIG with limited impact outside SIG functional area, accepted by the SIG
System Wide Changes are:
* changes that does not fit Self Contained Changes category touching
* changes that require coordination within the distribution (for example mass rebuilds, release engineering or other teams effort etc.)
* changing system defaults
For Self Contained Changes, sections marked as "REQUIRED FOR SYSTEM WIDE CHANGES" are OPTIONAL but FESCo/Wrangler can request more details (especially in case the change proposal category is
improper or updated to System Wide category). For System Wide Changes all fields on this form are required for FESCo acceptance (when applies). 
We request that you maintain the same order of sections so that all of the change proposal pages are uniform.
-->
<!-- The actual name of your proposed change page should look something like: Changes/Your_Change_Proposal_Name.  This keeps all change proposals in the same namespace -->
<!-- The actual name of your proposed change page should look something like: Changes/Your_Change_Proposal_Name.  This keeps all change proposals in the same namespace -->
 
= DNF Make Best Mode the Default <!-- The name of your change proposal --> =
<!-- The actual name of your proposed change page should look something like: Changes/Your_Change_Proposal_Name.  This keeps all change proposals in the same namespace -->
= DNF Best Mode By Default <!-- The name of your change proposal --> =


== Summary ==
== Summary ==
Line 59: Line 38:


== Detailed Description ==
== Detailed Description ==
Change the built-in default value of the ''best'' configuration option from ''0'' (''false'') to ''1'' (''true'').
Change the built-in default value of the `best` configuration option from `0` (false) to `1` (true).


As a result, unless ''best'' is overridden in the ''/etc/dnf/dnf.conf'' file, it will default to ''1''. In addition to that, we will also put the explicit ''best=1'' assignment in the shipped ''/etc/dnf/dnf.conf'' file for better transparency, and introduce the new ''--nobest'' command-line switch.
As a result, unless `best` is overridden in the `/etc/dnf/dnf.conf` file or using `--setopt`, it will default to `1`. As a convenience, we will also put the explicit `best=1` assignment in the shipped `/etc/dnf/dnf.conf` file for better transparency, and introduce the new `--nobest` command-line switch.


The purpose of the ''--nobest'' switch (as a shorthand for ''--setopt=best=0'') is to make it easy for the user to override the default setting when needed, and it will also be [https://github.com/rpm-software-management/dnf/pull/1311/commits/9a3e8fd0da49291d30fd1fef527cffb0bf3f047d#diff-6c823931c6d150295e5011fac6529ab9R144 suggested] in the DNF output when a dependency error occurs.
The purpose of the `--nobest` switch (as a shorthand for `--setopt=best=0`) is to make it easy for the user to override the default setting when needed, and it will also be [https://github.com/rpm-software-management/dnf/pull/1311/commits/9a3e8fd0da49291d30fd1fef527cffb0bf3f047d#diff-6c823931c6d150295e5011fac6529ab9R144 suggested] in the DNF output when a dependency error occurs.


Relevant excerpt from ''dnf.conf(5)'':
Relevant excerpt from the updated `dnf.conf(5)`:
<pre>
<pre>
best  boolean
best  boolean
When upgrading a package, always try to install its highest version available, even only to find out some of its deps are not satisfiable. Enable this if you want to experience broken dependencies in the repositories firsthand. The default is False.
When upgrading a package, always try to install its highest version available, even only to find out some of its deps are not satisfiable. Enable this if you want to experience broken dependencies in the repositories firsthand. The default is True.
</pre>
</pre>


Relevant excerpt from ''dnf(8)'':
Relevant excerpt from the updated `dnf(8)`:
<pre>
<pre>
--nobest
--nobest
Line 79: Line 58:
== Benefit to Fedora ==
== Benefit to Fedora ==


This change allows the user to be notified when a package cannot be upgraded to the latest version, instead of silently ignoring it as an upgrade candidate.
This change allows the users to be properly notified when a package cannot be upgraded to the latest version, instead of silently ignoring it as an upgrade candidate.


This is especially important for security fixes that could otherwise be overseen by the user in case there is misconfiguration or inconsistency in the repository.
Right now, when DNF runs in `best=0` mode, if a package cannot be upgraded due to dependency problems, it is skipped and a warning is printed in the transaction summary table. However, this poses a risk of important security fixes being overlooked by the user in case they are broken for some reason, such as due to a repository misconfiguration or inconsistency within the metadata itself.
 
Moreover, since DNF always exits with the return code `0` (success) when in `best=0` mode, this mode is especially risky in automated scripts invoking DNF in `assumeyes` mode in which case such unsuccessful package upgrades could easily go unnoticed unless the logs are manually examined after the fact.


The new behavior is also more in line with the generally accepted software development practice of failing early and failing fast.
The new behavior is also more in line with the generally accepted software development practice of failing early and failing fast.
As a secondary benefit, broken upgrade paths in the Fedora repositories will hopefully be noticed, reported and therefore fixed sooner.


== Scope ==
== Scope ==
Line 134: Line 117:


== User Experience ==
== User Experience ==
Broken upgrades are recognized early, enabling the user to act upon them by double-checking their repository configuration or filing bugs, instead of assuming no upgrades are available.
Broken upgrades are recognized early, enabling the users to act upon them by double-checking their repository configuration or filing bugs, instead of assuming no upgrades are available.


== Dependencies ==
== Dependencies ==

Revision as of 15:17, 11 February 2019

DNF Make Best Mode the Default

Summary

Make DNF always try to upgrade to the highest available version of a package, even only to fail due to dependency problems.

Owner

Current status

  • Targeted release: Fedora 30
  • Last updated: 2019-02-11
  • Tracker bug: <will be assigned by the Wrangler>

Detailed Description

Change the built-in default value of the best configuration option from 0 (false) to 1 (true).

As a result, unless best is overridden in the /etc/dnf/dnf.conf file or using --setopt, it will default to 1. As a convenience, we will also put the explicit best=1 assignment in the shipped /etc/dnf/dnf.conf file for better transparency, and introduce the new --nobest command-line switch.

The purpose of the --nobest switch (as a shorthand for --setopt=best=0) is to make it easy for the user to override the default setting when needed, and it will also be suggested in the DNF output when a dependency error occurs.

Relevant excerpt from the updated dnf.conf(5):

best  boolean
When upgrading a package, always try to install its highest version available, even only to find out some of its deps are not satisfiable. Enable this if you want to experience broken dependencies in the repositories firsthand. The default is True.

Relevant excerpt from the updated dnf(8):

--nobest
Set best option as false, therefore transactions are not limited to only best candidates.

Benefit to Fedora

This change allows the users to be properly notified when a package cannot be upgraded to the latest version, instead of silently ignoring it as an upgrade candidate.

Right now, when DNF runs in best=0 mode, if a package cannot be upgraded due to dependency problems, it is skipped and a warning is printed in the transaction summary table. However, this poses a risk of important security fixes being overlooked by the user in case they are broken for some reason, such as due to a repository misconfiguration or inconsistency within the metadata itself.

Moreover, since DNF always exits with the return code 0 (success) when in best=0 mode, this mode is especially risky in automated scripts invoking DNF in assumeyes mode in which case such unsuccessful package upgrades could easily go unnoticed unless the logs are manually examined after the fact.

The new behavior is also more in line with the generally accepted software development practice of failing early and failing fast.

As a secondary benefit, broken upgrade paths in the Fedora repositories will hopefully be noticed, reported and therefore fixed sooner.

Scope

  • Proposal owners:

Backport the following upstream pull requests into the DNF stack on Fedora:

https://github.com/rpm-software-management/libdnf/pull/678
https://github.com/rpm-software-management/dnf/pull/1311
https://github.com/rpm-software-management/dnf/pull/1316
https://github.com/rpm-software-management/dnf/pull/1319

  • Other developers: N/A (not a System Wide Change)
  • Policies and guidelines: N/A (not a System Wide Change)
  • Trademark approval: N/A (not needed for this Change)

Upgrade/compatibility impact

N/A (not a System Wide Change)

How To Test

N/A (not a System Wide Change)

User Experience

Broken upgrades are recognized early, enabling the users to act upon them by double-checking their repository configuration or filing bugs, instead of assuming no upgrades are available.

Dependencies

N/A (not a System Wide Change)

Contingency Plan

  • Contingency mechanism: (What to do? Who will do it?) N/A (not a System Wide Change)
  • Contingency deadline: N/A (not a System Wide Change)
  • Blocks release? N/A (not a System Wide Change), Yes/No
  • Blocks product? product

Documentation

N/A (not a System Wide Change)

Release Notes