Skip to content

bug: missing abstract length validation (<= 200 chars) and incomplete Databus URI validation #89

Description

@yush-1018

Bug Report

Describe the bug

  1. The CLI help text and function docstring for deploy specify that the abstract parameter must be at most 200 characters long (max 200 chars). However, create_dataset() in databusclient/api/deploy.py does not validate this limit before constructing and sending the dataset payload.
  2. Databus URI validation for version_id currently relies on simple string splitting (rsplit('/', 4)), which fails to detect missing URL schemes (http/https), empty path segments, or invalid characters early on the client side.

To Reproduce
Steps to reproduce the behavior:

  1. Run the deploy CLI command passing an abstract longer than 200 characters:
    databusclient deploy \
      --version-id "https://databus.dbpedia.org/user/group/artifact/1.0.0" \
      --title "Sample Title" \
      --abstract "$(python3 -c 'print("A"*210)')" \
      --description "Sample Description" \
      --license "https://dalicc.net/licenses/cc-by-4.0" \
      --apikey "dummy_key" \
      https://example.com/data.ttl
    

Expected behavior

  1. The client should validate len(artifact_version_abstract.strip()) <= 200 locally in create_dataset() and cli.py, raising a BadArgumentException if the limit is exceeded.
  2. The client should validate version_id against a proper URL/URI format before constructing dataset metadata.

Additional context (optional)

  • Affected file: databusclient/api/deploy.py (lines 311-365) and databusclient/cli.py.
  • Adding unit tests for abstract length enforcement in tests/test_deploy.py will prevent future regressions.

Activity

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions