Skip to content

Dr.Egeria: an Update that names the element by Display Name only can create a duplicate, when Create added a Version Identifier #613

Backlog

Description

@dwolfson

Summary
A Dr.Egeria Update <X> that identifies the element by Display Name only, with no GUID, Qualified Name or Version Identifier, can create a new element instead of updating the existing one. This happens for commands whose Create adds the default Version Identifier 1.0 to the qualified name.

Reproduction (seen live on a scratch platform, digest 5a8d6a12, pyegeria at odpi/main 98837e0)

  1. Run Create Solution Boundary with Display Name d1-probe. The qualified name is Coco Pharmaceuticals::SolutionBoundary::d1-probe::1.0.
  2. Run Update Solution Boundary with Display Name d1-probe and a new Description.
  3. Dr.Egeria derives …::SolutionBoundary::d1-probe, without ::1.0, and finds nothing. It rewrites the Update to a Create and makes a second Solution Boundary. The original keeps its old description.

Cause (the same code on 6.3.3, 4cbb90d, and on main, 98837e0)

  1. md_processing/v2/parsing.py (about lines 124–134 and 187–201): defaults such as Version Identifier 1.0 are applied only to creation verbs. update is in skip_defaults_verbs.
  2. processors.py derive_qualified_name (about lines 1624–1647) appends ::<Version Identifier> only when one is present.
  3. fetch_as_is → resolve_element_guid, pass 1: the qualified-name-or-display-name match fails for commands with a type prefix.
  4. rewriters.py CommandRewriter.rewrite: an Update whose target doesn't exist becomes a Create.

Scope (offline check, report D1-SCOPE 1f1c2dfb)

  • 6.3.3 has 156 Create commands, and 89 are exposed: those with a default Version Identifier and a non-empty QN prefix. Examples are Glossary Term and Data Structure.
  • main has 158 Create commands, and 91 are exposed. The 2 new ones are Solution Boundary and Design Model Boundary (feat: solution boundaries (odpi/egeria#9465) in pyegeria, Dr.Egeria boundary commands, Solution Role attribute fix #612).
  • Commands with an empty prefix (Solution Blueprint, Component, Role and others) are probably found by display name, and so are not rewritten.
  • About 20 processor modules override fetch_as_is. They haven't been checked one by one.

Workaround: on an Update, give the Version Identifier, the Qualified Name or the GUID.

Possible fixes, for discussion:

  • (a) apply the Version Identifier default on Update when deriving the lookup QN, without writing it;
  • (b) in resolve_element_guid, fall back to an exact Display Name match within the command's type before giving up;
  • (c) never rewrite an Update to a Create when the user didn't ask for upsert, and report "not found" instead.

Related note: the empty-prefix commands (Solution Blueprint, Component, Role, ISC, the project kinds, Task, Campaign, Experiment) get qualified names with no type prefix or local qualifier, unlike the other commands.

Release note line for pyegeria 6.3.4, under known issues: "Update by Display Name only can create a duplicate when Create added a Version Identifier; give the Version Identifier or the GUID."

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions