Skip to content
Snippets Groups Projects

Refactored the plantuml module

Merged Alexander Schlemmer requested to merge f-refactor-plantuml into dev
3 unresolved threads

Summary

Two main things were refactored:

  • The recordtypes to plantuml function allows for more customizations, e.g. leaving out the legend and others.
  • The to_graphics function uses a temporary directory for generating the files and furthermore is able to output customized formats.

Focus

The changes in recordtypes to plantuml are self-explanatory. The function to_graphics should be most intensively reviewed and tested (manually).

Test Environment

See the attached files which show an example script and example output for the demo instance that can be used for testing.

download_data_model.py

demo_data_model.svg

demo_data_model

Check List for the Author

Please, prepare your MR for a review. Be sure to write a summary and a focus and create gitlab comments for the reviewer. They should guide the reviewer through the changes, explain your changes and also point out open questions. For further good practices have a look at our review guidelines

  • All automated tests pass
  • Reference related issues
  • Up-to-date CHANGELOG.md (or not necessary)
  • Annotations in code (Gitlab comments)
    • Intent of new code
    • Problems with old code
    • Why this implementation?

Check List for the Reviewer

  • I understand the intent of this MR
  • All automated tests pass
  • Up-to-date CHANGELOG.md (or not necessary)
  • The test environment setup works and the intended behavior is reproducible in the test environment
  • In-code documentation and comments are up-to-date.
  • Check: Are there specifications? Are they satisfied?

For further good practices have a look at our review guidelines.

Edited by Henrik tom Wörden

Merge request reports

Pipeline #21951 passed

Pipeline: LinkAhead

#21952

    Pipeline passed for 1b8d53ec on f-refactor-plantuml

    Approval is optional

    Merged by Henrik tom WördenHenrik tom Wörden 2 years ago (Apr 21, 2022 8:27am UTC)

    Loading

    Pipeline #21953 passed

    Pipeline: LinkAhead

    #21954

      Pipeline passed for 0cd4df88 on dev

      Activity

      Filter activity
      • Approvals
      • Assignees & reviewers
      • Comments (from bots)
      • Comments (from users)
      • Commits & branches
      • Edits
      • Labels
      • Lock status
      • Mentions
      • Merge request status
      • Tracking
      301 with open(pu_filename, "w") as pu_file:
      302 pu_file.write(pu)
      303
      304 cmd = "plantuml -tsvg %s" % pu_filename
      305 print("Executing:", cmd)
      306
      307 if os.system(cmd) != 0:
      308 raise Exception("An error occured during the execution of plantuml. "
      309 "Is plantuml installed?")
      353 pu = recordtypes_to_plantuml_string(recordtypes,
      354 add_properties,
      355 add_recordtypes,
      356 add_legend,
      357 style)
      358
      359 if output_dirname is None:
    • 304 cmd = "plantuml -tsvg %s" % pu_filename
      305 print("Executing:", cmd)
      306
      307 if os.system(cmd) != 0:
      308 raise Exception("An error occured during the execution of plantuml. "
      309 "Is plantuml installed?")
      353 pu = recordtypes_to_plantuml_string(recordtypes,
      354 add_properties,
      355 add_recordtypes,
      356 add_legend,
      357 style)
      358
      359 if output_dirname is None:
      360 output_dirname = os.getcwd()
      361
      362 allowed_formats = [
    • 263 293 if is_reference(prop.datatype) and prop.datatype != db.FILE and depth > 0:
      264 294 rt = db.RecordType(name=get_referenced_recordtype(prop.datatype)).retrieve()
      265 295 retrieve_substructure([rt], depth-1, result_id_set, result_container, False)
      296
      297 # TODO: clean up this hack
      298 # TODO: make it also work for files
      299 if is_reference(prop.datatype) and prop.value is not None:
    • Alexander Schlemmer marked the checklist item Annotations in code (Gitlab comments) as completed

      marked the checklist item Annotations in code (Gitlab comments) as completed

    • mentioned in issue #101 (closed)

    • added 1 commit

      Compare with previous version

    • added 1 commit

      • 97b3ec48 - DOC: added note for missing type checks

      Compare with previous version

    • mentioned in issue #108 (closed)

    • added 1 commit

      • 3a76adea - MAINT: removed a hack that was accidentally introduced in retrieve_substructure function

      Compare with previous version

    • Alexander Schlemmer marked the checklist item Reference related issues as completed

      marked the checklist item Reference related issues as completed

    • added 60 commits

      Compare with previous version

    • added 1 commit

      Compare with previous version

    • added 1 commit

      Compare with previous version

    • Henrik tom Wörden marked the checklist item I understand the intent of this MR as completed

      marked the checklist item I understand the intent of this MR as completed

    • Henrik tom Wörden marked the checklist item All automated tests pass as completed

      marked the checklist item All automated tests pass as completed

    • Henrik tom Wörden marked the checklist item The test environment setup works and the intended behavior is reproducible in the test as completed

      marked the checklist item The test environment setup works and the intended behavior is reproducible in the test as completed

    • Henrik tom Wörden marked the checklist item In-code documentation and comments are up-to-date. as completed

      marked the checklist item In-code documentation and comments are up-to-date. as completed

    • Henrik tom Wörden marked the checklist item Check: Are there specifications? Are they satisfied? as completed

      marked the checklist item Check: Are there specifications? Are they satisfied? as completed

    • Henrik tom Wörden enabled an automatic merge when the pipeline for 1b8d53ec succeeds

      enabled an automatic merge when the pipeline for 1b8d53ec succeeds

    • mentioned in commit 0cd4df88

    • Please register or sign in to reply
      Loading