Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metadata API: Remove Signed.bump_expiration() method #1743

Merged

Conversation

lukpueh
Copy link
Member

@lukpueh lukpueh commented Dec 22, 2021

Fixes #1727

Description of the changes being introduced by the pull request:

Remove bump_expiration() method, which is unlikely to be used as is, i.e. bump to "current expiration date plus delta". A more realistic use case is to bump to "now plus delta" (see #1727 for details).

Moreover, bump_expiration can either way easily be replaced by a one-liner expression using the 'datetime' module. A corresponding code snippet is added to the expires property's docstring.
Note: expires became a property with a millisec-removing setter (for spec conformance) in #1712, which further reduces the need for a convenience bump_expiration method.

This patch also

  • removes a related unit test and updates another one, and
  • updates rtd/sphinx config to display inherited members, most notably the expires property with said code snippet (see e.g. Root.expires)

Please verify and check that the pull request fulfills the following
requirements
:

  • The code follows the Code Style Guidelines
  • Tests have been added for the bug fix or new feature
  • Docs have been added for the bug fix or new feature

Remove `bump_expiration()` method, which is unlikely to be used as
is, i.e.  bump to "current expiration date plus delta". A more
realistic use case is to bump to "now plus delta" (see theupdateframework#1727 for
details).

Moreover, bump_expiration can either way easily be replaced by a
one-liner expression using the 'datetime' module. A corresponding
code snippet is added to the `expires` property's docstring.  Note:
`expires` became a property with a millisec-removing setter (for
spec conformance) in  theupdateframework#1712, which further reduces the need for a
convenience bump_expiration method.

This patch also removes a related unit test and updates another
one.

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
Update sphinx/rtd conf to display inherited members. This is
enabled specifically for the newly added `expires` property,
which has a useful code snippet in the docstring.

We don't display
- them on the tuf.api automodule overview page (avoid duplicates)
- members inherited from the built-in Exception class

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
@coveralls
Copy link

Pull Request Test Coverage Report for Build 1610942226

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.0008%) to 97.701%

Totals Coverage Status
Change from base Build 1606187413: -0.0008%
Covered Lines: 4093
Relevant Lines: 4173

💛 - Coveralls

Copy link
Collaborator

@MVrachev MVrachev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@joshuagl joshuagl merged commit 537a019 into theupdateframework:develop Jan 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Metadata API: rethink the expiry related API
4 participants