common-workflow-language / common-workflow-language/common-workflow-language

avro schema namespace is missing

Open
#178 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Common Workflow Language
Stars
1.5k
Forks
193
PR merge metrics
No merged PRs in 30d

Description

Not sure if this is a common-workflow-language or a schema-salad issue. Compiling with the current versions results in an avro schema with no namespace.

ex:

```
root@41cd8c875c1a:/common-workflow-language# git log | head -n3
commit f325a59a35c6970ac94a065bb7d6c01e37c13484
Author: Peter Amstutz
Date: Fri Jan 8 14:40:39 2016 -0500
root@41cd8c875c1a:/common-workflow-language# python -mschema_salad --print-avro draft-3/CommonWorkflowLanguage.yml > cwl.avsc
/root/.local/lib/python2.7/site-packages/schema_salad/__main__.py 1.4.20160108200836
root@41cd8c875c1a:/common-workflow-language# grep namespace cwl.avsc
root@41cd8c875c1a:/common-workflow-language#
```

My understanding is that a namespace (like io.github.common-workflow-language or org.common.wl ) is best practice to avoid a conflict if a program uses two schema from different sources with the same name. ex: https://avro.apache.org/docs/1.7.7/gettingstartedjava.html#Defining+a+schema

In Java, this has the added side-effect of creating generated classes (when doing something like `java -jar avro-tools-1.7.7.jar compile schema cwl.edited.avsc cwl-temp`) in the default package which are difficult to work with.

The current workaround is to do something like `sed -i '1i package cwl;' cwl-temp/*` to prepend a package name to all generated classes.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with draft-3/CommonWorkflowLanguage.yml and the schema_salad command used to generate cwl.avsc. Check where the Avro schema is assembled and whether the namespace is lost there; done means the generated schema includes a namespace and the documented Java generation workflow no longer produces default-package classes.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.