Bug 49620 - check for monotonic timestamp in debian/changelog
check for monotonic timestamp in debian/changelog
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: ucslint
UCS 4.4
Other Linux
: P5 normal (vote)
: UCS 4.4-4-errata
Assigned To: Philipp Hahn
Florian Best
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2019-06-07 16:02 CEST by Philipp Hahn
Modified: 2020-06-24 12:52 CEST (History)
2 users (show)

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:
hahn: Patch_Available+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Hahn univentionstaff 2019-06-07 16:02:17 CEST
"dh_strip_nondeterminism" uses the timestamp of the first entry of "debian/changelog". If that entry is copy/pasted from another UCS release branch, it may happen that the timestamp is not monotonically increasing. So it may happen that a later package contains files with an earlier timestamp than a previous package, which breaks for example "update-python-modules" from "python-support".

ucslint should check the timestamps of the first 2 entries to assert, that they are monotonically increasing.
Comment 1 Sönke Schwardt-Krummrich univentionstaff 2019-06-07 16:04:29 CEST
(In reply to Philipp Hahn from comment #0)
> ucslint should check the timestamps of the first 2 entries to assert, that
> they are monotonically increasing.

Please more than 2 entries.
Comment 2 Philipp Hahn univentionstaff 2019-06-07 21:01:34 CEST
(In reply to Sönke Schwardt-Krummrich from comment #1)
> (In reply to Philipp Hahn from comment #0)
> > ucslint should check the timestamps of the first 2 entries to assert, that
> > they are monotonically increasing.
> 
> Please more than 2 entries.

We already have packages, which are ordered wrong. You would need to fix those entries first before being able to build them again if you consider it a fatal error.
I already fixed old changelog entries several times by now for toolshed/LINT to succeed. So, yes we can do that.

So flag it as an error if the first 2 are wrong and as a warning if any two are wrong?

This is strict-monotonically, e.g. requiring <<
$ grep -c ^/ ~/BUG/49620_ucslint.run
55 debian/changelog files are incorrect
$ grep -c ^E ~/BUG/49620_ucslint.run
377 entries in total are wrong

This non-strict, e.g. allowing <=
$ grep -c ^/ ~/BUG/49620_ucslint2.run
48
$ grep -c ^E ~/BUG/49620_ucslint2.run
335
Comment 3 Philipp Hahn univentionstaff 2019-06-08 07:02:25 CEST
git:phahn/49620-ucslint-changelog-monoton

For a UCS release wide scan do something linke this:
  cd ~/REPOS/ucs44
  find . -maxdepth 3 -name debian \( -execdir $PWD/packaging/ucslint/bin/ucslint -m 7 \; -o -print \)
Comment 4 Philipp Hahn univentionstaff 2019-06-12 13:19:03 CEST
https://git.knut.univention.de/univention/ucs/compare/4.4-0...phahn%2F49620-ucslint-changelog-monoton

find -maxdepth 3 -name doc -prune -o -name debian \( -execdir $PWD/packaging/ucslint/bin/ucslint -m 7 -c E -e E \; -o -ls \)
Comment 5 Philipp Hahn univentionstaff 2019-06-24 09:51:44 CEST
deb [trusted=yes] http://10.200.18.180/debian/ phahn49620-ucslint-changelog-monoton main

<http://jenkins.knut.univention.de:8080/job/UCS%20Branch%20Test/120/console>
Comment 6 Philipp Hahn univentionstaff 2020-05-21 14:52:10 CEST
Fixes as part of
commit 201203e4241d94e359d91633881254ecd4182ed7 (HEAD -> 4.4-4)
Merge: b5c78bf91a fa6215000c
Author: Philipp Hahn <hahn@univention.de>
Date:   Wed May 20 17:19:41 2020 +0200

    Bug #49704: Merge branch 'phahn/ucslint' into 4.4-4
    
    Bug #42294      run on svn checkin - don't check generated files for copyright
    Bug #51248      Check debian/compat
    Bug #51247      Minimal debian/*.dirs
    Bug #51246      Check for unassigned debian/$pkg.$dh files
    Bug #51107      Check UCR template for valid Python2/3 syntax
    Bug #51105      Check for invalid Python string escape
    Bug #49704      Migrate ucslint to Python3
    Bug #49683      py3: Check debian/*.ucr files for ConfigParser(strict=true)
    Bug #49620      check for monotonic timestamp in debian/changelog
    Bug #48747      ucslint doesn't warn/error about joinscript-api-bindpwdfile in unjoin scripts
    Bug #43981      Add check for wrong comparision in postinst

[4.4-4] fa6215000c Bug #42294: Invoke ucslint from GitLab-CI
[4.4-4] 7c26cced9e Bug #42294: debian/control ucslint
[4.4-4] f749577efc Bug #42294 ucslint: Run from CI pipeline
[4.4-4] a668865b19 Bug #43981 ucslint: Check Debian maintainer script actions
[4.4-4] 1f5c5b5a09 Bug #49704 ucslint: Convert 0017 to UPCFileTeste
[4.4-4] 1ad5c9bf56 Bug #49704 ucslint: Convert 0002 to UPCFileTeste
[4.4-4] 1f995151c7 Bug #48747 ucslint: Check .uinst files
[4.4-4] b6685dee8a Bug #48747 ucslint: Add filename and line number
[4.4-4] 826f9cc9c3 Bug #49620 USS: Make debian/changelog monotone
[4.4-4] 7853e7e0b7 Bug #49620 ssl: Make debian/changelog monotone
[4.4-4] 7d459daf6f Bug #49620 ucslint: Check debian/changelog is strict-monotonical
[4.4-4] 348d00439e Bug #49683 ucslint: Allow UCRWARNING_ASCII= UCR header
[4.4-4] 296c8949c5 Bug #49688 diary: Remove duplicate UCRV
[4.4-4] 16d7176b52 Bug #49665 samba: Remove duplicate UCRV
[4.4-4] adae84d0be Bug #49689 mail: Remove duplicate UCRV
[4.4-4] 18ba8ddaee Bug #49683 ucslint: Use ConfigParser
[4.4-4] eac6b51cc0 Bug #49683 ucslint: Duplicate check debian/*.ucr
[4.4-4] 5d559b8d0d Bug #49683 ucslint: Incremental syntax check debian/*.ucr
[4.4-4] 75d4831a3c Bug #49683 ucslint: Check debian/*.ucr syntax
[4.4-4] aa72725106 Bug #49683 ucslint: Fix regular expressions
[4.4-4] 6399d11505 Bug #51107 ucslint: Extend testsuite for 0020
[4.4-4] daad950141 Bug #51107 ucslint: flake8 for conffiles
[4.4-4] f5857ea6ab Bug #51246: Rename debian/* files
[4.4-4] 0c005a03f0 Bug #51246 ucslint: Ignore more DH files
[4.4-4] 303365ddc0 Bug #51247: Cleanup debian/*.dirs
[4.4-4] 99406e1ee5 Bug #51247 ucslint: Check debian/*.dirs
[4.4-4] d7df4bcddd Bug #51248: Sync debian/control with debian/compat
[4.4-4] f86daf058d Bug #51248: wrap-and-sort debian/control
[4.4-4] 81aee7ecc9 Bug #51248 ucslint: Check debian/compat
[4.4-4] 00e37d83c7 Bug #51105 ucslint: Check invalid Python string literals
[4.4-4] 3a9554a235 Bug #51105 ucslint: Extract common code
[4.4-4] d96ce205b7 Bug #49704 ucslint: Remove Python 2 code
[4.4-4] b9efd4a3de Bug #49704 ucslint: Use file context manager
[4.4-4] 48ad9457af Bug #49704 ucslint: Fix unicode handling
[4.4-4] 99014c3177 Bug #49704 ucslint: flake8 cleanup
[4.4-4] c159741c4c Bug #49704 ucslint: flake8 --help
[4.4-4] ff50080c19 Bug #49704 ucslint: Refactor 0018
[4.4-4] db86907de8 Bug #49704 ucslint: Convert message info to tuple
[4.4-4] 0e591aa022 Bug #49704 ucslint: Make error reporting independent from display filter
[4.4-4] bd9eeaa8f9 Bug #49704 ucslint: Add JUnit XML support
[4.4-4] a23cc0c887 Bug #49704 ucslint: Add missing mypy/PyDoc
[4.4-4] 71909f14a6 Bug #49704 ucslint: Fix ucspep8 issues
[4.4-4] 4ac398b60d Bug #49704 ucslint: Move to univention namespace
[4.4-4] 8ce7fd7727 Bug #49704 ucslint: Use optparse.append
[4.4-4] bc14dadf88 Bug #49704 ucslint: Improve --help output
[4.4-4] 7ea7202095 Bug #49704 ucslint: Convert to setup.py
[4.4-4] 46abd8b64a Bug #49704 ucslint: Run test suite
[4.4-4] 2deac0ddbd Bug #49704 ucslint: Convert to Python3
[4.4-4] 5c85c35487 Bug #49704 ucslint: Use EnvironmentError
[4.4-4] 7b9f3ba328 Bug #49704 ucslint: Remove default postinit() method
[4.4-4] 7c631f5fe7 Bug #49704 ucslint: Remove dead code
[4.4-4] 89c6b0fe12 Bug #49704 ucslint: Fix shellcheck issues in tests

[4.4-4] 1bde0a6dee Bug #49704 ucslint: Fix running test suite
 packaging/ucslint/debian/control | 1 +
 1 file changed, 1 insertion(+)

[4.4-4] 5f06175d5f Bug #49704 ucslint: Fix running test suite 2
 packaging/ucslint/debian/control | 1 +
 1 file changed, 1 insertion(+)

[4.4-4] db22237608 Bug #49704 ucslint: Fix merged package install
 packaging/ucslint/debian/ucslint.install | 1 -
 1 file changed, 1 deletion(-)

[4.4-4] 2c4ee05348 Bug #51107 ucslint: Fix testsuite for 0020
 packaging/ucslint/testframework/0020.correct           | 2 +-
 packaging/ucslint/testframework/0020/conffiles/python3 | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

[4.4-4] 84d8d9c2cc Bug #51107 ucslint: Fix testsuite for 0020 2
 packaging/ucslint/testframework/0020.correct        |  6 +++++-
 packaging/ucslint/testframework/0020/test.py        |  2 +-
 packaging/ucslint/testframework/0020/test2          |  2 +-
 packaging/ucslint/ucslint-sort-output.py            |  2 +-
 packaging/ucslint/univention/ucslint/0020-flake8.py | 10 +++++++---
 5 files changed, 15 insertions(+), 7 deletions(-)


Package: ucslint
Version: 8.0.0-14A~4.4.0.202005210708
Branch: ucs_4.4-0
Scope: errata4.4-4

[4.4-4] 2bf7de9926 Bug #49704: ucslint 8.0.0-14A~4.4.0.202005210708
 doc/errata/staging/ucslint.yaml | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
Comment 7 Florian Best univentionstaff 2020-05-25 12:21:26 CEST
OK: smaller versions are detected
OK: smaller dates are detected
OK: error if the most recent changelog is wrong
OK: YAML
Comment 8 Florian Best univentionstaff 2020-05-25 12:41:02 CEST
FYI: UCS@school needs action:

ucs-school-radius-802.1x.ucslint:E:0007-3: debian/changelog: not strict-monotonically increasing by time: Mon, 18 Feb 2019 16:51:05 +0100 <= Tue, 26 Feb 2019 17:26:00 +0100
ucs-school-umc-computerroom.ucslint:E:0007-3: debian/changelog: not strict-monotonically increasing by time: Mon, 10 Feb 2020 09:00:02 +0100 <= Mon, 10 Feb 2020 09:00:02 +0100
Comment 9 Erik Damrose univentionstaff 2020-06-24 12:52:54 CEST
<http://errata.software-univention.de/ucs/4.4/630.html>