Skip to content

Metadata API: Consider removing 'update()' methods #1627

Closed

Description

@lukpueh

[edited on 12/20/2021: Mention ".json" bias]
[edited on 11/10/2021: Point to #1230]

Description of issue or feature request:

The Metadata API classes for top-level roles Targets, Timestamp and Snapshot each have an update method. They have been criticised in several places (#1193 (comment) pp, #1223 (comment) pp, #1620 (comment)).

More specifically the following doubts have been expressed:

Current behavior:

  • purpose of method is unclear
  • method name is ambiguous

Expected behavior:

  • Make a better case for the purpose and names of methods and document it, or replace/remove.

Activity

  1. jku commented on Oct 26, 2021

    @jku
    Member

    The case for (better named) update methods is that they do allow us to do validation on user input, while inserting things directly to a dictionary does not.

    This is a major advantage in an untyped language but, I think, made slightly less important with good static typing support: calling code is still free to insert nonsense into our Metadata data structures, but static typing checks will inform them that they are doing bad things (at least it will once we fix #1633). We may still want to do the input validation but I would argue it's not as critical as it would be otherwise.

  2. added
    backlogIssues to address with priority for current development goals
    on Nov 10, 2021
  3. MVrachev commented on Nov 10, 2021

    @MVrachev
    Collaborator

    Issue #1230 and this one are almost the same.
    Maybe we can close #1230?

  4. lukpueh commented on Nov 10, 2021

    @lukpueh
    MemberAuthor

    Added one concern from #1230 to the issue description above. Will close there.

  5. self-assigned this
    on Dec 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

backlogIssues to address with priority for current development goalsrepositoryRelated to the repository implementation

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions