Skip to content

Instantly share code, notes, and snippets.

@lslezak
Last active April 24, 2020 08:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lslezak/ed9d54b91dc3cdec865ce289d01ac0c2 to your computer and use it in GitHub Desktop.
Save lslezak/ed9d54b91dc3cdec865ce289d01ac0c2 to your computer and use it in GitHub Desktop.
(Un)used YaST Modules

(Un)used YaST Modules

The Problem

We maintain many YaST modules and it's quite difficult to keep all of them in good shape.

So we eeed to know which modules are used and are important for the users so we could spend more time with them. On the other hand, the modules which are used rarely can live with less intensive maintenance.

How to Find out

The obvious problem is how to get this usage statistics. YaST does not contain any usage tracking system (that's actually good!), the only feedback we receive is via bugzilla. Naturally, bugzilla provides only negative feedback (what does not work), we miss some positive feedback and we miss usage data.

Changes

There is one simple but probably still good enough metrics: check the changelog and find how many bugs or features we have implemented in each YaST package.

The Results

  • bugs-2015-01-01.txt
    • Contains the number of fixed bugs in each YaST package since Jan 1 2015 (roughly for the last ~5 years)
  • bugs-2019-01-01.txt
    • Contains the number of fixed bugs in each YaST package since Jan 1 2019 (roughly for the last year)
  • features-2015-01-01.txt
    • Contains the number of implemented features in each YaST package since Jan 1 2015 (roughly for the last ~5 years)
  • features-2019-01-01.txt
    • Contains the number of implemented features in each YaST package since Jan 1 2019 (roughly for the last year)

The bugs are identified by a bsc#, bnc# or boo# mark. Features are identified by the fate# or jsc# mark. The duplicates were not removed.

Here is the script I wrote for extracting the data, you can adapt it and get different statistics from the changes. You need a complete YaST Git checkout locally.

Dead Code

Because the YaST code is very old (some parts more than 20 years!) it's very likely that there some dead unused code.

The problem is how to find it. We could enable the code coverage also during installation and in running system. But that would only cover the executed code, you would need to enter every possible dialog and use all features.

But there is still some code which is hardware or architecture dependant. More over most of the error handling code would be still not covered, there would be lots of false positives which would need manual verification...

# fixed bugs since 2015-01-01 (bsc#, bnc#, boo#)
yast2-journalctl 0
skelcd-control-openSUSE-livecd-xfce 0
yast2-dns-manager 0
yast2-iplb 2
yast2-pos-installation 2
system-role-minimal-desktop 2
yast2-boot-server 3
yast2-perl-bindings 3
yast2-ldap 3
system-role-ha 3
system-role-sles4sap 3
yast2-transfer 3
yast2-metapackage-handler 3
skelcd-control-suse-manager-proxy 3
system-role-basic-desktop 3
system-role-real-time-text-mode 3
system-role-gnome 3
system-role-gnome-x11 3
yast2-samba-provision 3
yast2-isns 4
yast2-testsuite 4
yast2-online-update-configuration 4
yast2-multipath 4
yast2-xml 4
yast2-x11 4
skelcd-control-suse-manager-server 4
system-role-transactional-server 4
yast2-slp 5
yast2-nis-server 5
yast2-rear 5
yast2-sysconfig 5
yast2-audit-laf 5
yast2-hana-update 5
yast2-alternatives 6
yast2-cio 6
yast2-hardware-detection 6
yast2-slp-server 6
yast2-scanner 6
system-role-kvm 6
yast2-tftp-server 6
yast2-crowbar 6
yast2-online-update 6
system-role-xen 6
skelcd-control-SLE_RT 6
yast2-geo-cluster 7
yast2-rdp 7
yast2-adsi 7
yast2-gpmc 7
yast2-nfs-server 8
skelcd-control-SLES4SAP 8
yast2-pam 8
yast2-squid 8
yast2-vpn 9
yast2-tune 9
yast2-fcoe-client 9
yast2-instserver 10
yast2-sound 10
yast2-proxy 10
yast2-rmt 10
skelcd-control-SLE_HPC 10
skelcd-control-MicroOS 10
yast2-adcommon-python 10
yast2-hana-firewall 10
yast2-configuration-management 11
system-role-server-default 11
yast2-caasp 11
system-role-text-mode 11
yast2-journal 12
yast2-samba-client 12
yast2-mail 12
yast2-snapper 12
yast2-docker 12
yast2-auth-server 12
system-role-hpc-compute 12
yast2-nis-client 13
yast2-reipl 13
yast2-aduc 13
yast2-ycp-ui-bindings 14
yast2-python-bindings 14
yast2-installation-control 15
yast2-dhcp-server 15
yast2-ftp-server 16
system-role-hpc-server 16
yast2-control-center 17
yast2-core 18
yast2-samba-server 18
yast2-sap-ha 18
yast2-http-server 19
yast2-dns-server 19
yast2-printer 19
yast2-migration 21
yast2-apparmor 21
patterns-yast 21
yast2-security 21
yast2-iscsi-lio-server 21
yast2-drbd 22
yast2-devtools 22
yast2-schema 23
yast2-cluster 24
skelcd-control-leanos 24
yast2-vm 25
yast2-s390 25
yast2-services-manager 26
skelcd-control-SLED 27
yast2-iscsi-client 27
yast2-nfs-client 27
skelcd-control-SLES 29
yast2-firewall 31
yast2-auth-client 35
yast2-pkg-bindings 36
yast2-firstboot 39
yast2-add-on 39
yast2-theme 41
skelcd-control-CAASP 42
yast2-kdump 44
skelcd-control-Kubic 47
yast2-update 51
yast2-ruby-bindings 55
yast2-users 59
skelcd-control-openSUSE 66
yast2-ntp-client 72
yast2-country 73
yast2-registration 158
yast2-bootloader 202
autoyast2 207
yast2-packager 233
yast2-installation 253
yast2-network 262
yast2 304
yast2-storage-ng 400
# fixed bugs since 2019-01-01 (bsc#, bnc#, boo#)
yast2-journalctl 0
yast2-isns 0
yast2-core 0
skelcd-control-SLES 0
yast2-iplb 0
yast2-boot-server 0
skelcd-control-SLES4SAP 0
system-role-ha 0
system-role-sles4sap 0
yast2-audit-laf 0
yast2-multipath 0
yast2-x11 0
skelcd-control-SLE_HPC 0
system-role-hpc-compute 0
system-role-minimal-desktop 0
system-role-basic-desktop 0
system-role-gnome 0
system-role-gnome-x11 0
skelcd-control-openSUSE-livecd-xfce 0
yast2-dns-manager 0
system-role-server-default 1
yast2-testsuite 1
yast2-sound 1
yast2-online-update-configuration 1
skelcd-control-SLED 1
yast2-geo-cluster 1
yast2-drbd 1
yast2-slp-server 1
yast2-scanner 1
yast2-perl-bindings 1
yast2-snapper 1
yast2-docker 1
yast2-ldap 1
yast2-pos-installation 1
system-role-kvm 1
yast2-tftp-server 1
yast2-crowbar 1
yast2-auth-server 1
system-role-xen 1
yast2-rear 1
yast2-squid 1
yast2-sysconfig 1
yast2-transfer 1
system-role-transactional-server 1
yast2-hana-update 1
yast2-alternatives 2
yast2-slp 2
yast2-instserver 2
yast2-cio 2
yast2-vm 2
yast2-hardware-detection 2
yast2-journal 2
skelcd-control-CAASP 2
yast2-mail 2
yast2-proxy 2
yast2-nis-server 2
yast2-rdp 2
yast2-online-update 2
yast2-fcoe-client 2
yast2-xml 2
yast2-metapackage-handler 2
yast2-printer 2
yast2-vpn 3
yast2-tune 3
yast2-caasp 3
yast2-reipl 3
yast2-dhcp-server 3
skelcd-control-suse-manager-proxy 3
system-role-hpc-server 3
system-role-real-time-text-mode 3
system-role-text-mode 3
yast2-samba-provision 3
yast2-hana-firewall 3
yast2-sap-ha 3
yast2-configuration-management 4
yast2-nis-client 4
yast2-ftp-server 4
yast2-samba-client 4
yast2-samba-server 4
skelcd-control-leanos 4
yast2-migration 4
yast2-devtools 4
yast2-dns-server 4
yast2-rmt 4
skelcd-control-suse-manager-server 4
patterns-yast 5
skelcd-control-SLE_RT 5
yast2-nfs-server 6
yast2-control-center 6
yast2-installation-control 6
yast2-apparmor 6
yast2-pam 6
yast2-python-bindings 7
yast2-auth-client 7
yast2-services-manager 7
yast2-adsi 7
yast2-gpmc 7
yast2-s390 8
yast2-iscsi-client 8
yast2-iscsi-lio-server 8
yast2-ycp-ui-bindings 9
yast2-http-server 9
yast2-kdump 9
yast2-theme 10
yast2-cluster 10
yast2-pkg-bindings 10
yast2-firewall 10
skelcd-control-MicroOS 10
yast2-adcommon-python 10
yast2-ruby-bindings 11
yast2-nfs-client 11
yast2-security 11
yast2-ntp-client 12
yast2-schema 12
yast2-aduc 13
yast2-firstboot 16
yast2-add-on 16
yast2-update 16
skelcd-control-openSUSE 16
yast2-users 18
skelcd-control-Kubic 19
yast2-country 24
yast2-bootloader 36
autoyast2 40
yast2-registration 41
yast2-installation 49
yast2-packager 65
yast2-network 88
yast2 103
yast2-storage-ng 122
#! /usr/bin/env ruby
# This simple script parses the *.changes files and collects
# the references to bugs and features.
require "date"
require "yaml"
dir = ARGV[0] || "."
class Entry
attr_reader :date, :author, :changes
def initialize(date, author, changes)
@date = Date.parse(date)
@author = author
@changes = changes
end
end
class ChangesFile
def self.entries(file)
arr = []
date = nil
author = nil
changes = ""
date_line = false
File.open(file).each_line do |line|
if date_line
if m = line.match(/(.*) - (.*)/)
date = m[1]
author = m[2]
end
date_line = false
elsif line =~ /^-{20}/
if date
arr << Entry.new(date, author, changes)
date = nil
author = nil
changes = ""
end
date_line = true
else
changes << line
end
end
arr
end
end
class BugCounter
attr_reader :bsc, :boo, :bnc, :fate, :jsc, :cve
def initialize(bsc: 0, boo: 0, bnc: 0, fate: 0, jsc: 0, cve: 0)
@bsc = bsc
@boo = boo
@bnc = bnc
@fate = fate
@jsc = jsc
@cve = cve
end
def bugs
# CVE items usually have a respective bnc/bsc so do not add them
bsc + boo + bnc
end
def features
fate + jsc
end
def self.from_changes(changes)
bsc = changes.scan(/bsc#\d+/i).size
boo = changes.scan(/boo#\d+/i).size
bnc = changes.scan(/bnc#\d+/i).size
fate = changes.scan(/fate#\d+/i).size
jsc = changes.scan(/jsc#/i).size
cve = changes.scan(/CVE-/i).size
new(bsc: bsc, boo: boo, bnc: bnc, fate: fate, jsc: jsc, cve: cve)
end
end
# check only the entries since Jan 1st 2015
since = Date.new(2015,1,1)
data = {}
changes = Dir[File.join(dir, "**/*.changes")].reject{|n| n.include?("-devel")}
changes.each do |c|
rpmfile = File.join(File.dirname(c), "../RPMNAME")
next unless File.exist?(rpmfile)
# some files contain a double newline, ugh?
rpmname = File.read(rpmfile).chomp.chomp
items = ChangesFile.entries(c).select {|i| i.date >= since}
# merge all changes
changelog = items.reduce(""){|str, i| str << i.changes}
raise "Already found package: changes: #{c}, rpm-name: #{rpmname}" if data[rpmname]
data[rpmname] = BugCounter.from_changes(changelog)
end
# collect the bugs, sort the packages in ascending order
bugs = data.map{|k,v| [k, v.bugs]}.sort_by{|pair| pair[1]}
# collect the features, sort the packages in ascending order
features = data.map{|k,v| [k, v.features]}.sort_by{|pair| pair[1]}
# longest package name (for better output formatting)
len = bugs.map{|p| p[0].size}.max
File.open("bugs-#{since}.txt", "w") do |f|
f.puts("# fixed bugs since #{since} (bsc#, bnc#, boo#)")
bugs.each do |b|
f.puts("#{b[0].ljust(len)} #{b[1]}")
end
end
File.open("features-#{since}.txt", "w") do |f|
f.puts("# implemented features since #{since} (fate#, jsc#)")
features.each do |b|
f.puts("#{b[0].ljust(len)} #{b[1]}")
end
end
# implemented features since 2015-01-01 (fate#, jsc#)
yast2-journalctl 0
yast2-hardware-detection 0
yast2-pos-installation 0
yast2-pam 0
yast2-xml 0
yast2-metapackage-handler 0
skelcd-control-MicroOS 0
system-role-real-time-text-mode 0
system-role-gnome-x11 0
skelcd-control-openSUSE-livecd-xfce 0
yast2-adsi 0
yast2-gpmc 0
yast2-dns-manager 0
yast2-hana-firewall 0
yast2-hana-update 0
yast2-testsuite 1
yast2-core 1
yast2-python-bindings 1
yast2-perl-bindings 1
yast2-ldap 1
system-role-ha 1
system-role-sles4sap 1
yast2-transfer 1
yast2-adcommon-python 1
yast2-aduc 1
yast2-samba-provision 1
yast2-alternatives 2
yast2-slp 2
yast2-ycp-ui-bindings 2
system-role-server-default 2
yast2-cio 2
yast2-online-update-configuration 2
yast2-proxy 2
yast2-docker 2
patterns-yast 2
yast2-audit-laf 2
yast2-x11 2
skelcd-control-suse-manager-proxy 2
system-role-hpc-compute 2
system-role-hpc-server 2
system-role-gnome 2
system-role-text-mode 2
system-role-transactional-server 2
yast2-s390 3
yast2-control-center 3
yast2-iplb 3
yast2-boot-server 3
yast2-scanner 3
system-role-kvm 3
yast2-crowbar 3
yast2-online-update 3
yast2-reipl 3
yast2-rear 3
yast2-rmt 3
skelcd-control-Kubic 3
skelcd-control-suse-manager-server 3
system-role-minimal-desktop 3
system-role-basic-desktop 3
yast2-nfs-server 4
yast2-theme 4
yast2-sound 4
yast2-vpn 4
yast2-nis-client 4
yast2-slp-server 4
yast2-snapper 4
yast2-nis-server 4
yast2-fcoe-client 4
yast2-auth-server 4
system-role-xen 4
yast2-sysconfig 4
skelcd-control-SLE_RT 4
yast2-journal 5
yast2-mail 5
yast2-tune 5
yast2-devtools 5
yast2-rdp 5
yast2-apparmor 5
yast2-squid 5
skelcd-control-SLE_HPC 5
yast2-iscsi-client 6
yast2-samba-client 6
yast2-samba-server 6
yast2-http-server 6
yast2-nfs-client 6
yast2-multipath 6
yast2-isns 7
yast2-vm 7
yast2-ruby-bindings 7
yast2-migration 7
yast2-kdump 7
yast2-auth-client 7
yast2-printer 7
yast2-sap-ha 7
yast2-instserver 8
yast2-ftp-server 8
yast2-geo-cluster 8
skelcd-control-SLES4SAP 8
yast2-firstboot 8
yast2-tftp-server 8
yast2-dhcp-server 8
yast2-security 8
yast2-configuration-management 9
yast2-cluster 9
yast2-pkg-bindings 9
yast2-caasp 10
yast2-ntp-client 10
yast2-dns-server 10
yast2-add-on 11
yast2-schema 11
yast2-drbd 12
skelcd-control-openSUSE 12
yast2-iscsi-lio-server 12
yast2-services-manager 16
skelcd-control-SLED 17
yast2-users 17
skelcd-control-SLES 19
yast2-update 21
yast2-bootloader 23
skelcd-control-CAASP 23
yast2-country 26
yast2-firewall 26
skelcd-control-leanos 27
yast2-installation-control 31
yast2-network 31
autoyast2 45
yast2-registration 51
yast2-packager 53
yast2-installation 100
yast2 110
yast2-storage-ng 134
# implemented features since 2019-01-01 (fate#, jsc#)
yast2-slp 0
system-role-server-default 0
yast2-journalctl 0
yast2-testsuite 0
yast2-hardware-detection 0
yast2-core 0
skelcd-control-CAASP 0
yast2-python-bindings 0
yast2-perl-bindings 0
yast2-ldap 0
yast2-pos-installation 0
system-role-kvm 0
system-role-ha 0
system-role-xen 0
patterns-yast 0
system-role-sles4sap 0
yast2-pam 0
yast2-rmt 0
yast2-pkg-bindings 0
yast2-xml 0
yast2-transfer 0
yast2-metapackage-handler 0
yast2-x11 0
skelcd-control-MicroOS 0
system-role-hpc-server 0
system-role-minimal-desktop 0
system-role-basic-desktop 0
system-role-real-time-text-mode 0
system-role-gnome 0
system-role-text-mode 0
system-role-gnome-x11 0
system-role-transactional-server 0
skelcd-control-openSUSE-livecd-xfce 0
yast2-adsi 0
yast2-gpmc 0
yast2-dns-manager 0
yast2-hana-firewall 0
yast2-hana-update 0
yast2-sap-ha 0
yast2-instserver 1
yast2-nfs-server 1
yast2-ycp-ui-bindings 1
yast2-cio 1
yast2-isns 1
yast2-online-update-configuration 1
yast2-nis-client 1
yast2-iscsi-client 1
yast2-ftp-server 1
yast2-journal 1
yast2-ruby-bindings 1
yast2-geo-cluster 1
yast2-iplb 1
yast2-samba-server 1
yast2-boot-server 1
yast2-mail 1
yast2-slp-server 1
yast2-scanner 1
yast2-proxy 1
yast2-snapper 1
yast2-docker 1
yast2-caasp 1
yast2-nfs-client 1
yast2-nis-server 1
yast2-rdp 1
yast2-tftp-server 1
yast2-crowbar 1
yast2-fcoe-client 1
yast2-kdump 1
yast2-reipl 1
yast2-dhcp-server 1
yast2-rear 1
yast2-dns-server 1
yast2-squid 1
yast2-sysconfig 1
yast2-iscsi-lio-server 1
yast2-auth-client 1
yast2-audit-laf 1
yast2-printer 1
yast2-services-manager 1
system-role-hpc-compute 1
yast2-adcommon-python 1
yast2-aduc 1
yast2-samba-provision 1
yast2-alternatives 2
yast2-vm 2
yast2-sound 2
yast2-s390 2
yast2-control-center 2
yast2-cluster 2
yast2-http-server 2
yast2-drbd 2
yast2-tune 2
yast2-devtools 2
skelcd-control-SLES4SAP 2
yast2-online-update 2
yast2-country 2
yast2-auth-server 2
yast2-multipath 2
skelcd-control-Kubic 2
skelcd-control-SLE_RT 2
skelcd-control-suse-manager-proxy 2
yast2-vpn 3
skelcd-control-SLED 3
yast2-migration 3
yast2-users 3
yast2-add-on 3
yast2-apparmor 3
yast2-security 3
skelcd-control-openSUSE 3
skelcd-control-SLE_HPC 3
skelcd-control-suse-manager-server 3
yast2-theme 4
skelcd-control-SLES 4
yast2-samba-client 4
yast2-ntp-client 4
yast2-update 5
yast2-schema 5
yast2-firewall 5
yast2-firstboot 6
yast2-bootloader 7
yast2-configuration-management 7
yast2-installation-control 7
autoyast2 9
yast2-network 12
yast2-installation 13
skelcd-control-leanos 15
yast2-packager 15
yast2-registration 17
yast2 20
yast2-storage-ng 39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment